]> cloud.milkyroute.net Git - dolphin.git/commitdiff
hide the tooltips when a key is pressed (thanks to Shaun Reich for the initial patch)
authorPeter Penz <peter.penz19@gmail.com>
Mon, 19 Jan 2009 08:57:35 +0000 (08:57 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 19 Jan 2009 08:57:35 +0000 (08:57 +0000)
CCMAIL: predator106@gmail.com

svn path=/trunk/KDE/kdebase/apps/; revision=913383

src/dolphincolumnwidget.cpp
src/dolphincolumnwidget.h
src/dolphinview.cpp

index b86cd72696c45a450fdb54b62333410bc6a1fb9d..af6246809d74c412e6e94395761dc0f60fee044d 100644 (file)
@@ -64,6 +64,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
     m_dolphinModel(0),
     m_proxyModel(0),
     m_previewGenerator(0),
+    m_toolTipManager(0),
     m_dropRect()
 {
     setMouseTracking(true);
@@ -140,7 +141,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
     m_previewGenerator->setPreviewShown(m_view->m_controller->dolphinView()->showPreview());
 
     if (DolphinSettings::instance().generalSettings()->showToolTips()) {
-        new ToolTipManager(this, m_proxyModel);
+        m_toolTipManager = new ToolTipManager(this, m_proxyModel);
     }
 
     m_dirLister->openUrl(url, KDirLister::NoFlags);
@@ -390,6 +391,9 @@ void DolphinColumnWidget::keyPressEvent(QKeyEvent* event)
     QListView::keyPressEvent(event);
     requestActivation();
     m_view->m_controller->handleKeyPressEvent(event);
+    if (m_toolTipManager != 0) {
+        m_toolTipManager->hideTip();
+    }
 }
 
 void DolphinColumnWidget::contextMenuEvent(QContextMenuEvent* event)
index c1bf6a836a6ed15e30d7819a1b1a4c257bcdde37..38649ca9dca2fe038e152446d5f5246c5f1351bf 100644 (file)
@@ -39,6 +39,7 @@ class KJob;
 class KFileItem;
 class KFileItemList;
 class SelectionManager;
+class ToolTipManager;
 class QPixmap;
 
 /**
@@ -163,6 +164,8 @@ private:
 
     KFilePreviewGenerator* m_previewGenerator;
 
+    ToolTipManager* m_toolTipManager;
+
     QRect m_dropRect;
 
     friend class DolphinColumnView;
index 6681fe1895421eca8dbfd26bff0da8909a89f6f2..ae120777ad12b2a2d51662510bee1ac1be1029e5 100644 (file)
@@ -863,6 +863,12 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
         }
         break;
 
+    case QEvent::KeyPress:
+        if ((watched == itemView()) && (m_toolTipManager != 0)) {
+            m_toolTipManager->hideTip();
+        }
+        break;
+
     default:
         break;
     }