From f7c88e4da3b7e8e39711a70fd27d0c464ce1bcde Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 20 Feb 2002 23:04:51 +0000 Subject: parameter values for next/prev/right/leftWorkspace --- src/Screen.cc | 28 +++++++++++----------------- src/Screen.hh | 10 +++++----- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index f3a833c..7a65473 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.26 2002/02/20 22:40:19 fluxgen Exp $ +// $Id: Screen.cc,v 1.27 2002/02/20 23:04:51 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -1712,37 +1712,31 @@ void BScreen::hideGeometry(void) { //-------------- nextWorkspace --------------- // Goes to the workspace "right" of the current //-------------------------------------------- -void BScreen::nextWorkspace(void) { - if (getCurrentWorkspaceID()+1 > getCount()-1) - changeWorkspaceID(0); - else - changeWorkspaceID(getCurrentWorkspaceID()+1); +void BScreen::nextWorkspace(const int delta) { + changeWorkspaceID( (getCurrentWorkspaceID()+delta) % getCount()); } //------------- prevWorkspace ---------------- // Goes to the workspace "left" of the current //-------------------------------------------- -void BScreen::prevWorkspace(void) { - if (getCurrentWorkspaceID()-1 < 0) - changeWorkspaceID(getCount()-1); - else - changeWorkspaceID(getCurrentWorkspaceID()-1); +void BScreen::prevWorkspace(const int delta) { + changeWorkspaceID( (getCurrentWorkspaceID()-delta+getCount()) % getCount()); } //-------------- rightWorkspace --------------- // Goes to the workspace "right" of the current //-------------------------------------------- -void BScreen::rightWorkspace(void) { - if (getCurrentWorkspaceID()+1 < getCount()) - changeWorkspaceID(getCurrentWorkspaceID()+1); +void BScreen::rightWorkspace(const int delta) { + if (getCurrentWorkspaceID()+delta < getCount()) + changeWorkspaceID(getCurrentWorkspaceID()+delta); } //------------- leftWorkspace ---------------- // Goes to the workspace "left" of the current //-------------------------------------------- -void BScreen::leftWorkspace(void) { - if (getCurrentWorkspaceID() > 0) - changeWorkspaceID(getCurrentWorkspaceID()-1); +void BScreen::leftWorkspace(const int delta) { + if (getCurrentWorkspaceID() >= delta) + changeWorkspaceID(getCurrentWorkspaceID()-delta); } #ifdef GNOME diff --git a/src/Screen.hh b/src/Screen.hh index 0001ed0..6df6ca0 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.19 2002/02/20 22:41:13 fluxgen Exp $ +// $Id: Screen.hh,v 1.20 2002/02/20 23:04:35 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -184,10 +184,10 @@ public: int addWorkspace(void); int removeLastWorkspace(void); //scroll workspaces - void nextWorkspace(); - void prevWorkspace(); - void rightWorkspace(); - void leftWorkspace(); + void nextWorkspace(const int delta); + void prevWorkspace(const int delta); + void rightWorkspace(const int delta); + void leftWorkspace(const int delta); void removeWorkspaceNames(void); void updateWorkspaceNamesAtom(void); -- cgit v0.11.2