diff options
author | fluxgen <fluxgen> | 2004-01-14 23:06:13 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-01-14 23:06:13 (GMT) |
commit | b9e375bca0ae3ae95eb6b2ff4408d3148a9ffce1 (patch) | |
tree | b14f3167eda8465122daa591a1eac9d5e020b7af /src | |
parent | f305b77709cf0d1253b389af414efed756466621 (diff) | |
download | fluxbox_lack-b9e375bca0ae3ae95eb6b2ff4408d3148a9ffce1.zip fluxbox_lack-b9e375bca0ae3ae95eb6b2ff4408d3148a9ffce1.tar.bz2 |
set border width on buttons before we render textures for them so we get the right texture size
Diffstat (limited to 'src')
-rw-r--r-- | src/IconbarTool.cc | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index 79ed89b..c367296 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.29 2004/01/13 14:41:32 rathnor Exp $ | 23 | // $Id: IconbarTool.cc,v 1.30 2004/01/14 23:06:13 fluxgen Exp $ |
24 | 24 | ||
25 | #include "IconbarTool.hh" | 25 | #include "IconbarTool.hh" |
26 | 26 | ||
@@ -519,7 +519,19 @@ void IconbarTool::renderWindow(FluxboxWindow &win) { | |||
519 | renderButton(*button); | 519 | renderButton(*button); |
520 | } | 520 | } |
521 | 521 | ||
522 | |||
522 | void IconbarTool::renderTheme() { | 523 | void IconbarTool::renderTheme() { |
524 | |||
525 | // update button sizes before we get max width per client! | ||
526 | IconList::iterator icon_it = m_icon_list.begin(); | ||
527 | const IconList::iterator icon_it_end = m_icon_list.end(); | ||
528 | for (; icon_it != icon_it_end; ++icon_it) { | ||
529 | if ((*icon_it)->win().isFocused()) | ||
530 | (*icon_it)->setBorderWidth(m_theme.focusedBorder().width()); | ||
531 | else // unfocused | ||
532 | (*icon_it)->setBorderWidth(m_theme.unfocusedBorder().width()); | ||
533 | } | ||
534 | |||
523 | Pixmap tmp = m_focused_pm; | 535 | Pixmap tmp = m_focused_pm; |
524 | Pixmap err_tmp = m_focused_err_pm; | 536 | Pixmap err_tmp = m_focused_err_pm; |
525 | unsigned int icon_width = m_icon_container.maxWidthPerClient(); | 537 | unsigned int icon_width = m_icon_container.maxWidthPerClient(); |
@@ -531,8 +543,8 @@ void IconbarTool::renderTheme() { | |||
531 | m_icon_container.height(), | 543 | m_icon_container.height(), |
532 | m_theme.focusedTexture()); | 544 | m_theme.focusedTexture()); |
533 | m_focused_err_pm = m_screen.imageControl().renderImage(icon_width+1, | 545 | m_focused_err_pm = m_screen.imageControl().renderImage(icon_width+1, |
534 | m_icon_container.height(), | 546 | m_icon_container.height(), |
535 | m_theme.focusedTexture()); | 547 | m_theme.focusedTexture()); |
536 | } | 548 | } |
537 | 549 | ||
538 | if (tmp) | 550 | if (tmp) |
@@ -579,8 +591,7 @@ void IconbarTool::renderTheme() { | |||
579 | m_icon_container.setAlpha(m_theme.alpha()); | 591 | m_icon_container.setAlpha(m_theme.alpha()); |
580 | 592 | ||
581 | // update buttons | 593 | // update buttons |
582 | IconList::iterator icon_it = m_icon_list.begin(); | 594 | icon_it = m_icon_list.begin(); |
583 | IconList::iterator icon_it_end = m_icon_list.end(); | ||
584 | for (; icon_it != icon_it_end; ++icon_it) | 595 | for (; icon_it != icon_it_end; ++icon_it) |
585 | renderButton(*(*icon_it)); | 596 | renderButton(*(*icon_it)); |
586 | } | 597 | } |
@@ -599,6 +610,8 @@ void IconbarTool::renderButton(IconButton &button) { | |||
599 | button.setGC(m_theme.focusedText().textGC()); | 610 | button.setGC(m_theme.focusedText().textGC()); |
600 | button.setFont(m_theme.focusedText().font()); | 611 | button.setFont(m_theme.focusedText().font()); |
601 | button.setJustify(m_theme.focusedText().justify()); | 612 | button.setJustify(m_theme.focusedText().justify()); |
613 | button.setBorderWidth(m_theme.focusedBorder().width()); | ||
614 | button.setBorderColor(m_theme.focusedBorder().color()); | ||
602 | 615 | ||
603 | if (!wider_button && m_focused_pm != 0) | 616 | if (!wider_button && m_focused_pm != 0) |
604 | button.setBackgroundPixmap(m_focused_pm); | 617 | button.setBackgroundPixmap(m_focused_pm); |
@@ -607,8 +620,7 @@ void IconbarTool::renderButton(IconButton &button) { | |||
607 | else | 620 | else |
608 | button.setBackgroundColor(m_theme.focusedTexture().color()); | 621 | button.setBackgroundColor(m_theme.focusedTexture().color()); |
609 | 622 | ||
610 | button.setBorderWidth(m_theme.focusedBorder().width()); | 623 | |
611 | button.setBorderColor(m_theme.focusedBorder().color()); | ||
612 | 624 | ||
613 | } else { // unfocused | 625 | } else { // unfocused |
614 | if (m_icon_container.selected() == &button) | 626 | if (m_icon_container.selected() == &button) |
@@ -617,6 +629,8 @@ void IconbarTool::renderButton(IconButton &button) { | |||
617 | button.setGC(m_theme.unfocusedText().textGC()); | 629 | button.setGC(m_theme.unfocusedText().textGC()); |
618 | button.setFont(m_theme.unfocusedText().font()); | 630 | button.setFont(m_theme.unfocusedText().font()); |
619 | button.setJustify(m_theme.unfocusedText().justify()); | 631 | button.setJustify(m_theme.unfocusedText().justify()); |
632 | button.setBorderWidth(m_theme.unfocusedBorder().width()); | ||
633 | button.setBorderColor(m_theme.unfocusedBorder().color()); | ||
620 | 634 | ||
621 | if (!wider_button && m_unfocused_pm != 0) | 635 | if (!wider_button && m_unfocused_pm != 0) |
622 | button.setBackgroundPixmap(m_unfocused_pm); | 636 | button.setBackgroundPixmap(m_unfocused_pm); |
@@ -625,8 +639,6 @@ void IconbarTool::renderButton(IconButton &button) { | |||
625 | else | 639 | else |
626 | button.setBackgroundColor(m_theme.unfocusedTexture().color()); | 640 | button.setBackgroundColor(m_theme.unfocusedTexture().color()); |
627 | 641 | ||
628 | button.setBorderWidth(m_theme.unfocusedBorder().width()); | ||
629 | button.setBorderColor(m_theme.unfocusedBorder().color()); | ||
630 | } | 642 | } |
631 | 643 | ||
632 | button.clear(); | 644 | button.clear(); |