aboutsummaryrefslogtreecommitdiff
path: root/src/IconbarTool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r--src/IconbarTool.cc56
1 files changed, 47 insertions, 9 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index f8299b8..d86c7bc 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -55,8 +55,12 @@ void FbTk::Resource<IconbarTool::Mode>::setFromString(const char *strval) {
55 m_value = IconbarTool::NONE; 55 m_value = IconbarTool::NONE;
56 else if (strcasecmp(strval, "Icons") == 0) 56 else if (strcasecmp(strval, "Icons") == 0)
57 m_value = IconbarTool::ICONS; 57 m_value = IconbarTool::ICONS;
58 else if (strcasecmp(strval, "NoIcons") == 0)
59 m_value = IconbarTool::NOICONS;
58 else if (strcasecmp(strval, "WorkspaceIcons") == 0) 60 else if (strcasecmp(strval, "WorkspaceIcons") == 0)
59 m_value = IconbarTool::WORKSPACEICONS; 61 m_value = IconbarTool::WORKSPACEICONS;
62 else if (strcasecmp(strval, "WorkspaceNoIcons") == 0)
63 m_value = IconbarTool::WORKSPACENOICONS;
60 else if (strcasecmp(strval, "Workspace") == 0) 64 else if (strcasecmp(strval, "Workspace") == 0)
61 m_value = IconbarTool::WORKSPACE; 65 m_value = IconbarTool::WORKSPACE;
62 else if (strcasecmp(strval, "AllWindows") == 0) 66 else if (strcasecmp(strval, "AllWindows") == 0)
@@ -167,9 +171,15 @@ string FbTk::Resource<IconbarTool::Mode>::getString() {
167 case IconbarTool::ICONS: 171 case IconbarTool::ICONS:
168 return string("Icons"); 172 return string("Icons");
169 break; 173 break;
174 case IconbarTool::NOICONS:
175 return string("NoIcons");
176 break;
170 case IconbarTool::WORKSPACEICONS: 177 case IconbarTool::WORKSPACEICONS:
171 return string("WorkspaceIcons"); 178 return string("WorkspaceIcons");
172 break; 179 break;
180 case IconbarTool::WORKSPACENOICONS:
181 return string("WorkspaceNoIcons");
182 break;
173 case IconbarTool::WORKSPACE: 183 case IconbarTool::WORKSPACE:
174 return string("Workspace"); 184 return string("Workspace");
175 break; 185 break;
@@ -242,12 +252,24 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) {
242 IconbarTool::ICONS, saverc_cmd)); 252 IconbarTool::ICONS, saverc_cmd));
243 253
244 menu.insert(new ToolbarModeMenuItem( 254 menu.insert(new ToolbarModeMenuItem(
255 _FBTEXT(Toolbar, IconbarModeNoIcons,
256 "NoIcons", "No iconified windows from all workspaces are shown"),
257 handler,
258 IconbarTool::NOICONS, saverc_cmd));
259
260 menu.insert(new ToolbarModeMenuItem(
245 _FBTEXT(Toolbar, IconbarModeWorkspaceIcons, 261 _FBTEXT(Toolbar, IconbarModeWorkspaceIcons,
246 "WorkspaceIcons", "Iconified windows from this workspace are shown"), 262 "WorkspaceIcons", "Iconified windows from this workspace are shown"),
247 handler, 263 handler,
248 IconbarTool::WORKSPACEICONS, saverc_cmd)); 264 IconbarTool::WORKSPACEICONS, saverc_cmd));
249 265
250 menu.insert(new ToolbarModeMenuItem( 266 menu.insert(new ToolbarModeMenuItem(
267 _FBTEXT(Toolbar, IconbarModeWorkspaceNoIcons,
268 "WorkspaceNoIcons", "No iconified windows from this workspace are shown"),
269 handler,
270 IconbarTool::WORKSPACENOICONS, saverc_cmd));
271
272 menu.insert(new ToolbarModeMenuItem(
251 _FBTEXT(Toolbar, IconbarModeWorkspace, 273 _FBTEXT(Toolbar, IconbarModeWorkspace,
252 "Workspace", "Normal and iconified windows from this workspace are shown"), 274 "Workspace", "Normal and iconified windows from this workspace are shown"),
253 handler, 275 handler,
@@ -290,11 +312,18 @@ inline bool checkAddWindow(IconbarTool::Mode mode, const FluxboxWindow &win) {
290 if (win.isIconic()) 312 if (win.isIconic())
291 ret_val = true; 313 ret_val = true;
292 break; 314 break;
315 case IconbarTool::NOICONS:
316 if (!win.isIconic())
317 ret_val = true;
318 break;
293 case IconbarTool::WORKSPACEICONS: 319 case IconbarTool::WORKSPACEICONS:
294 if(win.workspaceNumber() == win.screen().currentWorkspaceID() && 320 if(win.workspaceNumber() == win.screen().currentWorkspaceID() &&
295 win.isIconic()) 321 win.isIconic())
296 ret_val = true; 322 ret_val = true;
297 break; 323 break;
324 case IconbarTool::WORKSPACENOICONS:
325 if (win.isIconic())
326 break;
298 case IconbarTool::WORKSPACE: 327 case IconbarTool::WORKSPACE:
299 if (win.workspaceNumber() == win.screen().currentWorkspaceID()) 328 if (win.workspaceNumber() == win.screen().currentWorkspaceID())
300 ret_val = true; 329 ret_val = true;
@@ -456,9 +485,11 @@ void IconbarTool::setMode(Mode mode) {
456 case WORKSPACEICONS: // all icons on current workspace 485 case WORKSPACEICONS: // all icons on current workspace
457 updateIcons(); 486 updateIcons();
458 break; 487 break;
488 case WORKSPACENOICONS:
459 case WORKSPACE: // all windows and all icons on current workspace 489 case WORKSPACE: // all windows and all icons on current workspace
460 updateWorkspace(); 490 updateWorkspace();
461 break; 491 break;
492 case NOICONS:
462 case ALLWINDOWS: // all windows and all icons from all workspaces 493 case ALLWINDOWS: // all windows and all icons from all workspaces
463 updateAllWindows(); 494 updateAllWindows();
464 break; 495 break;
@@ -595,9 +626,11 @@ void IconbarTool::update(FbTk::Subject *subj) {
595 case WORKSPACEICONS: 626 case WORKSPACEICONS:
596 updateIcons(); 627 updateIcons();
597 break; 628 break;
629 case WORKSPACENOICONS:
598 case WORKSPACE: 630 case WORKSPACE:
599 updateWorkspace(); 631 updateWorkspace();
600 break; 632 break;
633 case NOICONS:
601 case ALLWINDOWS: 634 case ALLWINDOWS:
602 updateAllWindows(); 635 updateAllWindows();
603 break; 636 break;
@@ -867,13 +900,16 @@ void IconbarTool::updateWorkspace() {
867 for (; win_it != win_it_end; ++win_it) { 900 for (; win_it != win_it_end; ++win_it) {
868 if (checkAddWindow(mode(), **win_it)) 901 if (checkAddWindow(mode(), **win_it))
869 itemlist.push_back(*win_it); 902 itemlist.push_back(*win_it);
870 } 903 }
904
871 // add icons from current workspace 905 // add icons from current workspace
872 BScreen::Icons::iterator icon_it = m_screen.getIconList().begin(); 906 if (mode() != WORKSPACENOICONS) {
873 BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end(); 907 BScreen::Icons::iterator icon_it = m_screen.getIconList().begin();
874 for (; icon_it != icon_it_end; ++icon_it) { 908 BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end();
875 if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID()) 909 for (; icon_it != icon_it_end; ++icon_it) {
876 itemlist.push_back(*icon_it); 910 if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID())
911 itemlist.push_back(*icon_it);
912 }
877 } 913 }
878 914
879 removeDuplicate(m_icon_list, itemlist); 915 removeDuplicate(m_icon_list, itemlist);
@@ -892,9 +928,11 @@ void IconbarTool::updateAllWindows() {
892 (*workspace_it)->windowList().end()); 928 (*workspace_it)->windowList().end());
893 } 929 }
894 // add icons 930 // add icons
895 full_list.insert(full_list.end(), 931 if(mode() != NOICONS && mode() != WORKSPACENOICONS) {
896 m_screen.getIconList().begin(), 932 full_list.insert(full_list.end(),
897 m_screen.getIconList().end()); 933 m_screen.getIconList().begin(),
934 m_screen.getIconList().end());
935 }
898 936
899 removeDuplicate(m_icon_list, full_list); 937 removeDuplicate(m_icon_list, full_list);
900 addList(full_list); 938 addList(full_list);