diff options
author | markt <markt> | 2007-04-08 17:57:49 (GMT) |
---|---|---|
committer | markt <markt> | 2007-04-08 17:57:49 (GMT) |
commit | 863eca5517b4f91e26d889d598f41816acf60a40 (patch) | |
tree | 18be5baa27a1c5fa8523ff951bdf751b8f163a44 /src/Toolbar.cc | |
parent | 12a8b3c038c9ccb577c699d41a1d19602132a7a8 (diff) | |
download | fluxbox-863eca5517b4f91e26d889d598f41816acf60a40.zip fluxbox-863eca5517b4f91e26d889d598f41816acf60a40.tar.bz2 |
added OnToolbar modifier, removed followModel, fixed unpressed button rendering
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r-- | src/Toolbar.cc | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 1305279..a1906c0 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "ToolbarTheme.hh" | 33 | #include "ToolbarTheme.hh" |
34 | 34 | ||
35 | #include "fluxbox.hh" | 35 | #include "fluxbox.hh" |
36 | #include "Keys.hh" | ||
36 | #include "Screen.hh" | 37 | #include "Screen.hh" |
37 | #include "IntResMenuItem.hh" | 38 | #include "IntResMenuItem.hh" |
38 | #include "BoolMenuItem.hh" | 39 | #include "BoolMenuItem.hh" |
@@ -279,6 +280,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width): | |||
279 | scrn.resourceManager().unlock(); | 280 | scrn.resourceManager().unlock(); |
280 | // setup to listen to child events | 281 | // setup to listen to child events |
281 | FbTk::EventManager::instance()->addParent(*this, window()); | 282 | FbTk::EventManager::instance()->addParent(*this, window()); |
283 | Fluxbox::instance()->keys()->registerWindow(window().window(), | ||
284 | Keys::ON_TOOLBAR); | ||
282 | // get everything together | 285 | // get everything together |
283 | reconfigure(); | 286 | reconfigure(); |
284 | // this gets done by the screen later as it loads | 287 | // this gets done by the screen later as it loads |
@@ -286,6 +289,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width): | |||
286 | } | 289 | } |
287 | 290 | ||
288 | Toolbar::~Toolbar() { | 291 | Toolbar::~Toolbar() { |
292 | Fluxbox::instance()->keys()->unregisterWindow(window().window()); | ||
289 | FbTk::EventManager::instance()->remove(window()); | 293 | FbTk::EventManager::instance()->remove(window()); |
290 | // remove menu items before we delete tools so we dont end up | 294 | // remove menu items before we delete tools so we dont end up |
291 | // with dangling pointers to old submenu items (internal menus) | 295 | // with dangling pointers to old submenu items (internal menus) |
@@ -512,6 +516,11 @@ void Toolbar::reconfigure() { | |||
512 | 516 | ||
513 | 517 | ||
514 | void Toolbar::buttonPressEvent(XButtonEvent &be) { | 518 | void Toolbar::buttonPressEvent(XButtonEvent &be) { |
519 | if (Fluxbox::instance()->keys()->doAction(be.type, be.state, be.button, | ||
520 | Keys::ON_TOOLBAR)) | ||
521 | return; | ||
522 | if (be.button == 1) | ||
523 | raise(); | ||
515 | if (be.button != 3) | 524 | if (be.button != 3) |
516 | return; | 525 | return; |
517 | 526 | ||
@@ -539,25 +548,6 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) { | |||
539 | 548 | ||
540 | } | 549 | } |
541 | 550 | ||
542 | |||
543 | void Toolbar::buttonReleaseEvent(XButtonEvent &re) { | ||
544 | if (re.button == 1) { | ||
545 | raise(); | ||
546 | } else if (re.button == 4) { //mousewheel scroll up | ||
547 | if(screen().isReverseWheeling()) { | ||
548 | screen().prevWorkspace(1); | ||
549 | } else { | ||
550 | screen().nextWorkspace(1); | ||
551 | } | ||
552 | } else if (re.button == 5) { //mousewheel scroll down | ||
553 | if(screen().isReverseWheeling()) { | ||
554 | screen().nextWorkspace(1); | ||
555 | } else { | ||
556 | screen().prevWorkspace(1); | ||
557 | } | ||
558 | } | ||
559 | } | ||
560 | |||
561 | void Toolbar::enterNotifyEvent(XCrossingEvent ¬_used) { | 551 | void Toolbar::enterNotifyEvent(XCrossingEvent ¬_used) { |
562 | if (! doAutoHide()) { | 552 | if (! doAutoHide()) { |
563 | if (isHidden()) | 553 | if (isHidden()) |