diff options
author | Thomas Lübking <thomas.luebking@gmail.com> | 2016-08-13 14:37:57 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2016-09-03 17:29:52 (GMT) |
commit | 3058861f8977374dff1ed6401bbdac9cce92bc99 (patch) | |
tree | 9250463d6421c52b92b7bfc8f7a3e28311473235 /src/IconbarTool.cc | |
parent | e99d940f407d37f31ecda0f4878a161bfc479a46 (diff) | |
download | fluxbox-3058861f8977374dff1ed6401bbdac9cce92bc99.zip fluxbox-3058861f8977374dff1ed6401bbdac9cce92bc99.tar.bz2 |
indicate iconified windows in iconbar
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r-- | src/IconbarTool.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index d940b1d..128b71e 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc | |||
@@ -225,6 +225,8 @@ private: | |||
225 | 225 | ||
226 | } // end anonymous namespace | 226 | } // end anonymous namespace |
227 | 227 | ||
228 | std::string IconbarTool::s_iconifiedDecoration[2]; | ||
229 | |||
228 | IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, | 230 | IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, |
229 | FbTk::ThemeProxy<IconbarTheme> &focused_theme, | 231 | FbTk::ThemeProxy<IconbarTheme> &focused_theme, |
230 | FbTk::ThemeProxy<IconbarTheme> &unfocused_theme, | 232 | FbTk::ThemeProxy<IconbarTheme> &unfocused_theme, |
@@ -252,6 +254,8 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, | |||
252 | *screen.layerManager().getLayer(ResourceLayer::MENU)), | 254 | *screen.layerManager().getLayer(ResourceLayer::MENU)), |
253 | m_alpha(255) { | 255 | m_alpha(255) { |
254 | 256 | ||
257 | updateIconifiedPattern(); | ||
258 | |||
255 | // setup mode menu | 259 | // setup mode menu |
256 | setupModeMenu(m_menu, *this); | 260 | setupModeMenu(m_menu, *this); |
257 | _FB_USES_NLS; | 261 | _FB_USES_NLS; |
@@ -279,6 +283,8 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, | |||
279 | FbTk::MemFun(*this, &IconbarTool::themeReconfigured)); | 283 | FbTk::MemFun(*this, &IconbarTool::themeReconfigured)); |
280 | m_tracker.join(unfocused_theme.reconfigSig(), | 284 | m_tracker.join(unfocused_theme.reconfigSig(), |
281 | FbTk::MemFun(*this, &IconbarTool::themeReconfigured)); | 285 | FbTk::MemFun(*this, &IconbarTool::themeReconfigured)); |
286 | m_tracker.join(screen.reconfigureSig(), | ||
287 | FbTk::MemFunIgnoreArgs(*this, &IconbarTool::updateIconifiedPattern)); | ||
282 | themeReconfigured(); | 288 | themeReconfigured(); |
283 | } | 289 | } |
284 | 290 | ||
@@ -439,6 +445,19 @@ void IconbarTool::update(UpdateReason reason, Focusable *win) { | |||
439 | renderTheme(); | 445 | renderTheme(); |
440 | } | 446 | } |
441 | 447 | ||
448 | void IconbarTool::updateIconifiedPattern() { | ||
449 | FbTk::Resource<std::string> p(m_screen.resourceManager(), "( %t )", | ||
450 | m_screen.name() + ".iconbar.iconifiedPattern", | ||
451 | m_screen.altName() + ".Iconbar.IconifiedPattern"); | ||
452 | size_t tidx = p->find("%t"); | ||
453 | s_iconifiedDecoration[0].clear(); | ||
454 | s_iconifiedDecoration[1].clear(); | ||
455 | if (tidx != std::string::npos) { | ||
456 | s_iconifiedDecoration[0] = p->substr(0, tidx); | ||
457 | s_iconifiedDecoration[1] = p->substr(tidx+2); | ||
458 | } | ||
459 | } | ||
460 | |||
442 | void IconbarTool::insertWindow(Focusable &win, int pos) { | 461 | void IconbarTool::insertWindow(Focusable &win, int pos) { |
443 | IconButton *button = 0; | 462 | IconButton *button = 0; |
444 | 463 | ||