diff options
Diffstat (limited to 'src/SendToMenu.cc')
-rw-r--r-- | src/SendToMenu.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/SendToMenu.cc b/src/SendToMenu.cc index fee4c4d..c039f16 100644 --- a/src/SendToMenu.cc +++ b/src/SendToMenu.cc | |||
@@ -29,19 +29,22 @@ | |||
29 | #include "fluxbox.hh" | 29 | #include "fluxbox.hh" |
30 | #include "Workspace.hh" | 30 | #include "Workspace.hh" |
31 | 31 | ||
32 | #include "FbTk/MultiButtonMenuItem.hh" | ||
32 | #include "FbTk/Command.hh" | 33 | #include "FbTk/Command.hh" |
33 | 34 | ||
34 | class SendToCmd: public FbTk::Command { | 35 | class SendToCmd: public FbTk::Command { |
35 | public: | 36 | public: |
36 | SendToCmd(FluxboxWindow &win, int workspace): | 37 | SendToCmd(FluxboxWindow &win, int workspace, bool follow): |
37 | m_win(win), | 38 | m_win(win), |
38 | m_workspace(workspace) { } | 39 | m_workspace(workspace), |
40 | m_follow(follow) { } | ||
39 | void execute() { | 41 | void execute() { |
40 | m_win.screen().sendToWorkspace(m_workspace, &m_win, false); | 42 | m_win.screen().sendToWorkspace(m_workspace, &m_win, m_follow); |
41 | } | 43 | } |
42 | private: | 44 | private: |
43 | FluxboxWindow &m_win; | 45 | FluxboxWindow &m_win; |
44 | const int m_workspace; | 46 | const int m_workspace; |
47 | const bool m_follow; | ||
45 | }; | 48 | }; |
46 | 49 | ||
47 | SendToMenu::SendToMenu(FluxboxWindow &win): | 50 | SendToMenu::SendToMenu(FluxboxWindow &win): |
@@ -91,9 +94,14 @@ void SendToMenu::update(FbTk::Subject *subj) { | |||
91 | 94 | ||
92 | const BScreen::Workspaces &wlist = m_win.screen().getWorkspacesList(); | 95 | const BScreen::Workspaces &wlist = m_win.screen().getWorkspacesList(); |
93 | for (size_t i = 0; i < wlist.size(); ++i) { | 96 | for (size_t i = 0; i < wlist.size(); ++i) { |
94 | FbTk::RefCount<FbTk::Command> sendto_cmd(new SendToCmd(m_win, i)); | 97 | FbTk::RefCount<FbTk::Command> sendto_cmd(new SendToCmd(m_win, i, false)); |
95 | insert(wlist[i]->name().c_str(), sendto_cmd); | 98 | FbTk::RefCount<FbTk::Command> sendto_follow_cmd(new SendToCmd(m_win, i, true)); |
96 | 99 | ||
100 | FbTk::MultiButtonMenuItem* item = new FbTk::MultiButtonMenuItem(3, wlist[i]->name().c_str()); | ||
101 | item->setCommand(1, sendto_cmd); | ||
102 | item->setCommand(2, sendto_follow_cmd); | ||
103 | item->setCommand(3, sendto_cmd); | ||
104 | insert(item); | ||
97 | } | 105 | } |
98 | 106 | ||
99 | setItemEnabled(m_win.workspaceNumber(), false); | 107 | setItemEnabled(m_win.workspaceNumber(), false); |