added new IconbarModes:

NoIcons          - display all noniconified windows
  WorkspaceNoIcons - display all noniconified windows on the current
                     workspace

modified the nls-files accordingly
This commit is contained in:
mathias 2005-04-29 16:54:30 +00:00
parent e2acd2b04c
commit 9214e519b3
4 changed files with 53 additions and 9 deletions

View file

@ -185,6 +185,8 @@ $set 14 #Toolbar
14 Clock: 12h 14 Clock: 12h
15 Edit Clock Format 15 Edit Clock Format
16 Show Pictures 16 Show Pictures
17 NoIcons
18 WorkspaceNoIcons
$set 15 #Window $set 15 #Window

View file

@ -177,6 +177,8 @@ enum {
ToolbarClock12 = 14, ToolbarClock12 = 14,
ToolbarClockEditFormat = 15, ToolbarClockEditFormat = 15,
ToolbarShowIcons = 16, ToolbarShowIcons = 16,
ToolbarIconbarModeNoIcons = 17,
ToolbarIconbarModeWorkspaceNoIcons = 18,
WindowSet = 15, WindowSet = 15,
WindowUnnamed = 1, WindowUnnamed = 1,

View file

@ -163,6 +163,8 @@ public:
inline int y() const { return m_window.y(); } inline int y() const { return m_window.y(); }
inline unsigned int width() const { return m_window.width(); } inline unsigned int width() const { return m_window.width(); }
inline unsigned int height() const { return m_window.height(); } 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 const FbTk::FbWindow &window() const { return m_window; }
inline FbTk::FbWindow &window() { return m_window; } inline FbTk::FbWindow &window() { return m_window; }
/// @return titlebar window /// @return titlebar window

View file

@ -55,8 +55,12 @@ void FbTk::Resource<IconbarTool::Mode>::setFromString(const char *strval) {
m_value = IconbarTool::NONE; m_value = IconbarTool::NONE;
else if (strcasecmp(strval, "Icons") == 0) else if (strcasecmp(strval, "Icons") == 0)
m_value = IconbarTool::ICONS; m_value = IconbarTool::ICONS;
else if (strcasecmp(strval, "NoIcons") == 0)
m_value = IconbarTool::NOICONS;
else if (strcasecmp(strval, "WorkspaceIcons") == 0) else if (strcasecmp(strval, "WorkspaceIcons") == 0)
m_value = IconbarTool::WORKSPACEICONS; m_value = IconbarTool::WORKSPACEICONS;
else if (strcasecmp(strval, "WorkspaceNoIcons") == 0)
m_value = IconbarTool::WORKSPACENOICONS;
else if (strcasecmp(strval, "Workspace") == 0) else if (strcasecmp(strval, "Workspace") == 0)
m_value = IconbarTool::WORKSPACE; m_value = IconbarTool::WORKSPACE;
else if (strcasecmp(strval, "AllWindows") == 0) else if (strcasecmp(strval, "AllWindows") == 0)
@ -167,9 +171,15 @@ string FbTk::Resource<IconbarTool::Mode>::getString() {
case IconbarTool::ICONS: case IconbarTool::ICONS:
return string("Icons"); return string("Icons");
break; break;
case IconbarTool::NOICONS:
return string("NoIcons");
break;
case IconbarTool::WORKSPACEICONS: case IconbarTool::WORKSPACEICONS:
return string("WorkspaceIcons"); return string("WorkspaceIcons");
break; break;
case IconbarTool::WORKSPACENOICONS:
return string("WorkspaceNoIcons");
break;
case IconbarTool::WORKSPACE: case IconbarTool::WORKSPACE:
return string("Workspace"); return string("Workspace");
break; break;
@ -241,12 +251,24 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) {
handler, handler,
IconbarTool::ICONS, saverc_cmd)); 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( menu.insert(new ToolbarModeMenuItem(
_FBTEXT(Toolbar, IconbarModeWorkspaceIcons, _FBTEXT(Toolbar, IconbarModeWorkspaceIcons,
"WorkspaceIcons", "Iconified windows from this workspace are shown"), "WorkspaceIcons", "Iconified windows from this workspace are shown"),
handler, handler,
IconbarTool::WORKSPACEICONS, saverc_cmd)); 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( menu.insert(new ToolbarModeMenuItem(
_FBTEXT(Toolbar, IconbarModeWorkspace, _FBTEXT(Toolbar, IconbarModeWorkspace,
"Workspace", "Normal and iconified windows from this workspace are shown"), "Workspace", "Normal and iconified windows from this workspace are shown"),
@ -290,11 +312,18 @@ inline bool checkAddWindow(IconbarTool::Mode mode, const FluxboxWindow &win) {
if (win.isIconic()) if (win.isIconic())
ret_val = true; ret_val = true;
break; break;
case IconbarTool::NOICONS:
if (!win.isIconic())
ret_val = true;
break;
case IconbarTool::WORKSPACEICONS: case IconbarTool::WORKSPACEICONS:
if(win.workspaceNumber() == win.screen().currentWorkspaceID() && if(win.workspaceNumber() == win.screen().currentWorkspaceID() &&
win.isIconic()) win.isIconic())
ret_val = true; ret_val = true;
break; break;
case IconbarTool::WORKSPACENOICONS:
if (win.isIconic())
break;
case IconbarTool::WORKSPACE: case IconbarTool::WORKSPACE:
if (win.workspaceNumber() == win.screen().currentWorkspaceID()) if (win.workspaceNumber() == win.screen().currentWorkspaceID())
ret_val = true; ret_val = true;
@ -456,9 +485,11 @@ void IconbarTool::setMode(Mode mode) {
case WORKSPACEICONS: // all icons on current workspace case WORKSPACEICONS: // all icons on current workspace
updateIcons(); updateIcons();
break; break;
case WORKSPACENOICONS:
case WORKSPACE: // all windows and all icons on current workspace case WORKSPACE: // all windows and all icons on current workspace
updateWorkspace(); updateWorkspace();
break; break;
case NOICONS:
case ALLWINDOWS: // all windows and all icons from all workspaces case ALLWINDOWS: // all windows and all icons from all workspaces
updateAllWindows(); updateAllWindows();
break; break;
@ -595,9 +626,11 @@ void IconbarTool::update(FbTk::Subject *subj) {
case WORKSPACEICONS: case WORKSPACEICONS:
updateIcons(); updateIcons();
break; break;
case WORKSPACENOICONS:
case WORKSPACE: case WORKSPACE:
updateWorkspace(); updateWorkspace();
break; break;
case NOICONS:
case ALLWINDOWS: case ALLWINDOWS:
updateAllWindows(); updateAllWindows();
break; break;
@ -867,13 +900,16 @@ void IconbarTool::updateWorkspace() {
for (; win_it != win_it_end; ++win_it) { for (; win_it != win_it_end; ++win_it) {
if (checkAddWindow(mode(), **win_it)) if (checkAddWindow(mode(), **win_it))
itemlist.push_back(*win_it); itemlist.push_back(*win_it);
} }
// add icons from current workspace // add icons from current workspace
BScreen::Icons::iterator icon_it = m_screen.getIconList().begin(); if (mode() != WORKSPACENOICONS) {
BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end(); BScreen::Icons::iterator icon_it = m_screen.getIconList().begin();
for (; icon_it != icon_it_end; ++icon_it) { BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end();
if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID()) for (; icon_it != icon_it_end; ++icon_it) {
itemlist.push_back(*icon_it); if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID())
itemlist.push_back(*icon_it);
}
} }
removeDuplicate(m_icon_list, itemlist); removeDuplicate(m_icon_list, itemlist);
@ -892,9 +928,11 @@ void IconbarTool::updateAllWindows() {
(*workspace_it)->windowList().end()); (*workspace_it)->windowList().end());
} }
// add icons // add icons
full_list.insert(full_list.end(), if(mode() != NOICONS && mode() != WORKSPACENOICONS) {
m_screen.getIconList().begin(), full_list.insert(full_list.end(),
m_screen.getIconList().end()); m_screen.getIconList().begin(),
m_screen.getIconList().end());
}
removeDuplicate(m_icon_list, full_list); removeDuplicate(m_icon_list, full_list);
addList(full_list); addList(full_list);