diff options
author | mathias <mathias> | 2006-10-30 19:31:15 (GMT) |
---|---|---|
committer | mathias <mathias> | 2006-10-30 19:31:15 (GMT) |
commit | e5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5 (patch) | |
tree | c84838a84802805e9b1463045e86200b7cef917f /src/IconbarTool.cc | |
parent | 426c12c25c2ef095a882619ad7424684b88465b8 (diff) | |
download | fluxbox-e5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5.zip fluxbox-e5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5.tar.bz2 |
Cosmetic patch from Slava Semushin
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r-- | src/IconbarTool.cc | 122 |
1 files changed, 65 insertions, 57 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index d7d45cd..2203f94 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc | |||
@@ -49,25 +49,32 @@ | |||
49 | #include <typeinfo> | 49 | #include <typeinfo> |
50 | #include <string> | 50 | #include <string> |
51 | #include <iterator> | 51 | #include <iterator> |
52 | using namespace std; | 52 | |
53 | using std::string; | ||
54 | using std::list; | ||
55 | |||
56 | #ifdef DEBUG | ||
57 | using std::cerr; | ||
58 | using std::endl; | ||
59 | #endif // DEBUG | ||
53 | 60 | ||
54 | namespace FbTk { | 61 | namespace FbTk { |
55 | 62 | ||
56 | template<> | 63 | template<> |
57 | void FbTk::Resource<IconbarTool::Mode>::setFromString(const char *strval) { | 64 | void FbTk::Resource<IconbarTool::Mode>::setFromString(const char *strval) { |
58 | if (strcasecmp(strval, "None") == 0) | 65 | if (strcasecmp(strval, "None") == 0) |
59 | m_value = IconbarTool::NONE; | 66 | m_value = IconbarTool::NONE; |
60 | else if (strcasecmp(strval, "Icons") == 0) | 67 | else if (strcasecmp(strval, "Icons") == 0) |
61 | m_value = IconbarTool::ICONS; | 68 | m_value = IconbarTool::ICONS; |
62 | else if (strcasecmp(strval, "NoIcons") == 0) | 69 | else if (strcasecmp(strval, "NoIcons") == 0) |
63 | m_value = IconbarTool::NOICONS; | 70 | m_value = IconbarTool::NOICONS; |
64 | else if (strcasecmp(strval, "WorkspaceIcons") == 0) | 71 | else if (strcasecmp(strval, "WorkspaceIcons") == 0) |
65 | m_value = IconbarTool::WORKSPACEICONS; | 72 | m_value = IconbarTool::WORKSPACEICONS; |
66 | else if (strcasecmp(strval, "WorkspaceNoIcons") == 0) | 73 | else if (strcasecmp(strval, "WorkspaceNoIcons") == 0) |
67 | m_value = IconbarTool::WORKSPACENOICONS; | 74 | m_value = IconbarTool::WORKSPACENOICONS; |
68 | else if (strcasecmp(strval, "Workspace") == 0) | 75 | else if (strcasecmp(strval, "Workspace") == 0) |
69 | m_value = IconbarTool::WORKSPACE; | 76 | m_value = IconbarTool::WORKSPACE; |
70 | else if (strcasecmp(strval, "AllWindows") == 0) | 77 | else if (strcasecmp(strval, "AllWindows") == 0) |
71 | m_value = IconbarTool::ALLWINDOWS; | 78 | m_value = IconbarTool::ALLWINDOWS; |
72 | else | 79 | else |
73 | setDefaultValue(); | 80 | setDefaultValue(); |
@@ -93,17 +100,17 @@ void FbTk::Resource<IconbarTool::WheelMode>::setFromString(const char* strval) { | |||
93 | 100 | ||
94 | 101 | ||
95 | template<> | 102 | template<> |
96 | std::string FbTk::Resource<IconbarTool::WheelMode>::getString() const { | 103 | string FbTk::Resource<IconbarTool::WheelMode>::getString() const { |
97 | switch(m_value) { | 104 | switch(m_value) { |
98 | case IconbarTool::ON: | 105 | case IconbarTool::ON: |
99 | return std::string("On"); | 106 | return string("On"); |
100 | break; | 107 | break; |
101 | case IconbarTool::SCREEN: | 108 | case IconbarTool::SCREEN: |
102 | return std::string("Screen"); | 109 | return string("Screen"); |
103 | break; | 110 | break; |
104 | case IconbarTool::OFF: | 111 | case IconbarTool::OFF: |
105 | default: | 112 | default: |
106 | return std::string("Off"); | 113 | return string("Off"); |
107 | }; | 114 | }; |
108 | } | 115 | } |
109 | 116 | ||
@@ -172,8 +179,8 @@ namespace { | |||
172 | 179 | ||
173 | class ToolbarModeMenuItem : public FbTk::MenuItem { | 180 | class ToolbarModeMenuItem : public FbTk::MenuItem { |
174 | public: | 181 | public: |
175 | ToolbarModeMenuItem(const FbTk::FbString &label, IconbarTool &handler, | 182 | ToolbarModeMenuItem(const FbTk::FbString &label, IconbarTool &handler, |
176 | IconbarTool::Mode mode, | 183 | IconbarTool::Mode mode, |
177 | FbTk::RefCount<FbTk::Command> &cmd): | 184 | FbTk::RefCount<FbTk::Command> &cmd): |
178 | FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { | 185 | FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { |
179 | } | 186 | } |
@@ -190,8 +197,8 @@ private: | |||
190 | 197 | ||
191 | class ToolbarAlignMenuItem: public FbTk::MenuItem { | 198 | class ToolbarAlignMenuItem: public FbTk::MenuItem { |
192 | public: | 199 | public: |
193 | ToolbarAlignMenuItem(const FbTk::FbString &label, IconbarTool &handler, | 200 | ToolbarAlignMenuItem(const FbTk::FbString &label, IconbarTool &handler, |
194 | Container::Alignment mode, | 201 | Container::Alignment mode, |
195 | FbTk::RefCount<FbTk::Command> &cmd): | 202 | FbTk::RefCount<FbTk::Command> &cmd): |
196 | FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { | 203 | FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { |
197 | } | 204 | } |
@@ -213,17 +220,17 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) { | |||
213 | menu.setLabel(_FB_XTEXT(Toolbar, IconbarMode, "Iconbar Mode", "Menu title - chooses which set of icons are shown in the iconbar")); | 220 | menu.setLabel(_FB_XTEXT(Toolbar, IconbarMode, "Iconbar Mode", "Menu title - chooses which set of icons are shown in the iconbar")); |
214 | 221 | ||
215 | RefCount<Command> saverc_cmd(new FbCommands::SaveResources()); | 222 | RefCount<Command> saverc_cmd(new FbCommands::SaveResources()); |
216 | |||
217 | 223 | ||
218 | menu.insert(new ToolbarModeMenuItem(_FB_XTEXT(Toolbar, IconbarModeNone, | 224 | |
225 | menu.insert(new ToolbarModeMenuItem(_FB_XTEXT(Toolbar, IconbarModeNone, | ||
219 | "None", "No icons are shown in the iconbar"), | 226 | "None", "No icons are shown in the iconbar"), |
220 | handler, | 227 | handler, |
221 | IconbarTool::NONE, saverc_cmd)); | 228 | IconbarTool::NONE, saverc_cmd)); |
222 | 229 | ||
223 | menu.insert(new ToolbarModeMenuItem( | 230 | menu.insert(new ToolbarModeMenuItem( |
224 | _FB_XTEXT(Toolbar, IconbarModeIcons, | 231 | _FB_XTEXT(Toolbar, IconbarModeIcons, |
225 | "Icons", "Iconified windows from all workspaces are shown"), | 232 | "Icons", "Iconified windows from all workspaces are shown"), |
226 | handler, | 233 | handler, |
227 | IconbarTool::ICONS, saverc_cmd)); | 234 | IconbarTool::ICONS, saverc_cmd)); |
228 | 235 | ||
229 | menu.insert(new ToolbarModeMenuItem( | 236 | menu.insert(new ToolbarModeMenuItem( |
@@ -233,26 +240,26 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) { | |||
233 | IconbarTool::NOICONS, saverc_cmd)); | 240 | IconbarTool::NOICONS, saverc_cmd)); |
234 | 241 | ||
235 | menu.insert(new ToolbarModeMenuItem( | 242 | menu.insert(new ToolbarModeMenuItem( |
236 | _FB_XTEXT(Toolbar, IconbarModeWorkspaceIcons, | 243 | _FB_XTEXT(Toolbar, IconbarModeWorkspaceIcons, |
237 | "WorkspaceIcons", "Iconified windows from this workspace are shown"), | 244 | "WorkspaceIcons", "Iconified windows from this workspace are shown"), |
238 | handler, | 245 | handler, |
239 | IconbarTool::WORKSPACEICONS, saverc_cmd)); | 246 | IconbarTool::WORKSPACEICONS, saverc_cmd)); |
240 | 247 | ||
241 | menu.insert(new ToolbarModeMenuItem( | 248 | menu.insert(new ToolbarModeMenuItem( |
242 | _FB_XTEXT(Toolbar, IconbarModeWorkspaceNoIcons, | 249 | _FB_XTEXT(Toolbar, IconbarModeWorkspaceNoIcons, |
243 | "WorkspaceNoIcons", "No iconified windows from this workspace are shown"), | 250 | "WorkspaceNoIcons", "No iconified windows from this workspace are shown"), |
244 | handler, | 251 | handler, |
245 | IconbarTool::WORKSPACENOICONS, saverc_cmd)); | 252 | IconbarTool::WORKSPACENOICONS, saverc_cmd)); |
246 | 253 | ||
247 | menu.insert(new ToolbarModeMenuItem( | 254 | menu.insert(new ToolbarModeMenuItem( |
248 | _FB_XTEXT(Toolbar, IconbarModeWorkspace, | 255 | _FB_XTEXT(Toolbar, IconbarModeWorkspace, |
249 | "Workspace", "Normal and iconified windows from this workspace are shown"), | 256 | "Workspace", "Normal and iconified windows from this workspace are shown"), |
250 | handler, | 257 | handler, |
251 | IconbarTool::WORKSPACE, saverc_cmd)); | 258 | IconbarTool::WORKSPACE, saverc_cmd)); |
252 | 259 | ||
253 | menu.insert(new ToolbarModeMenuItem( | 260 | menu.insert(new ToolbarModeMenuItem( |
254 | _FB_XTEXT(Toolbar, IconbarModeAllWindows, "All Windows", "All windows are shown"), | 261 | _FB_XTEXT(Toolbar, IconbarModeAllWindows, "All Windows", "All windows are shown"), |
255 | handler, | 262 | handler, |
256 | IconbarTool::ALLWINDOWS, saverc_cmd)); | 263 | IconbarTool::ALLWINDOWS, saverc_cmd)); |
257 | 264 | ||
258 | menu.insert(new FbTk::MenuSeparator()); | 265 | menu.insert(new FbTk::MenuSeparator()); |
@@ -276,7 +283,7 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) { | |||
276 | 283 | ||
277 | menu.updateMenu(); | 284 | menu.updateMenu(); |
278 | } | 285 | } |
279 | 286 | ||
280 | inline bool checkAddWindow(IconbarTool::Mode mode, const FluxboxWindow &win) { | 287 | inline bool checkAddWindow(IconbarTool::Mode mode, const FluxboxWindow &win) { |
281 | bool ret_val = false; | 288 | bool ret_val = false; |
282 | // just add the icons that are on the this workspace | 289 | // just add the icons that are on the this workspace |
@@ -314,10 +321,10 @@ inline bool checkAddWindow(IconbarTool::Mode mode, const FluxboxWindow &win) { | |||
314 | return ret_val; | 321 | return ret_val; |
315 | } | 322 | } |
316 | 323 | ||
317 | void removeDuplicate(const IconbarTool::IconList &iconlist, std::list<FluxboxWindow *> &windowlist) { | 324 | void removeDuplicate(const IconbarTool::IconList &iconlist, list<FluxboxWindow *> &windowlist) { |
318 | IconbarTool::IconList::const_iterator icon_it = iconlist.begin(); | 325 | IconbarTool::IconList::const_iterator icon_it = iconlist.begin(); |
319 | IconbarTool::IconList::const_iterator icon_it_end = iconlist.end(); | 326 | IconbarTool::IconList::const_iterator icon_it_end = iconlist.end(); |
320 | std::list<FluxboxWindow *>::iterator remove_it = windowlist.end(); | 327 | list<FluxboxWindow *>::iterator remove_it = windowlist.end(); |
321 | for (; icon_it != icon_it_end; ++icon_it) | 328 | for (; icon_it != icon_it_end; ++icon_it) |
322 | remove_it = remove(windowlist.begin(), remove_it, &(*icon_it)->win()); | 329 | remove_it = remove(windowlist.begin(), remove_it, &(*icon_it)->win()); |
323 | 330 | ||
@@ -359,13 +366,14 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr | |||
359 | _FB_USES_NLS; | 366 | _FB_USES_NLS; |
360 | using namespace FbTk; | 367 | using namespace FbTk; |
361 | // setup use pixmap item to reconfig iconbar and save resource on click | 368 | // setup use pixmap item to reconfig iconbar and save resource on click |
362 | MacroCommand *save_and_reconfig = new MacroCommand(); | 369 | MacroCommand *save_and_reconfig = new MacroCommand(); |
363 | RefCount<Command> reconfig(new SimpleCommand<IconbarTool>(*this, &IconbarTool::renderTheme)); | 370 | RefCount<Command> reconfig(new SimpleCommand<IconbarTool>(*this, &IconbarTool::renderTheme)); |
364 | RefCount<Command> save(CommandParser::instance().parseLine("saverc")); | 371 | RefCount<Command> save(CommandParser::instance().parseLine("saverc")); |
365 | save_and_reconfig->add(reconfig); | 372 | save_and_reconfig->add(reconfig); |
366 | save_and_reconfig->add(save); | 373 | save_and_reconfig->add(save); |
367 | RefCount<Command> s_and_reconfig(save_and_reconfig); | 374 | RefCount<Command> s_and_reconfig(save_and_reconfig); |
368 | m_menu.insert(new BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons, "Show Pictures", "chooses if little icons are shown next to title in the iconbar") , | 375 | m_menu.insert(new BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons, |
376 | "Show Pictures", "chooses if little icons are shown next to title in the iconbar"), | ||
369 | *m_rc_use_pixmap, s_and_reconfig)); | 377 | *m_rc_use_pixmap, s_and_reconfig)); |
370 | m_menu.updateMenu(); | 378 | m_menu.updateMenu(); |
371 | // must be internal menu, otherwise toolbar main menu tries to delete it. | 379 | // must be internal menu, otherwise toolbar main menu tries to delete it. |
@@ -459,12 +467,12 @@ unsigned int IconbarTool::borderWidth() const { | |||
459 | return m_icon_container.borderWidth(); | 467 | return m_icon_container.borderWidth(); |
460 | } | 468 | } |
461 | 469 | ||
462 | void IconbarTool::update(FbTk::Subject *subj) { | 470 | void IconbarTool::update(FbTk::Subject *subj) { |
463 | // ignore updates if we're shutting down | 471 | // ignore updates if we're shutting down |
464 | if (m_screen.isShuttingdown()) { | 472 | if (m_screen.isShuttingdown()) { |
465 | m_screen.clientListSig().detach(this); | 473 | m_screen.clientListSig().detach(this); |
466 | m_screen.iconListSig().detach(this); | 474 | m_screen.iconListSig().detach(this); |
467 | m_screen.currentWorkspaceSig().detach(this); | 475 | m_screen.currentWorkspaceSig().detach(this); |
468 | if (!m_icon_list.empty()) | 476 | if (!m_icon_list.empty()) |
469 | deleteIcons(); | 477 | deleteIcons(); |
470 | return; | 478 | return; |
@@ -512,7 +520,7 @@ void IconbarTool::update(FbTk::Subject *subj) { | |||
512 | return; // we don't need to update the entire list | 520 | return; // we don't need to update the entire list |
513 | } else if (subj == &(winsubj->win().stateSig())) { | 521 | } else if (subj == &(winsubj->win().stateSig())) { |
514 | if (!checkAddWindow(mode(), winsubj->win())) { | 522 | if (!checkAddWindow(mode(), winsubj->win())) { |
515 | removeWindow(winsubj->win()); | 523 | removeWindow(winsubj->win()); |
516 | renderTheme(); | 524 | renderTheme(); |
517 | } | 525 | } |
518 | 526 | ||
@@ -522,7 +530,7 @@ void IconbarTool::update(FbTk::Subject *subj) { | |||
522 | // render with titlebar focus, on attention | 530 | // render with titlebar focus, on attention |
523 | IconButton *button = findButton(winsubj->win()); | 531 | IconButton *button = findButton(winsubj->win()); |
524 | if (button) { | 532 | if (button) { |
525 | renderButton(*button, true, | 533 | renderButton(*button, true, |
526 | winsubj->win().getAttentionState()); | 534 | winsubj->win().getAttentionState()); |
527 | } | 535 | } |
528 | return; | 536 | return; |
@@ -532,7 +540,7 @@ void IconbarTool::update(FbTk::Subject *subj) { | |||
532 | } | 540 | } |
533 | } | 541 | } |
534 | 542 | ||
535 | bool remove_all = false; // if we should readd all windows | 543 | bool remove_all = false; // if we should readd all windows |
536 | 544 | ||
537 | if (subj != 0 && typeid(*subj) == typeid(BScreen::ScreenSubject) && | 545 | if (subj != 0 && typeid(*subj) == typeid(BScreen::ScreenSubject) && |
538 | mode() != ALLWINDOWS && mode() != ICONS ) { | 546 | mode() != ALLWINDOWS && mode() != ICONS ) { |
@@ -541,7 +549,7 @@ void IconbarTool::update(FbTk::Subject *subj) { | |||
541 | if (&m_screen.currentWorkspaceSig() == screen_subj ) { | 549 | if (&m_screen.currentWorkspaceSig() == screen_subj ) { |
542 | remove_all = true; // remove and readd all windows | 550 | remove_all = true; // remove and readd all windows |
543 | } | 551 | } |
544 | 552 | ||
545 | } | 553 | } |
546 | 554 | ||
547 | // lock graphic update | 555 | // lock graphic update |
@@ -559,7 +567,7 @@ void IconbarTool::update(FbTk::Subject *subj) { | |||
559 | m_icon_container.setUpdateLock(false); | 567 | m_icon_container.setUpdateLock(false); |
560 | m_icon_container.update(); | 568 | m_icon_container.update(); |
561 | m_icon_container.showSubwindows(); | 569 | m_icon_container.showSubwindows(); |
562 | 570 | ||
563 | // another renderTheme we hopefully shouldn't need? These renders | 571 | // another renderTheme we hopefully shouldn't need? These renders |
564 | // should be done individually above | 572 | // should be done individually above |
565 | // renderTheme(); | 573 | // renderTheme(); |
@@ -588,13 +596,13 @@ void IconbarTool::updateSizing() { | |||
588 | m_icon_container.setBorderWidth(m_theme.border().width()); | 596 | m_icon_container.setBorderWidth(m_theme.border().width()); |
589 | 597 | ||
590 | IconList::iterator icon_it = m_icon_list.begin(); | 598 | IconList::iterator icon_it = m_icon_list.begin(); |
591 | const IconList::iterator icon_it_end = m_icon_list.end(); | 599 | const IconList::iterator icon_it_end = m_icon_list.end(); |
592 | for (; icon_it != icon_it_end; ++icon_it) { | 600 | for (; icon_it != icon_it_end; ++icon_it) { |
593 | if ((*icon_it)->win().isFocused()) | 601 | if ((*icon_it)->win().isFocused()) |
594 | (*icon_it)->setBorderWidth(m_theme.focusedBorder().width()); | 602 | (*icon_it)->setBorderWidth(m_theme.focusedBorder().width()); |
595 | else // unfocused | 603 | else // unfocused |
596 | (*icon_it)->setBorderWidth(m_theme.unfocusedBorder().width()); | 604 | (*icon_it)->setBorderWidth(m_theme.unfocusedBorder().width()); |
597 | } | 605 | } |
598 | 606 | ||
599 | } | 607 | } |
600 | 608 | ||
@@ -608,10 +616,10 @@ void IconbarTool::renderTheme() { | |||
608 | 616 | ||
609 | // update button sizes before we get max width per client! | 617 | // update button sizes before we get max width per client! |
610 | updateSizing(); | 618 | updateSizing(); |
611 | 619 | ||
612 | unsigned int icon_width = 0, icon_height = 0; | 620 | unsigned int icon_width = 0, icon_height = 0; |
613 | unsigned int icon_width_off=0, icon_height_off=0; | 621 | unsigned int icon_width_off=0, icon_height_off=0; |
614 | 622 | ||
615 | if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180) { | 623 | if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180) { |
616 | icon_width = m_icon_container.maxWidthPerClient(); | 624 | icon_width = m_icon_container.maxWidthPerClient(); |
617 | icon_height = m_icon_container.height(); | 625 | icon_height = m_icon_container.height(); |
@@ -634,7 +642,7 @@ void IconbarTool::renderTheme() { | |||
634 | icon_height + icon_height_off, | 642 | icon_height + icon_height_off, |
635 | m_theme.focusedTexture(), orientation()) ); | 643 | m_theme.focusedTexture(), orientation()) ); |
636 | } | 644 | } |
637 | 645 | ||
638 | if (!m_theme.unfocusedTexture().usePixmap()) { | 646 | if (!m_theme.unfocusedTexture().usePixmap()) { |
639 | m_unfocused_pm.reset( 0 ); | 647 | m_unfocused_pm.reset( 0 ); |
640 | m_unfocused_err_pm.reset( 0 ); | 648 | m_unfocused_err_pm.reset( 0 ); |
@@ -666,7 +674,7 @@ void IconbarTool::renderTheme() { | |||
666 | 674 | ||
667 | // update buttons | 675 | // update buttons |
668 | IconList::iterator icon_it = m_icon_list.begin(); | 676 | IconList::iterator icon_it = m_icon_list.begin(); |
669 | const IconList::iterator icon_it_end = m_icon_list.end(); | 677 | const IconList::iterator icon_it_end = m_icon_list.end(); |
670 | for (; icon_it != icon_it_end; ++icon_it) { | 678 | for (; icon_it != icon_it_end; ++icon_it) { |
671 | renderButton(*(*icon_it)); | 679 | renderButton(*(*icon_it)); |
672 | } | 680 | } |
@@ -690,15 +698,15 @@ void IconbarTool::renderButton(IconButton &button, bool clear, | |||
690 | // button.height() != m_icon_container.back()->height()); | 698 | // button.height() != m_icon_container.back()->height()); |
691 | } | 699 | } |
692 | 700 | ||
693 | if (focusOption == 1 || | 701 | if (focusOption == 1 || |
694 | (focusOption == -1 && | 702 | (focusOption == -1 && |
695 | button.win().isFocused())) { | 703 | button.win().isFocused())) { |
696 | 704 | ||
697 | // focused texture | 705 | // focused texture |
698 | if (button.win().isFocused()) | 706 | if (button.win().isFocused()) |
699 | m_icon_container.setSelected(m_icon_container.find(&button)); | 707 | m_icon_container.setSelected(m_icon_container.find(&button)); |
700 | 708 | ||
701 | button.setGC(m_theme.focusedText().textGC()); | 709 | button.setGC(m_theme.focusedText().textGC()); |
702 | button.setFont(m_theme.focusedText().font()); | 710 | button.setFont(m_theme.focusedText().font()); |
703 | button.setJustify(m_theme.focusedText().justify()); | 711 | button.setJustify(m_theme.focusedText().justify()); |
704 | button.setBorderWidth(m_theme.focusedBorder().width()); | 712 | button.setBorderWidth(m_theme.focusedBorder().width()); |
@@ -709,7 +717,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear, | |||
709 | else if (wider_button && m_focused_err_pm != 0) | 717 | else if (wider_button && m_focused_err_pm != 0) |
710 | button.setBackgroundPixmap(m_focused_err_pm); | 718 | button.setBackgroundPixmap(m_focused_err_pm); |
711 | else | 719 | else |
712 | button.setBackgroundColor(m_theme.focusedTexture().color()); | 720 | button.setBackgroundColor(m_theme.focusedTexture().color()); |
713 | 721 | ||
714 | } else { // unfocused | 722 | } else { // unfocused |
715 | if (m_icon_container.selected() == &button) | 723 | if (m_icon_container.selected() == &button) |
@@ -755,7 +763,7 @@ void IconbarTool::removeWindow(FluxboxWindow &win) { | |||
755 | } | 763 | } |
756 | #ifdef DEBUG | 764 | #ifdef DEBUG |
757 | cerr<<"IconbarTool::"<<__FUNCTION__<<"( 0x"<<&win<<" title = "<<win.title()<<") found!"<<endl; | 765 | cerr<<"IconbarTool::"<<__FUNCTION__<<"( 0x"<<&win<<" title = "<<win.title()<<") found!"<<endl; |
758 | #endif // DEBUG | 766 | #endif // DEBUG |
759 | // detach from all signals | 767 | // detach from all signals |
760 | win.focusSig().detach(this); | 768 | win.focusSig().detach(this); |
761 | win.dieSig().detach(this); | 769 | win.dieSig().detach(this); |
@@ -781,16 +789,16 @@ void IconbarTool::addWindow(FluxboxWindow &win) { | |||
781 | #ifdef DEBUG | 789 | #ifdef DEBUG |
782 | cerr<<"IconbarTool::addWindow(0x"<<&win<<" title = "<<win.title()<<")"<<endl; | 790 | cerr<<"IconbarTool::addWindow(0x"<<&win<<" title = "<<win.title()<<")"<<endl; |
783 | #endif // DEBUG | 791 | #endif // DEBUG |
784 | IconButton *button = new IconButton(*this, | 792 | IconButton *button = new IconButton(*this, |
785 | m_icon_container, | 793 | m_icon_container, |
786 | m_theme.focusedText().font(), | 794 | m_theme.focusedText().font(), |
787 | win); | 795 | win); |
788 | 796 | ||
789 | 797 | ||
790 | button->setTextPadding(*m_rc_client_padding); | 798 | button->setTextPadding(*m_rc_client_padding); |
791 | 799 | ||
792 | renderButton(*button, false); // update the attributes, but don't clear it | 800 | renderButton(*button, false); // update the attributes, but don't clear it |
793 | m_icon_container.insertItem(button); | 801 | m_icon_container.insertItem(button); |
794 | m_icon_list.push_back(button); | 802 | m_icon_list.push_back(button); |
795 | 803 | ||
796 | // dont forget to detach signal in removeWindow | 804 | // dont forget to detach signal in removeWindow |
@@ -802,10 +810,10 @@ void IconbarTool::addWindow(FluxboxWindow &win) { | |||
802 | } | 810 | } |
803 | 811 | ||
804 | void IconbarTool::updateList() { | 812 | void IconbarTool::updateList() { |
805 | std::list<WinClient *> ordered_list = | 813 | list<WinClient *> ordered_list = |
806 | m_screen.focusControl().creationOrderList(); | 814 | m_screen.focusControl().creationOrderList(); |
807 | std::list<WinClient *>::iterator it = ordered_list.begin(); | 815 | list<WinClient *>::iterator it = ordered_list.begin(); |
808 | std::list<WinClient *>::iterator it_end = ordered_list.end(); | 816 | list<WinClient *>::iterator it_end = ordered_list.end(); |
809 | for (; it != it_end; ++it) { | 817 | for (; it != it_end; ++it) { |
810 | if ((*it)->fbwindow() && checkAddWindow(mode(), *(*it)->fbwindow()) && | 818 | if ((*it)->fbwindow() && checkAddWindow(mode(), *(*it)->fbwindow()) && |
811 | !checkDuplicate(*(*it)->fbwindow())) | 819 | !checkDuplicate(*(*it)->fbwindow())) |