From 9214e519b37be2025eb2fd0b9af6a1216eb3fbd0 Mon Sep 17 00:00:00 2001 From: mathias Date: Fri, 29 Apr 2005 16:54:30 +0000 Subject: added new IconbarModes: NoIcons - display all noniconified windows WorkspaceNoIcons - display all noniconified windows on the current workspace modified the nls-files accordingly --- nls/C/Translation.m | 2 ++ nls/fluxbox-nls.hh | 2 ++ src/FbWinFrame.hh | 2 ++ src/IconbarTool.cc | 56 ++++++++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/nls/C/Translation.m b/nls/C/Translation.m index cff250f..7f7a98c 100644 --- a/nls/C/Translation.m +++ b/nls/C/Translation.m @@ -185,6 +185,8 @@ $set 14 #Toolbar 14 Clock: 12h 15 Edit Clock Format 16 Show Pictures +17 NoIcons +18 WorkspaceNoIcons $set 15 #Window diff --git a/nls/fluxbox-nls.hh b/nls/fluxbox-nls.hh index b90e4f2..5b47934 100644 --- a/nls/fluxbox-nls.hh +++ b/nls/fluxbox-nls.hh @@ -177,6 +177,8 @@ enum { ToolbarClock12 = 14, ToolbarClockEditFormat = 15, ToolbarShowIcons = 16, + ToolbarIconbarModeNoIcons = 17, + ToolbarIconbarModeWorkspaceNoIcons = 18, WindowSet = 15, WindowUnnamed = 1, diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index 9bff974..ef86d68 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -163,6 +163,8 @@ public: inline int y() const { return m_window.y(); } inline unsigned int width() const { return m_window.width(); } inline unsigned int height() const { return m_window.height(); } + inline unsigned int widthBeforeShade() const { return m_width_before_shade; } + inline unsigned int heightBeforeShade() const { return m_height_before_shade; } inline const FbTk::FbWindow &window() const { return m_window; } inline FbTk::FbWindow &window() { return m_window; } /// @return titlebar window 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::setFromString(const char *strval) { m_value = IconbarTool::NONE; else if (strcasecmp(strval, "Icons") == 0) m_value = IconbarTool::ICONS; + else if (strcasecmp(strval, "NoIcons") == 0) + m_value = IconbarTool::NOICONS; else if (strcasecmp(strval, "WorkspaceIcons") == 0) m_value = IconbarTool::WORKSPACEICONS; + else if (strcasecmp(strval, "WorkspaceNoIcons") == 0) + m_value = IconbarTool::WORKSPACENOICONS; else if (strcasecmp(strval, "Workspace") == 0) m_value = IconbarTool::WORKSPACE; else if (strcasecmp(strval, "AllWindows") == 0) @@ -167,9 +171,15 @@ string FbTk::Resource::getString() { case IconbarTool::ICONS: return string("Icons"); break; + case IconbarTool::NOICONS: + return string("NoIcons"); + break; case IconbarTool::WORKSPACEICONS: return string("WorkspaceIcons"); break; + case IconbarTool::WORKSPACENOICONS: + return string("WorkspaceNoIcons"); + break; case IconbarTool::WORKSPACE: return string("Workspace"); break; @@ -242,12 +252,24 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) { IconbarTool::ICONS, saverc_cmd)); menu.insert(new ToolbarModeMenuItem( + _FBTEXT(Toolbar, IconbarModeNoIcons, + "NoIcons", "No iconified windows from all workspaces are shown"), + handler, + IconbarTool::NOICONS, saverc_cmd)); + + menu.insert(new ToolbarModeMenuItem( _FBTEXT(Toolbar, IconbarModeWorkspaceIcons, "WorkspaceIcons", "Iconified windows from this workspace are shown"), handler, IconbarTool::WORKSPACEICONS, saverc_cmd)); menu.insert(new ToolbarModeMenuItem( + _FBTEXT(Toolbar, IconbarModeWorkspaceNoIcons, + "WorkspaceNoIcons", "No iconified windows from this workspace are shown"), + handler, + IconbarTool::WORKSPACENOICONS, saverc_cmd)); + + menu.insert(new ToolbarModeMenuItem( _FBTEXT(Toolbar, IconbarModeWorkspace, "Workspace", "Normal and iconified windows from this workspace are shown"), handler, @@ -290,11 +312,18 @@ inline bool checkAddWindow(IconbarTool::Mode mode, const FluxboxWindow &win) { if (win.isIconic()) ret_val = true; break; + case IconbarTool::NOICONS: + if (!win.isIconic()) + ret_val = true; + break; case IconbarTool::WORKSPACEICONS: if(win.workspaceNumber() == win.screen().currentWorkspaceID() && win.isIconic()) ret_val = true; break; + case IconbarTool::WORKSPACENOICONS: + if (win.isIconic()) + break; case IconbarTool::WORKSPACE: if (win.workspaceNumber() == win.screen().currentWorkspaceID()) ret_val = true; @@ -456,9 +485,11 @@ void IconbarTool::setMode(Mode mode) { case WORKSPACEICONS: // all icons on current workspace updateIcons(); break; + case WORKSPACENOICONS: case WORKSPACE: // all windows and all icons on current workspace updateWorkspace(); break; + case NOICONS: case ALLWINDOWS: // all windows and all icons from all workspaces updateAllWindows(); break; @@ -595,9 +626,11 @@ void IconbarTool::update(FbTk::Subject *subj) { case WORKSPACEICONS: updateIcons(); break; + case WORKSPACENOICONS: case WORKSPACE: updateWorkspace(); break; + case NOICONS: case ALLWINDOWS: updateAllWindows(); break; @@ -867,13 +900,16 @@ void IconbarTool::updateWorkspace() { for (; win_it != win_it_end; ++win_it) { if (checkAddWindow(mode(), **win_it)) itemlist.push_back(*win_it); - } + } + // add icons from current workspace - BScreen::Icons::iterator icon_it = m_screen.getIconList().begin(); - BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end(); - for (; icon_it != icon_it_end; ++icon_it) { - if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID()) - itemlist.push_back(*icon_it); + if (mode() != WORKSPACENOICONS) { + BScreen::Icons::iterator icon_it = m_screen.getIconList().begin(); + BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end(); + for (; icon_it != icon_it_end; ++icon_it) { + if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID()) + itemlist.push_back(*icon_it); + } } removeDuplicate(m_icon_list, itemlist); @@ -892,9 +928,11 @@ void IconbarTool::updateAllWindows() { (*workspace_it)->windowList().end()); } // add icons - full_list.insert(full_list.end(), - m_screen.getIconList().begin(), - m_screen.getIconList().end()); + if(mode() != NOICONS && mode() != WORKSPACENOICONS) { + full_list.insert(full_list.end(), + m_screen.getIconList().begin(), + m_screen.getIconList().end()); + } removeDuplicate(m_icon_list, full_list); addList(full_list); -- cgit v0.11.2