diff options
author | fluxgen <fluxgen> | 2003-05-17 11:30:59 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-05-17 11:30:59 (GMT) |
commit | 0e1eb7484118cfec7d065022d1391651ca70d7be (patch) | |
tree | eb3a41c7f2e3ca304c9dbcecf971826c9802f989 /src | |
parent | 1d49072a767b6c3525906135330d1d715616574c (diff) | |
download | fluxbox-0e1eb7484118cfec7d065022d1391651ca70d7be.zip fluxbox-0e1eb7484118cfec7d065022d1391651ca70d7be.tar.bz2 |
fixed autohide bug on toolbar buttons
Diffstat (limited to 'src')
-rw-r--r-- | src/ArrowButton.cc | 23 | ||||
-rw-r--r-- | src/ArrowButton.hh | 8 | ||||
-rw-r--r-- | src/Toolbar.cc | 16 |
3 files changed, 35 insertions, 12 deletions
diff --git a/src/ArrowButton.cc b/src/ArrowButton.cc index bc44393..1d3d9fe 100644 --- a/src/ArrowButton.cc +++ b/src/ArrowButton.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: ArrowButton.cc,v 1.2 2003/04/27 01:54:18 fluxgen Exp $ | 22 | // $Id: ArrowButton.cc,v 1.3 2003/05/17 11:30:59 fluxgen Exp $ |
23 | 23 | ||
24 | #include "ArrowButton.hh" | 24 | #include "ArrowButton.hh" |
25 | 25 | ||
@@ -28,7 +28,11 @@ ArrowButton::ArrowButton(ArrowButton::Type arrow_type, | |||
28 | int x, int y, | 28 | int x, int y, |
29 | unsigned int width, unsigned int height): | 29 | unsigned int width, unsigned int height): |
30 | FbTk::Button(parent, x, y, width, height), | 30 | FbTk::Button(parent, x, y, width, height), |
31 | m_arrow_type(arrow_type) { | 31 | m_arrow_type(arrow_type), |
32 | m_mouse_handler(0) { | ||
33 | |||
34 | window().setEventMask(ExposureMask | ButtonPressMask | ButtonReleaseMask | | ||
35 | EnterWindowMask | LeaveWindowMask); | ||
32 | } | 36 | } |
33 | 37 | ||
34 | ArrowButton::ArrowButton(ArrowButton::Type arrow_type, | 38 | ArrowButton::ArrowButton(ArrowButton::Type arrow_type, |
@@ -36,8 +40,11 @@ ArrowButton::ArrowButton(ArrowButton::Type arrow_type, | |||
36 | int x, int y, | 40 | int x, int y, |
37 | unsigned int width, unsigned int height): | 41 | unsigned int width, unsigned int height): |
38 | FbTk::Button(screen_num, x, y, width, height), | 42 | FbTk::Button(screen_num, x, y, width, height), |
39 | m_arrow_type(arrow_type) { | 43 | m_arrow_type(arrow_type), |
44 | m_mouse_handler(0) { | ||
40 | 45 | ||
46 | window().setEventMask(ExposureMask | ButtonPressMask | ButtonReleaseMask | | ||
47 | EnterWindowMask | LeaveWindowMask); | ||
41 | } | 48 | } |
42 | 49 | ||
43 | void ArrowButton::clear() { | 50 | void ArrowButton::clear() { |
@@ -60,6 +67,16 @@ void ArrowButton::buttonReleaseEvent(XButtonEvent &event) { | |||
60 | drawArrow(); | 67 | drawArrow(); |
61 | } | 68 | } |
62 | 69 | ||
70 | void ArrowButton::enterNotifyEvent(XCrossingEvent &ce) { | ||
71 | if (m_mouse_handler) | ||
72 | m_mouse_handler->enterNotifyEvent(ce); | ||
73 | } | ||
74 | |||
75 | void ArrowButton::leaveNotifyEvent(XCrossingEvent &ce) { | ||
76 | if (m_mouse_handler) | ||
77 | m_mouse_handler->leaveNotifyEvent(ce); | ||
78 | } | ||
79 | |||
63 | /** | 80 | /** |
64 | redraws the arrow button | 81 | redraws the arrow button |
65 | */ | 82 | */ |
diff --git a/src/ArrowButton.hh b/src/ArrowButton.hh index bcad0f2..d166935 100644 --- a/src/ArrowButton.hh +++ b/src/ArrowButton.hh | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: ArrowButton.hh,v 1.2 2003/04/27 01:54:18 fluxgen Exp $ | 22 | // $Id: ArrowButton.hh,v 1.3 2003/05/17 11:30:59 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef ARROWBUTTON_HH | 24 | #ifndef ARROWBUTTON_HH |
25 | #define ARROWBUTTON_HH | 25 | #define ARROWBUTTON_HH |
@@ -41,10 +41,14 @@ public: | |||
41 | void buttonReleaseEvent(XButtonEvent &event); | 41 | void buttonReleaseEvent(XButtonEvent &event); |
42 | void buttonPressEvent(XButtonEvent &event); | 42 | void buttonPressEvent(XButtonEvent &event); |
43 | void exposeEvent(XExposeEvent &event); | 43 | void exposeEvent(XExposeEvent &event); |
44 | void enterNotifyEvent(XCrossingEvent &ce); | ||
45 | void leaveNotifyEvent(XCrossingEvent &ce); | ||
44 | 46 | ||
47 | void setMouseMotionHandler(FbTk::EventHandler *eh) { m_mouse_handler = eh; } | ||
45 | private: | 48 | private: |
46 | void drawArrow(); | 49 | void drawArrow(); |
47 | Type m_arrow_type; | 50 | Type m_arrow_type; |
51 | FbTk::EventHandler *m_mouse_handler; | ||
48 | }; | 52 | }; |
49 | 53 | ||
50 | #endif // ARROWBUTTON_HH | 54 | #endif // ARROWBUTTON_HH |
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 52c707a..2508ec9 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Toolbar.cc,v 1.83 2003/05/15 23:30:03 fluxgen Exp $ | 25 | // $Id: Toolbar.cc,v 1.84 2003/05/17 11:30:59 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Toolbar.hh" | 27 | #include "Toolbar.hh" |
28 | 28 | ||
@@ -235,6 +235,10 @@ Toolbar::Frame::Frame(FbTk::EventHandler &evh, int screen_num): | |||
235 | evm.add(evh, window_label); | 235 | evm.add(evh, window_label); |
236 | evm.add(evh, clock); | 236 | evm.add(evh, clock); |
237 | 237 | ||
238 | psbutton.setMouseMotionHandler(&evh); | ||
239 | nsbutton.setMouseMotionHandler(&evh); | ||
240 | pwbutton.setMouseMotionHandler(&evh); | ||
241 | nwbutton.setMouseMotionHandler(&evh); | ||
238 | } | 242 | } |
239 | 243 | ||
240 | Toolbar::Frame::~Frame() { | 244 | Toolbar::Frame::~Frame() { |
@@ -287,6 +291,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi | |||
287 | m_clock_timer.setTimeout(delay); | 291 | m_clock_timer.setTimeout(delay); |
288 | m_clock_timer.start(); | 292 | m_clock_timer.start(); |
289 | 293 | ||
294 | m_theme.font().setAntialias(screen().antialias()); | ||
295 | |||
290 | hide_handler.toolbar = this; | 296 | hide_handler.toolbar = this; |
291 | m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); | 297 | m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); |
292 | m_hide_timer.fireOnce(true); | 298 | m_hide_timer.fireOnce(true); |
@@ -300,9 +306,6 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi | |||
300 | 306 | ||
301 | m_iconbar.reset(new IconBar(screen(), frame.window_label.window(), m_theme.font())); | 307 | m_iconbar.reset(new IconBar(screen(), frame.window_label.window(), m_theme.font())); |
302 | 308 | ||
303 | XMapSubwindows(display, frame.window.window()); | ||
304 | frame.window.show(); | ||
305 | |||
306 | // finaly: setup Commands for the buttons in the frame | 309 | // finaly: setup Commands for the buttons in the frame |
307 | typedef FbTk::SimpleCommand<BScreen> ScreenCmd; | 310 | typedef FbTk::SimpleCommand<BScreen> ScreenCmd; |
308 | FbTk::RefCount<FbTk::Command> nextworkspace(new ScreenCmd(screen(), | 311 | FbTk::RefCount<FbTk::Command> nextworkspace(new ScreenCmd(screen(), |
@@ -318,9 +321,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi | |||
318 | frame.pwbutton.setOnClick(prevwindow); | 321 | frame.pwbutton.setOnClick(prevwindow); |
319 | frame.nwbutton.setOnClick(nextwindow); | 322 | frame.nwbutton.setOnClick(nextwindow); |
320 | 323 | ||
321 | 324 | frame.window.showSubwindows(); | |
322 | reconfigure(); | 325 | frame.window.show(); |
323 | |||
324 | } | 326 | } |
325 | 327 | ||
326 | 328 | ||