aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2007-01-11 19:22:46 (GMT)
committermarkt <markt>2007-01-11 19:22:46 (GMT)
commit9cace1f2cb9a082408e49e668bd02a16a016cd6e (patch)
tree0eeb0bc4b8baaeacfa0200988883183c58ea0620 /src
parent45743c6f42aa50548141dad7a050a6150200b22a (diff)
downloadfluxbox-9cace1f2cb9a082408e49e668bd02a16a016cd6e.zip
fluxbox-9cace1f2cb9a082408e49e668bd02a16a016cd6e.tar.bz2
add feature to minimize windows in current layer
Diffstat (limited to 'src')
-rw-r--r--src/FbCommandFactory.cc12
-rw-r--r--src/WorkspaceCmd.cc13
-rw-r--r--src/WorkspaceCmd.hh4
3 files changed, 26 insertions, 3 deletions
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
258void 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
258void CloseAllWindowsCmd::execute() { 271void 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
107class MinimizeLayerCmd: public FbTk::Command {
108public:
109 void execute();
110};
107 111
108class CloseAllWindowsCmd: public FbTk::Command { 112class CloseAllWindowsCmd: public FbTk::Command {
109public: 113public: