aboutsummaryrefslogtreecommitdiff
path: root/src/IconbarTool.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-06-16 15:38:19 (GMT)
committerrathnor <rathnor>2004-06-16 15:38:19 (GMT)
commit8f88c1fecb28dc15ecfd2ee210a8e466afe5456c (patch)
tree5adbb44deec68449ee216c10ff047d4446c2a510 /src/IconbarTool.cc
parentdb6e78bba9fbd0e216f0ebbe5d4f55090ca62069 (diff)
downloadfluxbox_pavel-8f88c1fecb28dc15ecfd2ee210a8e466afe5456c.zip
fluxbox_pavel-8f88c1fecb28dc15ecfd2ee210a8e466afe5456c.tar.bz2
toolbar fixes, updates and optimisations
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r--src/IconbarTool.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index 5434696..eaaa0fe 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: IconbarTool.cc,v 1.38 2004/06/07 21:43:02 fluxgen Exp $ 23// $Id: IconbarTool.cc,v 1.39 2004/06/16 15:38:19 rathnor Exp $
24 24
25#include "IconbarTool.hh" 25#include "IconbarTool.hh"
26 26
@@ -436,7 +436,6 @@ void IconbarTool::update(FbTk::Subject *subj) {
436 if (mode() == NONE) { 436 if (mode() == NONE) {
437 if (subj != 0 && typeid(*subj) == typeid(IconbarTheme)) 437 if (subj != 0 && typeid(*subj) == typeid(IconbarTheme))
438 renderTheme(); 438 renderTheme();
439
440 return; 439 return;
441 } 440 }
442 441
@@ -448,7 +447,6 @@ void IconbarTool::update(FbTk::Subject *subj) {
448 // start focus timer, so we can update without flicker 447 // start focus timer, so we can update without flicker
449 m_focus_timer.start(); 448 m_focus_timer.start();
450 449
451 //renderWindow(winsubj->win());
452 return; 450 return;
453 } else if (subj == &(winsubj->win().workspaceSig())) { 451 } else if (subj == &(winsubj->win().workspaceSig())) {
454 // we can ignore this signal if we're in ALLWINDOWS mode 452 // we can ignore this signal if we're in ALLWINDOWS mode
@@ -524,7 +522,9 @@ void IconbarTool::update(FbTk::Subject *subj) {
524 m_icon_container.update(); 522 m_icon_container.update();
525 m_icon_container.showSubwindows(); 523 m_icon_container.showSubwindows();
526 524
527 renderTheme(); 525 // another renderTheme we hopefully shouldn't need? These renders
526 // should be done individually above
527 // renderTheme();
528} 528}
529 529
530IconButton *IconbarTool::findButton(FluxboxWindow &win) { 530IconButton *IconbarTool::findButton(FluxboxWindow &win) {
@@ -613,17 +613,18 @@ void IconbarTool::renderTheme() {
613 if (tmp) 613 if (tmp)
614 m_screen.imageControl().removeImage(tmp); 614 m_screen.imageControl().removeImage(tmp);
615 615
616 m_icon_container.setBorderWidth(m_theme.border().width()); 616 // set to zero so its consistent and not ugly
617 m_icon_container.setBorderColor(m_theme.border().color()); 617 m_icon_container.setBorderWidth(0);
618 m_icon_container.setAlpha(m_theme.alpha()); 618 m_icon_container.setAlpha(m_theme.alpha());
619 619
620 // update buttons 620 // update buttons
621 icon_it = m_icon_list.begin(); 621 icon_it = m_icon_list.begin();
622 for (; icon_it != icon_it_end; ++icon_it) 622 for (; icon_it != icon_it_end; ++icon_it) {
623 renderButton(*(*icon_it)); 623 renderButton(*(*icon_it));
624 }
624} 625}
625 626
626void IconbarTool::renderButton(IconButton &button) { 627void IconbarTool::renderButton(IconButton &button, bool clear) {
627 628
628 button.setPixmap(*m_rc_use_pixmap); 629 button.setPixmap(*m_rc_use_pixmap);
629 button.setAlpha(m_theme.alpha()); 630 button.setAlpha(m_theme.alpha());
@@ -635,6 +636,7 @@ void IconbarTool::renderButton(IconButton &button) {
635 636
636 if (button.win().isFocused()) { // focused texture 637 if (button.win().isFocused()) { // focused texture
637 m_icon_container.setSelected(m_icon_container.find(&button)); 638 m_icon_container.setSelected(m_icon_container.find(&button));
639
638 button.setGC(m_theme.focusedText().textGC()); 640 button.setGC(m_theme.focusedText().textGC());
639 button.setFont(m_theme.focusedText().font()); 641 button.setFont(m_theme.focusedText().font());
640 button.setJustify(m_theme.focusedText().justify()); 642 button.setJustify(m_theme.focusedText().justify());
@@ -646,9 +648,7 @@ void IconbarTool::renderButton(IconButton &button) {
646 else if (wider_button && m_focused_err_pm != 0) 648 else if (wider_button && m_focused_err_pm != 0)
647 button.setBackgroundPixmap(m_focused_err_pm); 649 button.setBackgroundPixmap(m_focused_err_pm);
648 else 650 else
649 button.setBackgroundColor(m_theme.focusedTexture().color()); 651 button.setBackgroundColor(m_theme.focusedTexture().color());
650
651
652 652
653 } else { // unfocused 653 } else { // unfocused
654 if (m_icon_container.selected() == &button) 654 if (m_icon_container.selected() == &button)
@@ -666,11 +666,10 @@ void IconbarTool::renderButton(IconButton &button) {
666 button.setBackgroundPixmap(m_unfocused_err_pm); 666 button.setBackgroundPixmap(m_unfocused_err_pm);
667 else 667 else
668 button.setBackgroundColor(m_theme.unfocusedTexture().color()); 668 button.setBackgroundColor(m_theme.unfocusedTexture().color());
669
670 } 669 }
671 670
672 button.clear(); 671 if (clear)
673 button.updateTransparent(); 672 button.clear(); // the clear also updates transparent
674} 673}
675 674
676void IconbarTool::deleteIcons() { 675void IconbarTool::deleteIcons() {
@@ -717,7 +716,8 @@ void IconbarTool::addWindow(FluxboxWindow &win) {
717 return; 716 return;
718 717
719 IconButton *button = new IconButton(m_icon_container, m_theme.focusedText().font(), win); 718 IconButton *button = new IconButton(m_icon_container, m_theme.focusedText().font(), win);
720 renderButton(*button); 719
720 renderButton(*button, false);
721 m_icon_container.insertItem(button); 721 m_icon_container.insertItem(button);
722 m_icon_list.push_back(button); 722 m_icon_list.push_back(button);
723 723
@@ -809,6 +809,5 @@ void IconbarTool::timedRender() {
809 renderButton(*button); 809 renderButton(*button);
810 if (current_button != 0) 810 if (current_button != 0)
811 renderButton(*current_button); 811 renderButton(*current_button);
812
813} 812}
814 813