diff options
author | akir <akir> | 2004-09-06 21:12:10 (GMT) |
---|---|---|
committer | akir <akir> | 2004-09-06 21:12:10 (GMT) |
commit | 1cd19c941cf8041bdba3efac5b4fca0ae73f0b77 (patch) | |
tree | 183285bcf60bd2c03d4ab824e96ba709e42f274c /src/WorkspaceMenu.cc | |
parent | b470256cf6d2fac212c6f51e4daaca13037c00b5 (diff) | |
download | fluxbox_pavel-1cd19c941cf8041bdba3efac5b4fca0ae73f0b77.zip fluxbox_pavel-1cd19c941cf8041bdba3efac5b4fca0ae73f0b77.tar.bz2 |
added button2-on-workspacename in workspacemenu jumps to workspacadded
button2-on-workspacename in workspacemenu jumps to workspacee
Diffstat (limited to 'src/WorkspaceMenu.cc')
-rw-r--r-- | src/WorkspaceMenu.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/WorkspaceMenu.cc b/src/WorkspaceMenu.cc index 7e4f351..2719f97 100644 --- a/src/WorkspaceMenu.cc +++ b/src/WorkspaceMenu.cc | |||
@@ -19,19 +19,22 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: WorkspaceMenu.cc,v 1.4 2004/06/08 13:15:30 rathnor Exp $ | 22 | // $Id: WorkspaceMenu.cc,v 1.5 2004/09/06 21:12:10 akir Exp $ |
23 | 23 | ||
24 | #include "WorkspaceMenu.hh" | 24 | #include "WorkspaceMenu.hh" |
25 | 25 | ||
26 | #include "Screen.hh" | 26 | #include "Screen.hh" |
27 | #include "fluxbox.hh" | 27 | #include "fluxbox.hh" |
28 | #include "Workspace.hh" | 28 | #include "Workspace.hh" |
29 | #include "WorkspaceCmd.hh" | ||
29 | #include "MenuCreator.hh" | 30 | #include "MenuCreator.hh" |
30 | 31 | ||
32 | |||
31 | #include "FbTk/I18n.hh" | 33 | #include "FbTk/I18n.hh" |
32 | #include "FbTk/SimpleCommand.hh" | 34 | #include "FbTk/SimpleCommand.hh" |
33 | #include "FbTk/RefCount.hh" | 35 | #include "FbTk/RefCount.hh" |
34 | #include "FbTk/MenuItem.hh" | 36 | #include "FbTk/MenuItem.hh" |
37 | #include "FbTk/MultiButtonMenuItem.hh" | ||
35 | 38 | ||
36 | #include <typeinfo> | 39 | #include <typeinfo> |
37 | 40 | ||
@@ -72,7 +75,12 @@ void WorkspaceMenu::update(FbTk::Subject *subj) { | |||
72 | ++workspace) { | 75 | ++workspace) { |
73 | Workspace *wkspc = screen.getWorkspace(workspace); | 76 | Workspace *wkspc = screen.getWorkspace(workspace); |
74 | wkspc->menu().setInternalMenu(); | 77 | wkspc->menu().setInternalMenu(); |
75 | insert(wkspc->name().c_str(), &wkspc->menu(), numberOfItems() - 1); | 78 | FbTk::MultiButtonMenuItem* mb_menu = new FbTk::MultiButtonMenuItem(5, |
79 | wkspc->name().c_str(), | ||
80 | &wkspc->menu()); | ||
81 | FbTk::RefCount<FbTk::Command> jump_cmd(new JumpToWorkspaceCmd(wkspc->workspaceID())); | ||
82 | mb_menu->setCommand(2, jump_cmd); | ||
83 | insert(mb_menu); | ||
76 | } | 84 | } |
77 | 85 | ||
78 | FbTk::Menu::update(-1); | 86 | FbTk::Menu::update(-1); |
@@ -102,7 +110,12 @@ void WorkspaceMenu::init(BScreen &screen) { | |||
102 | for (size_t workspace = 0; workspace < screen.getCount(); ++workspace) { | 110 | for (size_t workspace = 0; workspace < screen.getCount(); ++workspace) { |
103 | Workspace *wkspc = screen.getWorkspace(workspace); | 111 | Workspace *wkspc = screen.getWorkspace(workspace); |
104 | wkspc->menu().setInternalMenu(); | 112 | wkspc->menu().setInternalMenu(); |
105 | insert(wkspc->name().c_str(), &wkspc->menu()); | 113 | FbTk::MultiButtonMenuItem* mb_menu = new FbTk::MultiButtonMenuItem(5, |
114 | wkspc->name().c_str(), | ||
115 | &wkspc->menu()); | ||
116 | FbTk::RefCount<FbTk::Command> jump_cmd(new JumpToWorkspaceCmd(wkspc->workspaceID())); | ||
117 | mb_menu->setCommand(2, jump_cmd); | ||
118 | insert(mb_menu); | ||
106 | } | 119 | } |
107 | setItemSelected(screen.currentWorkspace()->workspaceID() + 2, true); | 120 | setItemSelected(screen.currentWorkspace()->workspaceID() + 2, true); |
108 | 121 | ||