diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-07-14 20:54:03 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-07-14 20:54:03 +0000 |
| commit | 90dbcb271c5e6d7ca73c19a519b93885b833db0a (patch) | |
| tree | df98b2ed99b8dd6546be1d7d03221ee6d54e6ea4 /src/Workspacemenu.cc | |
| parent | c6a826bf663d3cb286025642f5e2a725b5d1c660 (diff) | |
properly handle workspace names, and changes to them.
Diffstat (limited to 'src/Workspacemenu.cc')
| -rw-r--r-- | src/Workspacemenu.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Workspacemenu.cc b/src/Workspacemenu.cc index a63251ab..2ba73e23 100644 --- a/src/Workspacemenu.cc +++ b/src/Workspacemenu.cc @@ -27,6 +27,7 @@ #include "i18n.hh" #include "blackbox.hh" +#include "Clientmenu.hh" #include "Screen.hh" #include "Toolbar.hh" #include "Workspacemenu.hh" @@ -51,6 +52,8 @@ void Workspacemenu::itemSelected(int button, unsigned int index) { } else if (index == 1) { getScreen()->removeLastWorkspace(); } else { + // subtract 2 because the workspace menu has 2 extra items at the top before + // the list of the workspace names index -= 2; const Workspace* const wkspc = getScreen()->getCurrentWorkspace(); if (wkspc->getID() != index && index < getScreen()->getWorkspaceCount()) @@ -59,3 +62,27 @@ void Workspacemenu::itemSelected(int button, unsigned int index) { if (! (getScreen()->getWorkspacemenu()->isTorn() || isTorn())) hide(); } + + +void Workspacemenu::changeWorkspaceLabel(unsigned int index, + const std::string& label) { + // add 2 because the workspace menu has 2 extra items at the top before the + // list of the workspace names + changeItemLabel(index + 2, label); +} + + +void Workspacemenu::insertWorkspace(Workspace *wkspc) { + assert(wkspc); + // add 2 because the workspace menu has 2 extra items at the top before the + // list of the workspace names + insert(wkspc->getName(), wkspc->getMenu(), wkspc->getID() + 2); +} + + +void Workspacemenu::removeWorkspace(Workspace *wkspc) { + assert(wkspc); + // add 2 because the workspace menu has 2 extra items at the top before the + // list of the workspace names + remove(wkspc->getID() + 2); +} |
