diff options
| author | Peter Penz <[email protected]> | 2011-12-18 20:28:47 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-18 20:29:34 +0100 |
| commit | 023ab306c78f305866932e6e9cbb8e96acb69493 (patch) | |
| tree | 618254697815d4a950d3f7a6054932e6a8325227 /src/views/dolphinview.cpp | |
| parent | 45a42d6a4285ae9829c39717d7f8893b36e6df29 (diff) | |
Hide tooltips when dragging items
Diffstat (limited to 'src/views/dolphinview.cpp')
| -rw-r--r-- | src/views/dolphinview.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index b728397f3..0edcb2894 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -146,6 +146,7 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) : connect(controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF))); connect(controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF))); connect(controller, SIGNAL(headerContextMenuRequested(QPointF)), this, SLOT(slotHeaderContextMenuRequested(QPointF))); + connect(controller, SIGNAL(itemPressed(int,Qt::MouseButton)), this, SLOT(hideToolTip())); connect(controller, SIGNAL(itemHovered(int)), this, SLOT(slotItemHovered(int))); connect(controller, SIGNAL(itemUnhovered(int)), this, SLOT(slotItemUnhovered(int))); connect(controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*))); @@ -553,9 +554,7 @@ void DolphinView::setUrl(const KUrl& url) emit urlAboutToBeChanged(url); m_url = url; - if (GeneralSettings::showToolTips()) { - m_toolTipManager->hideToolTip(); - } + hideToolTip(); // It is important to clear the items from the model before // applying the view properties, otherwise expensive operations @@ -733,18 +732,12 @@ void DolphinView::slotItemMiddleClicked(int index) void DolphinView::slotItemContextMenuRequested(int index, const QPointF& pos) { - if (GeneralSettings::showToolTips()) { - m_toolTipManager->hideToolTip(); - } const KFileItem item = fileItemModel()->fileItem(index); emit requestContextMenu(pos.toPoint(), item, url(), QList<QAction*>()); } void DolphinView::slotViewContextMenuRequested(const QPointF& pos) { - if (GeneralSettings::showToolTips()) { - m_toolTipManager->hideToolTip(); - } emit requestContextMenu(pos.toPoint(), KFileItem(), url(), QList<QAction*>()); } @@ -802,7 +795,7 @@ void DolphinView::slotItemHovered(int index) { const KFileItem item = fileItemModel()->fileItem(index); - if (GeneralSettings::showToolTips()) { + if (GeneralSettings::showToolTips() && QApplication::mouseButtons() == Qt::NoButton) { QRectF itemRect = m_container->controller()->view()->itemContextRect(index); const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint()); itemRect.moveTo(pos); @@ -816,9 +809,7 @@ void DolphinView::slotItemHovered(int index) void DolphinView::slotItemUnhovered(int index) { Q_UNUSED(index); - if (GeneralSettings::showToolTips()) { - m_toolTipManager->hideToolTip(); - } + hideToolTip(); emit requestItemInfo(KFileItem()); } @@ -1050,7 +1041,6 @@ void DolphinView::updateViewState() } } - void DolphinView::hideToolTip() { if (GeneralSettings::showToolTips()) { |
