┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Paul St James <[email protected]>2008-08-18 20:27:46 +0000
committerSimon Paul St James <[email protected]>2008-08-18 20:27:46 +0000
commit26df5e0041b0584d2fd8df8dfc520abee86f1e99 (patch)
treeab581008faf1d1574eee8c9d3a338ed39afb655a
parent58efff7c2c568a1f4b9713a0cae925b6f4a52bfd (diff)
Redraw the current tooltip at its original position if its data (icon, text etc) changes. Approved by Fredrik.
svn path=/trunk/KDE/kdebase/apps/; revision=848982
-rw-r--r--src/ktooltip.cpp9
-rw-r--r--src/ktooltip_p.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/ktooltip.cpp b/src/ktooltip.cpp
index 3c1da3fba..39e06b4c7 100644
--- a/src/ktooltip.cpp
+++ b/src/ktooltip.cpp
@@ -95,6 +95,7 @@ QVariant KToolTipItem::data(int role) const
void KToolTipItem::setData(int role, const QVariant &data)
{
d->map[role] = data;
+ KToolTipManager::instance()->update();
}
@@ -471,6 +472,7 @@ void KToolTipManager::showTip(const QPoint &pos, KToolTipItem *item)
hideTip();
label->showTip(pos, item);
currentItem = item;
+ m_tooltipPos = pos;
}
void KToolTipManager::hideTip()
@@ -509,6 +511,13 @@ void KToolTipManager::setDelegate(KToolTipDelegate *delegate)
m_delegate = delegate;
}
+void KToolTipManager::update()
+{
+ if (currentItem == 0)
+ return;
+ label->showTip(m_tooltipPos, currentItem);
+}
+
KToolTipDelegate *KToolTipManager::delegate() const
{
return m_delegate;
diff --git a/src/ktooltip_p.h b/src/ktooltip_p.h
index 16ca85293..332df4854 100644
--- a/src/ktooltip_p.h
+++ b/src/ktooltip_p.h
@@ -44,6 +44,8 @@ public:
void setDelegate(KToolTipDelegate *delegate);
KToolTipDelegate *delegate() const;
+
+ void update();
private:
KToolTipManager();
@@ -51,6 +53,8 @@ private:
KAbstractToolTipLabel *label;
KToolTipItem *currentItem;
KToolTipDelegate *m_delegate;
+
+ QPoint m_tooltipPos;
#ifdef Q_WS_X11
bool haveArgbVisual;