show/hide tooltip if title length changes enough while mouse is over the iconbutton
This commit is contained in:
parent
a97ba40053
commit
706ec5c262
1 changed files with 7 additions and 8 deletions
|
@ -119,6 +119,8 @@ void IconButton::showTooltip() {
|
||||||
|
|
||||||
if (FbTk::TextButton::textExceeds(xoffset))
|
if (FbTk::TextButton::textExceeds(xoffset))
|
||||||
m_win.screen().showTooltip(m_win.title());
|
m_win.screen().showTooltip(m_win.title());
|
||||||
|
else
|
||||||
|
m_win.screen().hideTooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IconButton::clear() {
|
void IconButton::clear() {
|
||||||
|
@ -238,14 +240,11 @@ void IconButton::update(FbTk::Subject *subj) {
|
||||||
} else {
|
} else {
|
||||||
m_icon_window.clear();
|
m_icon_window.clear();
|
||||||
}
|
}
|
||||||
// if the title was changed AND the tooltip window is visible AND
|
|
||||||
// we have had an enter notify event ( without the leave notify )
|
// if the title was changed AND the mouse is over *this,
|
||||||
// update the text inside it
|
// update the tooltip
|
||||||
if (subj == &m_win.titleSig() &&
|
if (subj == &m_win.titleSig() && m_has_tooltip)
|
||||||
m_has_tooltip &&
|
showTooltip();
|
||||||
m_win.screen().tooltipWindow().isVisible()) {
|
|
||||||
m_win.screen().tooltipWindow().updateText(m_win.title());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue