diff options
author | markt <markt> | 2007-01-11 19:22:46 (GMT) |
---|---|---|
committer | markt <markt> | 2007-01-11 19:22:46 (GMT) |
commit | 9cace1f2cb9a082408e49e668bd02a16a016cd6e (patch) | |
tree | 0eeb0bc4b8baaeacfa0200988883183c58ea0620 | |
parent | 45743c6f42aa50548141dad7a050a6150200b22a (diff) | |
download | fluxbox-9cace1f2cb9a082408e49e668bd02a16a016cd6e.zip fluxbox-9cace1f2cb9a082408e49e668bd02a16a016cd6e.tar.bz2 |
add feature to minimize windows in current layer
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/FbCommandFactory.cc | 12 | ||||
-rw-r--r-- | src/WorkspaceCmd.cc | 13 | ||||
-rw-r--r-- | src/WorkspaceCmd.hh | 4 |
4 files changed, 30 insertions, 3 deletions
@@ -1,5 +1,9 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 1.0rc3: | 2 | Changes for 1.0rc3: |
3 | *07/01/11: | ||
4 | * Added option to :Minimize key command to lower all windows in the same | ||
5 | layer as the focused window -- syntax is `:Minimize (layer)' (Mark) | ||
6 | FbCommandFactory.cc WorkspaceCmd.cc/hh | ||
3 | *07/01/08: | 7 | *07/01/08: |
4 | * Fix another 64-bit window property (Mark/Simon) | 8 | * Fix another 64-bit window property (Mark/Simon) |
5 | FbTk/FbWindow.cc | 9 | FbTk/FbWindow.cc |
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index 6fe5e11..ece8c9e 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc | |||
@@ -233,9 +233,15 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
233 | // | 233 | // |
234 | else if (command == "fullscreen") | 234 | else if (command == "fullscreen") |
235 | return new FullscreenCmd(); | 235 | return new FullscreenCmd(); |
236 | else if (command == "minimizewindow" || command == "minimize" || command == "iconify") | 236 | else if (command == "minimizewindow" || command == "minimize" || command == "iconify") { |
237 | return new CurrentWindowCmd(&FluxboxWindow::iconify); | 237 | string cmd; |
238 | else if (command == "maximizewindow" || command == "maximize") | 238 | if (FbTk::StringUtil::getStringBetween(cmd, arguments.c_str() + |
239 | 0, '(', ')', " \t\n", true) | ||
240 | && cmd == "layer") | ||
241 | return new MinimizeLayerCmd(); | ||
242 | else | ||
243 | return new CurrentWindowCmd(&FluxboxWindow::iconify); | ||
244 | } else if (command == "maximizewindow" || command == "maximize") | ||
239 | return new CurrentWindowCmd(&FluxboxWindow::maximizeFull); | 245 | return new CurrentWindowCmd(&FluxboxWindow::maximizeFull); |
240 | else if (command == "maximizevertical") | 246 | else if (command == "maximizevertical") |
241 | return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical); | 247 | return new CurrentWindowCmd(&FluxboxWindow::maximizeVertical); |
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 204d1b9..6c97808 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc | |||
@@ -255,6 +255,19 @@ void ShowDesktopCmd::execute() { | |||
255 | std::mem_fun(&FluxboxWindow::iconify)); | 255 | std::mem_fun(&FluxboxWindow::iconify)); |
256 | } | 256 | } |
257 | 257 | ||
258 | void MinimizeLayerCmd::execute() { | ||
259 | FluxboxWindow *win = FocusControl::focusedFbWindow(); | ||
260 | if (!win) | ||
261 | return; | ||
262 | |||
263 | Workspace::Windows windows(win->screen().currentWorkspace()->windowList()); | ||
264 | Workspace::Windows::iterator it = windows.begin(), it_end = windows.end(); | ||
265 | for (; it != it_end; ++it) { | ||
266 | if (win->layerNum() == (*it)->layerNum()) | ||
267 | (*it)->iconify(); | ||
268 | } | ||
269 | } | ||
270 | |||
258 | void CloseAllWindowsCmd::execute() { | 271 | void CloseAllWindowsCmd::execute() { |
259 | BScreen *screen = Fluxbox::instance()->mouseScreen(); | 272 | BScreen *screen = Fluxbox::instance()->mouseScreen(); |
260 | if (screen == 0) | 273 | if (screen == 0) |
diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index 1e5b04d..7d8d9e6 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh | |||
@@ -104,6 +104,10 @@ public: | |||
104 | void execute(); | 104 | void execute(); |
105 | }; | 105 | }; |
106 | 106 | ||
107 | class MinimizeLayerCmd: public FbTk::Command { | ||
108 | public: | ||
109 | void execute(); | ||
110 | }; | ||
107 | 111 | ||
108 | class CloseAllWindowsCmd: public FbTk::Command { | 112 | class CloseAllWindowsCmd: public FbTk::Command { |
109 | public: | 113 | public: |