From 5ee7d3e72e0cfdd7900eaef3b95c953abbb0bb04 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 31 Dec 2006 21:00:46 +0000 Subject: update window scroll action and direction on reconfigure --- ChangeLog | 2 ++ src/Window.cc | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7579515..8d7b3df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ Changes for 1.0rc3: "32-bit" type is actually a "long array" argument (=64bit on 64 systems) Ewmh.cc Gnome.cc *06/12/31: + * Update window scroll action (and direction) on reconfigure (Mark) + Window.cc * Update toolbar visibility on reconfigure (Mark) Toolbar.cc *06/12/28: diff --git a/src/Window.cc b/src/Window.cc index 3c2cc02..b341937 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -1199,6 +1199,29 @@ void FluxboxWindow::reconfigure() { menu().reconfigure(); + typedef FbTk::RefCount CommandRef; + typedef FbTk::SimpleCommand WindowCmd; + CommandRef shade_on_cmd(new WindowCmd(*this, &FluxboxWindow::shadeOn)); + CommandRef shade_off_cmd(new WindowCmd(*this, &FluxboxWindow::shadeOff)); + CommandRef next_tab_cmd(new WindowCmd(*this, &FluxboxWindow::nextClient)); + CommandRef prev_tab_cmd(new WindowCmd(*this, &FluxboxWindow::prevClient)); + CommandRef null_cmd; + + int reverse = 0; + if (screen().getScrollReverse()) + reverse = 1; + + if (StringUtil::toLower(screen().getScrollAction()) == string("shade")) { + frame().setOnClickTitlebar(shade_on_cmd, 5 - reverse); // shade on mouse roll + frame().setOnClickTitlebar(shade_off_cmd, 4 + reverse); // unshade if rolled oposite direction + } else if (StringUtil::toLower(screen().getScrollAction()) == string("nexttab")) { + frame().setOnClickTitlebar(next_tab_cmd, 5 - reverse); // next tab + frame().setOnClickTitlebar(prev_tab_cmd, 4 + reverse); // previous tab + } else { + frame().setOnClickTitlebar(null_cmd, 4); + frame().setOnClickTitlebar(null_cmd, 5); + } + } /// update current client title and title in our frame -- cgit v0.11.2