diff options
Diffstat (limited to 'src/IconButton.cc')
-rw-r--r-- | src/IconButton.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc index 09791c8..6b8118e 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc | |||
@@ -52,7 +52,8 @@ IconButton::IconButton(const FbTk::FbWindow &parent, | |||
52 | FbTk::TextButton(parent, focused_theme->text().font(), win.title()), | 52 | FbTk::TextButton(parent, focused_theme->text().font(), win.title()), |
53 | m_win(win), | 53 | m_win(win), |
54 | m_icon_window(*this, 1, 1, 1, 1, | 54 | m_icon_window(*this, 1, 1, 1, 1, |
55 | ExposureMask | ButtonPressMask | ButtonReleaseMask), | 55 | ExposureMask |EnterWindowMask | LeaveWindowMask | |
56 | ButtonPressMask | ButtonReleaseMask), | ||
56 | m_use_pixmap(true), | 57 | m_use_pixmap(true), |
57 | m_theme(win, focused_theme, unfocused_theme), | 58 | m_theme(win, focused_theme, unfocused_theme), |
58 | m_pm(win.screen().imageControl()) { | 59 | m_pm(win.screen().imageControl()) { |
@@ -79,6 +80,20 @@ void IconButton::exposeEvent(XExposeEvent &event) { | |||
79 | FbTk::TextButton::exposeEvent(event); | 80 | FbTk::TextButton::exposeEvent(event); |
80 | } | 81 | } |
81 | 82 | ||
83 | void IconButton::enterNotifyEvent(XCrossingEvent &ev) { | ||
84 | |||
85 | int xoffset = 1; | ||
86 | if (m_icon_pixmap.drawable() != 0) | ||
87 | xoffset = m_icon_window.x() + m_icon_window.width() + 1; | ||
88 | |||
89 | if (FbTk::TextButton::textExceeds(xoffset)) | ||
90 | m_win.screen().showTooltip(m_win.title()); | ||
91 | } | ||
92 | |||
93 | void IconButton::leaveNotifyEvent(XCrossingEvent &ev) { | ||
94 | m_win.screen().hideTooltip(); | ||
95 | } | ||
96 | |||
82 | void IconButton::moveResize(int x, int y, | 97 | void IconButton::moveResize(int x, int y, |
83 | unsigned int width, unsigned int height) { | 98 | unsigned int width, unsigned int height) { |
84 | 99 | ||