diff options
-rw-r--r-- | src/IconButton.cc | 15 |
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 | ||
124 | void IconButton::clear() { | 126 | void 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 | ||