diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 5194434..36cc4f2 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.241 2003/11/16 22:33:55 rathnor Exp $ | 25 | // $Id: Screen.cc,v 1.242 2003/12/03 23:08:48 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -189,40 +189,12 @@ private: | |||
189 | const std::string m_filename; | 189 | const std::string m_filename; |
190 | }; | 190 | }; |
191 | 191 | ||
192 | class AddWorkspaceCmd:public FbTk::Command { | ||
193 | public: | ||
194 | explicit AddWorkspaceCmd(BScreen &scrn):m_screen(scrn) { } | ||
195 | void execute() { | ||
196 | m_screen.addWorkspace(); | ||
197 | } | ||
198 | private: | ||
199 | BScreen &m_screen; | ||
200 | }; | ||
201 | |||
202 | class RemoveLastWorkspaceCmd:public FbTk::Command { | ||
203 | public: | ||
204 | explicit RemoveLastWorkspaceCmd(BScreen &scrn):m_screen(scrn) { } | ||
205 | void execute() { | ||
206 | m_screen.removeLastWorkspace(); | ||
207 | } | ||
208 | private: | ||
209 | BScreen &m_screen; | ||
210 | }; | ||
211 | |||
212 | class ReloadStyleCmd: public FbTk::Command { | ||
213 | public: | ||
214 | void execute() { | ||
215 | FbCommands::SetStyleCmd cmd(Fluxbox::instance()->getStyleFilename()); | ||
216 | cmd.execute(); | ||
217 | } | ||
218 | }; | ||
219 | |||
220 | void setupWorkspacemenu(BScreen &scr, FbTk::Menu &menu) { | 192 | void setupWorkspacemenu(BScreen &scr, FbTk::Menu &menu) { |
221 | menu.removeAll(); // clear all items | 193 | menu.removeAll(); // clear all items |
222 | using namespace FbTk; | 194 | using namespace FbTk; |
223 | menu.setLabel("Workspace"); | 195 | menu.setLabel("Workspace"); |
224 | RefCount<Command> new_workspace(new AddWorkspaceCmd(scr)); | 196 | RefCount<Command> new_workspace(new FbTk::SimpleCommand<BScreen, int>(scr, &BScreen::addWorkspace)); |
225 | RefCount<Command> remove_last(new RemoveLastWorkspaceCmd(scr)); | 197 | RefCount<Command> remove_last(new FbTk::SimpleCommand<BScreen, int>(scr, &BScreen::removeLastWorkspace)); |
226 | //!! TODO: NLS | 198 | //!! TODO: NLS |
227 | menu.insert("New Workspace", new_workspace); | 199 | menu.insert("New Workspace", new_workspace); |
228 | menu.insert("Remove Last", remove_last); | 200 | menu.insert("Remove Last", remove_last); |