diff options
author | markt <markt> | 2007-04-05 16:05:39 (GMT) |
---|---|---|
committer | markt <markt> | 2007-04-05 16:05:39 (GMT) |
commit | d4f33533543690f12ad9eea62ea9b634a89340fb (patch) | |
tree | cc879e2439ec92172ad75f9eb61d3ae17bff21ae /src/IconbarTool.cc | |
parent | 9d7c562478b553c8f0f71acdfa93bda2f0a5ce5d (diff) | |
download | fluxbox-d4f33533543690f12ad9eea62ea9b634a89340fb.zip fluxbox-d4f33533543690f12ad9eea62ea9b634a89340fb.tar.bz2 |
some minor changes and reorganization
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r-- | src/IconbarTool.cc | 58 |
1 files changed, 3 insertions, 55 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index 42d5782..ef99c9a 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc | |||
@@ -401,10 +401,6 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr | |||
401 | m_screen(screen), | 401 | m_screen(screen), |
402 | m_icon_container(parent), | 402 | m_icon_container(parent), |
403 | m_theme(theme), | 403 | m_theme(theme), |
404 | m_focused_pm( screen.imageControl() ), | ||
405 | m_unfocused_pm( screen.imageControl() ), | ||
406 | m_focused_err_pm( screen.imageControl() ), | ||
407 | m_unfocused_err_pm( screen.imageControl() ), | ||
408 | m_empty_pm( screen.imageControl() ), | 404 | m_empty_pm( screen.imageControl() ), |
409 | m_rc_mode(screen.resourceManager(), WORKSPACE, | 405 | m_rc_mode(screen.resourceManager(), WORKSPACE, |
410 | screen.name() + ".iconbar.mode", screen.altName() + ".Iconbar.Mode"), | 406 | screen.name() + ".iconbar.mode", screen.altName() + ".Iconbar.Mode"), |
@@ -694,32 +690,6 @@ void IconbarTool::renderTheme() { | |||
694 | icon_height_off = 1; | 690 | icon_height_off = 1; |
695 | } | 691 | } |
696 | 692 | ||
697 | if (!m_theme.focusedTexture().usePixmap()) { | ||
698 | m_focused_pm.reset( 0 ); | ||
699 | m_focused_err_pm.reset( 0 ); | ||
700 | } else { | ||
701 | m_focused_pm.reset( m_screen.imageControl(). | ||
702 | renderImage(icon_width, icon_height, | ||
703 | m_theme.focusedTexture(), orientation()) ); | ||
704 | m_focused_err_pm.reset( m_screen.imageControl(). | ||
705 | renderImage(icon_width + icon_width_off, | ||
706 | icon_height + icon_height_off, | ||
707 | m_theme.focusedTexture(), orientation()) ); | ||
708 | } | ||
709 | |||
710 | if (!m_theme.unfocusedTexture().usePixmap()) { | ||
711 | m_unfocused_pm.reset( 0 ); | ||
712 | m_unfocused_err_pm.reset( 0 ); | ||
713 | } else { | ||
714 | m_unfocused_pm.reset( m_screen.imageControl(). | ||
715 | renderImage(icon_width, icon_height, | ||
716 | m_theme.unfocusedTexture(), orientation()) ); | ||
717 | m_unfocused_err_pm.reset( m_screen.imageControl(). | ||
718 | renderImage(icon_width+icon_width_off, | ||
719 | icon_height+icon_height_off, | ||
720 | m_theme.unfocusedTexture(), orientation()) ); | ||
721 | } | ||
722 | |||
723 | // if we dont have any icons then we should render empty texture | 693 | // if we dont have any icons then we should render empty texture |
724 | if (!m_theme.emptyTexture().usePixmap()) { | 694 | if (!m_theme.emptyTexture().usePixmap()) { |
725 | m_empty_pm.reset( 0 ); | 695 | m_empty_pm.reset( 0 ); |
@@ -747,22 +717,11 @@ void IconbarTool::renderTheme() { | |||
747 | void IconbarTool::renderButton(IconButton &button, bool clear, | 717 | void IconbarTool::renderButton(IconButton &button, bool clear, |
748 | int focusOption) { | 718 | int focusOption) { |
749 | 719 | ||
720 | button.renderTextures(); | ||
750 | button.setPixmap(*m_rc_use_pixmap); | 721 | button.setPixmap(*m_rc_use_pixmap); |
751 | button.setAlpha(m_alpha); | 722 | button.setAlpha(m_alpha); |
752 | button.setTextPadding(*m_rc_client_padding); | 723 | button.setTextPadding(*m_rc_client_padding); |
753 | 724 | ||
754 | // The last button is always the regular width | ||
755 | bool wider_button = false; | ||
756 | if (!m_icon_container.empty()) { | ||
757 | if (button.orientation() == FbTk::ROT0 || button.orientation() == FbTk::ROT180) | ||
758 | wider_button = button.width() != m_icon_container.back()->width(); | ||
759 | else | ||
760 | wider_button = button.height() != m_icon_container.back()->height(); | ||
761 | // wider_button = (button.width() != m_icon_container.maxWidthPerClient() || // height to cover both orients | ||
762 | |||
763 | // button.height() != m_icon_container.back()->height()); | ||
764 | } | ||
765 | |||
766 | if (focusOption == 1 || | 725 | if (focusOption == 1 || |
767 | (focusOption == -1 && | 726 | (focusOption == -1 && |
768 | button.win().isFocused())) { | 727 | button.win().isFocused())) { |
@@ -776,13 +735,7 @@ void IconbarTool::renderButton(IconButton &button, bool clear, | |||
776 | button.setJustify(m_theme.focusedText().justify()); | 735 | button.setJustify(m_theme.focusedText().justify()); |
777 | button.setBorderWidth(m_theme.focusedBorder().width()); | 736 | button.setBorderWidth(m_theme.focusedBorder().width()); |
778 | button.setBorderColor(m_theme.focusedBorder().color()); | 737 | button.setBorderColor(m_theme.focusedBorder().color()); |
779 | 738 | button.updateBackground(); | |
780 | if (!wider_button && m_focused_pm != 0) | ||
781 | button.setBackgroundPixmap(m_focused_pm); | ||
782 | else if (wider_button && m_focused_err_pm != 0) | ||
783 | button.setBackgroundPixmap(m_focused_err_pm); | ||
784 | else | ||
785 | button.setBackgroundColor(m_theme.focusedTexture().color()); | ||
786 | 739 | ||
787 | } else { // unfocused | 740 | } else { // unfocused |
788 | if (m_icon_container.selected() == &button) | 741 | if (m_icon_container.selected() == &button) |
@@ -793,13 +746,8 @@ void IconbarTool::renderButton(IconButton &button, bool clear, | |||
793 | button.setJustify(m_theme.unfocusedText().justify()); | 746 | button.setJustify(m_theme.unfocusedText().justify()); |
794 | button.setBorderWidth(m_theme.unfocusedBorder().width()); | 747 | button.setBorderWidth(m_theme.unfocusedBorder().width()); |
795 | button.setBorderColor(m_theme.unfocusedBorder().color()); | 748 | button.setBorderColor(m_theme.unfocusedBorder().color()); |
749 | button.updateBackground(); | ||
796 | 750 | ||
797 | if (!wider_button && m_unfocused_pm != 0) | ||
798 | button.setBackgroundPixmap(m_unfocused_pm); | ||
799 | else if (wider_button && m_unfocused_err_pm != 0) | ||
800 | button.setBackgroundPixmap(m_unfocused_err_pm); | ||
801 | else | ||
802 | button.setBackgroundColor(m_theme.unfocusedTexture().color()); | ||
803 | } | 751 | } |
804 | 752 | ||
805 | if (clear) | 753 | if (clear) |