aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-10-07 21:32:42 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-10-07 21:32:42 (GMT)
commit706ec5c262dd8b99238d1db4871e6de071cf2624 (patch)
tree35607c0c5089dd04fabcb7bcf14052cb55cfa69b
parenta97ba40053c446ae1fb19f5cd381b4188adac22f (diff)
downloadfluxbox_pavel-706ec5c262dd8b99238d1db4871e6de071cf2624.zip
fluxbox_pavel-706ec5c262dd8b99238d1db4871e6de071cf2624.tar.bz2
show/hide tooltip if title length changes enough while mouse is over the iconbutton
-rw-r--r--src/IconButton.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index b411a23..d63f6da 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -119,6 +119,8 @@ void IconButton::showTooltip() {
119 119
120 if (FbTk::TextButton::textExceeds(xoffset)) 120 if (FbTk::TextButton::textExceeds(xoffset))
121 m_win.screen().showTooltip(m_win.title()); 121 m_win.screen().showTooltip(m_win.title());
122 else
123 m_win.screen().hideTooltip();
122} 124}
123 125
124void IconButton::clear() { 126void IconButton::clear() {
@@ -238,14 +240,11 @@ void IconButton::update(FbTk::Subject *subj) {
238 } else { 240 } else {
239 m_icon_window.clear(); 241 m_icon_window.clear();
240 } 242 }
241 // if the title was changed AND the tooltip window is visible AND 243
242 // we have had an enter notify event ( without the leave notify ) 244 // if the title was changed AND the mouse is over *this,
243 // update the text inside it 245 // update the tooltip
244 if (subj == &m_win.titleSig() && 246 if (subj == &m_win.titleSig() && m_has_tooltip)
245 m_has_tooltip && 247 showTooltip();
246 m_win.screen().tooltipWindow().isVisible()) {
247 m_win.screen().tooltipWindow().updateText(m_win.title());
248 }
249 248
250} 249}
251 250