From 29f975b302c1cc4ab758871811894dfe572a4f24 Mon Sep 17 00:00:00 2001 From: simonb Date: Sun, 16 Apr 2006 12:03:31 +0000 Subject: add reversewheeling option thanks Kalle - ice_jkpg at users.sourceforge.net --- ChangeLog | 4 ++++ src/IconButton.cc | 11 ++++++++--- src/Screen.cc | 1 + src/Screen.hh | 3 ++- src/Toolbar.cc | 19 ++++++++++++++----- src/fluxbox.cc | 12 ++++++++++-- 6 files changed, 39 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23e8b3b..cca8d66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ (Format: Year/Month/Day) Changes for 0.9.16: *06/04/16: + * Add option to reverse desktop wheeling, patch #1034287 + session.screen0.reversewheeling: true|false + (thanks Kalle - ice_jkpg at users.sourceforge.net) + Screen.hh/cc fluxbox.cc Toolbar.cc IconButton.cc * Missing space in translation (thanks... anonymous, sf.net #1455024) nls/C/Translation.m * Set (take|send)to(next|prev)workspace offset default value to 1 diff --git a/src/IconButton.cc b/src/IconButton.cc index d36987f..015065c 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc @@ -161,9 +161,14 @@ IconButton::IconButton(const IconbarTool& tool, const FbTk::FbWindow &parent, RefCmd menu_cmd(new ::ShowMenu(m_win)); setOnClick(focus_cmd, 1); setOnClick(menu_cmd, 3); - setOnClick(next_workspace, 4); - setOnClick(prev_workspace, 5); - + if(win.screen().isReverseWheeling()) { + setOnClick(next_workspace, 5); + setOnClick(prev_workspace, 4); + } else { + setOnClick(next_workspace, 4); + setOnClick(prev_workspace, 5); + } + m_win.hintSig().attach(this); FbTk::EventManager::instance()->add(*this, m_icon_window); diff --git a/src/Screen.cc b/src/Screen.cc index 5dd5f9a..62abf95 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -251,6 +251,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, scrname+".sloppywindowgrouping", altscrname+".SloppyWindowGrouping"), workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"), desktop_wheeling(rm, true, scrname+".desktopwheeling", altscrname+".DesktopWheeling"), + reverse_wheeling(rm, false, scrname+".reversewheeling", altscrname+".ReverseWheeling"), show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"), antialias(rm, false, scrname+".antialias", altscrname+".Antialias"), auto_raise(rm, false, scrname+".autoRaise", altscrname+".AutoRaise"), diff --git a/src/Screen.hh b/src/Screen.hh index ffac442..74a5ff9 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -113,6 +113,7 @@ public: bool isSloppyWindowGrouping() const { return *resource.sloppy_window_grouping; } bool isWorkspaceWarping() const { return *resource.workspace_warping; } bool isDesktopWheeling() const { return *resource.desktop_wheeling; } + bool isReverseWheeling() const { return *resource.reverse_wheeling; } bool doAutoRaise() const { return *resource.auto_raise; } bool clickRaises() const { return *resource.click_raises; } bool doOpaqueMove() const { return *resource.opaque_move; } @@ -438,7 +439,7 @@ private: FbTk::Resource image_dither, opaque_move, full_max, sloppy_window_grouping, workspace_warping, - desktop_wheeling, show_window_pos, + desktop_wheeling, reverse_wheeling, show_window_pos, antialias, auto_raise, click_raises, decorate_transient; FbTk::Resource rootcommand; FbTk::Resource resize_model; diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 319f56a..84a6afb 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -524,12 +524,21 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) { void Toolbar::buttonReleaseEvent(XButtonEvent &re) { - if (re.button == 1) + if (re.button == 1) { raise(); - else if (re.button == 4) //mousewheel scroll up - screen().nextWorkspace(1); - else if (re.button == 5) //mousewheel scroll down - screen().prevWorkspace(1); + } else if (re.button == 4) { //mousewheel scroll up + if(screen().isReverseWheeling()) { + screen().prevWorkspace(1); + } else { + screen().nextWorkspace(1); + } + } else if (re.button == 5) { //mousewheel scroll down + if(screen().isReverseWheeling()) { + screen().nextWorkspace(1); + } else { + screen().prevWorkspace(1); + } + } } void Toolbar::enterNotifyEvent(XCrossingEvent ¬_used) { diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 5fcd4fe..62eef50 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -940,9 +940,17 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { FbCommands::ShowRootMenuCmd cmd; cmd.execute(); } else if (screen->isDesktopWheeling() && be.button == 4) { - screen->nextWorkspace(1); + if(screen->isReverseWheeling()) { + screen->prevWorkspace(1); + } else { + screen->nextWorkspace(1); + } } else if (screen->isDesktopWheeling() && be.button == 5) { - screen->prevWorkspace(1); + if(screen->isReverseWheeling()) { + screen->nextWorkspace(1); + } else { + screen->prevWorkspace(1); + } } } break; -- cgit v0.11.2