┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-04-09 20:29:09 +0000
committerPeter Penz <[email protected]>2008-04-09 20:29:09 +0000
commite847f4fec300b8a80679909c5d6a47ae21452732 (patch)
treed94bf9acd3e483c47057729b8c7b31e9226beaac /src
parent9d4250e10ada4e2410722951dbd406263b61041c (diff)
hide the tooltip when an item gets triggered or a context menu is opened
CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=795330
Diffstat (limited to 'src')
-rw-r--r--src/dolphinview.cpp13
-rw-r--r--src/dolphinview.h2
-rw-r--r--src/tooltipmanager.cpp5
-rw-r--r--src/tooltipmanager.h7
4 files changed, 25 insertions, 2 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 12d6be0d2..a31b67e12 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -82,7 +82,8 @@ DolphinView::DolphinView(QWidget* parent,
m_dolphinModel(dolphinModel),
m_dirLister(dirLister),
m_proxyModel(proxyModel),
- m_iconManager(0)
+ m_iconManager(0),
+ m_toolTipManager(0)
{
setFocusPolicy(Qt::StrongFocus);
m_topLayout = new QVBoxLayout(this);
@@ -750,6 +751,9 @@ void DolphinView::triggerItem(const KFileItem& item)
return;
}
+ if (m_toolTipManager != 0) {
+ m_toolTipManager->hideTip();
+ }
emit itemTriggered(item); // caught by DolphinViewContainer or DolphinPart
}
@@ -767,6 +771,10 @@ void DolphinView::openContextMenu(const QPoint& pos)
item = fileItem(index);
}
+ if (m_toolTipManager != 0) {
+ m_toolTipManager->hideTip();
+ }
+
m_isContextMenuOpen = true; // TODO: workaround for Qt-issue xxxxxx
emit requestContextMenu(item, url());
m_isContextMenuOpen = false;
@@ -1086,7 +1094,7 @@ void DolphinView::createView()
m_iconManager->setShowPreview(m_showPreview);
if (DolphinSettings::instance().generalSettings()->showToolTips()) {
- new ToolTipManager(view, m_proxyModel);
+ m_toolTipManager = new ToolTipManager(view, m_proxyModel);
}
m_topLayout->insertWidget(1, view);
@@ -1112,6 +1120,7 @@ void DolphinView::deleteView()
m_columnView = 0;
m_fileItemDelegate = 0;
m_iconManager = 0;
+ m_toolTipManager = 0;
}
}
diff --git a/src/dolphinview.h b/src/dolphinview.h
index 40d382738..4ec1f42c8 100644
--- a/src/dolphinview.h
+++ b/src/dolphinview.h
@@ -52,6 +52,7 @@ class KDirLister;
class KFileItemDelegate;
class KUrl;
class KToggleAction;
+class ToolTipManager;
class QModelIndex;
class ViewProperties;
@@ -657,6 +658,7 @@ private:
DolphinSortFilterProxyModel* m_proxyModel;
IconManager* m_iconManager;
+ ToolTipManager* m_toolTipManager;
KUrl m_rootUrl;
};
diff --git a/src/tooltipmanager.cpp b/src/tooltipmanager.cpp
index 6af3bb8b6..c13398016 100644
--- a/src/tooltipmanager.cpp
+++ b/src/tooltipmanager.cpp
@@ -57,6 +57,11 @@ ToolTipManager::~ToolTipManager()
{
}
+void ToolTipManager::hideTip()
+{
+ hideToolTip();
+}
+
bool ToolTipManager::eventFilter(QObject* watched, QEvent* event)
{
if ((watched == m_view->viewport()) && (event->type() == QEvent::Leave)) {
diff --git a/src/tooltipmanager.h b/src/tooltipmanager.h
index 8223b5bc8..1902ac8f0 100644
--- a/src/tooltipmanager.h
+++ b/src/tooltipmanager.h
@@ -48,6 +48,13 @@ public:
DolphinSortFilterProxyModel* model);
virtual ~ToolTipManager();
+ /**
+ * Hides the currently shown tooltip. Invoking this method is
+ * only needed when the tooltip should be hidden although
+ * an item is hovered.
+ */
+ void hideTip();
+
protected:
virtual bool eventFilter(QObject* watched, QEvent* event);