mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
Drag-pixmap fixes
- Don't use the selection-tinted icon when dragging a single item - Decrease the vertical gap for the hotspot - Prevent drawing tree-lines when dragging items for the Places Panel CCBUG: 301624
This commit is contained in:
parent
6c15705528
commit
c95255eb90
|
@ -1084,9 +1084,7 @@ void KItemListController::startDragging()
|
|||
const QPixmap pixmap = m_view->createDragPixmap(selectedItems);
|
||||
drag->setPixmap(pixmap);
|
||||
|
||||
// TODO: The vertical hotspot of -24 should be replaced by the
|
||||
// height of the QCursor-pixmap.
|
||||
const QPoint hotSpot(pixmap.width() / 2, -24);
|
||||
const QPoint hotSpot(pixmap.width() / 2, 0);
|
||||
drag->setHotSpot(hotSpot);
|
||||
|
||||
drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction);
|
||||
|
|
|
@ -370,8 +370,13 @@ QPixmap KItemListWidget::createDragPixmap(const QStyleOptionGraphicsItem* option
|
|||
|
||||
const bool oldAlternateBackground = m_alternateBackground;
|
||||
setAlternateBackground(false);
|
||||
const bool wasSelected = m_selected;
|
||||
setSelected(false);
|
||||
|
||||
paint(&painter, option, widget);
|
||||
|
||||
setAlternateBackground(oldAlternateBackground);
|
||||
setSelected(wasSelected);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
|
|
@ -411,7 +411,7 @@ QPixmap KStandardItemListWidget::createDragPixmap(const QStyleOptionGraphicsItem
|
|||
QWidget* widget)
|
||||
{
|
||||
QPixmap pixmap = KItemListWidget::createDragPixmap(option, widget);
|
||||
if (m_layout != DetailsLayout || styleOption().extendedSelectionRegion) {
|
||||
if (m_layout != DetailsLayout) {
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue