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:
Peter Penz 2012-06-12 13:19:16 +02:00
parent 6c15705528
commit c95255eb90
3 changed files with 7 additions and 4 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -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;
}