aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index b5ad967..54ee239 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
288Toolbar::~Toolbar() { 291Toolbar::~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)
@@ -520,6 +524,11 @@ void Toolbar::reconfigure() {
520 524
521 525
522void Toolbar::buttonPressEvent(XButtonEvent &be) { 526void Toolbar::buttonPressEvent(XButtonEvent &be) {
527 if (Fluxbox::instance()->keys()->doAction(be.type, be.state, be.button,
528 Keys::ON_TOOLBAR))
529 return;
530 if (be.button == 1)
531 raise();
523 if (be.button != 3) 532 if (be.button != 3)
524 return; 533 return;
525 534
@@ -547,25 +556,6 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
547 556
548} 557}
549 558
550
551void Toolbar::buttonReleaseEvent(XButtonEvent &re) {
552 if (re.button == 1) {
553 raise();
554 } else if (re.button == 4) { //mousewheel scroll up
555 if(screen().isReverseWheeling()) {
556 screen().prevWorkspace(1);
557 } else {
558 screen().nextWorkspace(1);
559 }
560 } else if (re.button == 5) { //mousewheel scroll down
561 if(screen().isReverseWheeling()) {
562 screen().nextWorkspace(1);
563 } else {
564 screen().prevWorkspace(1);
565 }
566 }
567}
568
569void Toolbar::enterNotifyEvent(XCrossingEvent &not_used) { 559void Toolbar::enterNotifyEvent(XCrossingEvent &not_used) {
570 if (! doAutoHide()) { 560 if (! doAutoHide()) {
571 if (isHidden()) 561 if (isHidden())