summaryrefslogtreecommitdiff
path: root/src/IconbarTool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r--src/IconbarTool.cc35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index 3c219e7..1067e0b 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -695,17 +695,25 @@ void IconbarTool::renderTheme() {
695 695
696 Pixmap tmp = m_focused_pm; 696 Pixmap tmp = m_focused_pm;
697 Pixmap err_tmp = m_focused_err_pm; 697 Pixmap err_tmp = m_focused_err_pm;
698 unsigned int icon_width = m_icon_container.maxWidthPerClient(); 698 unsigned int icon_width, icon_height;
699 if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180) {
700 icon_width = m_icon_container.maxWidthPerClient();
701 icon_height = m_icon_container.height();
702 } else {
703 icon_width = m_icon_container.width();
704 icon_height = m_icon_container.maxWidthPerClient();
705 }
706
699 if (!m_theme.focusedTexture().usePixmap()) { 707 if (!m_theme.focusedTexture().usePixmap()) {
700 m_focused_pm = 0; 708 m_focused_pm = 0;
701 m_focused_err_pm = 0; 709 m_focused_err_pm = 0;
702 } else { 710 } else {
703 m_focused_pm = m_screen.imageControl().renderImage(icon_width, 711 m_focused_pm = m_screen.imageControl().renderImage(icon_width,
704 m_icon_container.height(), 712 icon_height,
705 m_theme.focusedTexture()); 713 m_theme.focusedTexture(), orientation());
706 m_focused_err_pm = m_screen.imageControl().renderImage(icon_width+1, 714 m_focused_err_pm = m_screen.imageControl().renderImage(icon_width+1,
707 m_icon_container.height(), 715 icon_height,
708 m_theme.focusedTexture()); 716 m_theme.focusedTexture(), orientation());
709 } 717 }
710 718
711 if (tmp) 719 if (tmp)
@@ -721,11 +729,11 @@ void IconbarTool::renderTheme() {
721 m_unfocused_err_pm = 0; 729 m_unfocused_err_pm = 0;
722 } else { 730 } else {
723 m_unfocused_pm = m_screen.imageControl().renderImage(icon_width, 731 m_unfocused_pm = m_screen.imageControl().renderImage(icon_width,
724 m_icon_container.height(), 732 icon_height,
725 m_theme.unfocusedTexture()); 733 m_theme.unfocusedTexture(), orientation());
726 m_unfocused_err_pm = m_screen.imageControl().renderImage(icon_width+1, 734 m_unfocused_err_pm = m_screen.imageControl().renderImage(icon_width+1,
727 m_icon_container.height(), 735 icon_height,
728 m_theme.unfocusedTexture()); 736 m_theme.unfocusedTexture(), orientation());
729 } 737 }
730 if (tmp) 738 if (tmp)
731 m_screen.imageControl().removeImage(tmp); 739 m_screen.imageControl().removeImage(tmp);
@@ -740,7 +748,7 @@ void IconbarTool::renderTheme() {
740 } else { 748 } else {
741 m_empty_pm = m_screen.imageControl().renderImage(m_icon_container.width(), 749 m_empty_pm = m_screen.imageControl().renderImage(m_icon_container.width(),
742 m_icon_container.height(), 750 m_icon_container.height(),
743 m_theme.emptyTexture()); 751 m_theme.emptyTexture(), orientation());
744 m_icon_container.setBackgroundPixmap(m_empty_pm); 752 m_icon_container.setBackgroundPixmap(m_empty_pm);
745 } 753 }
746 754
@@ -768,7 +776,8 @@ void IconbarTool::renderButton(IconButton &button, bool clear) {
768 // The last button is always the regular width 776 // The last button is always the regular width
769 bool wider_button = false; 777 bool wider_button = false;
770 if (!m_icon_container.empty()) 778 if (!m_icon_container.empty())
771 wider_button = (button.width() != m_icon_container.back()->width()); 779 wider_button = (button.width() != m_icon_container.back()->width() || // height to cover both orients
780 button.height() != m_icon_container.back()->height());
772 781
773 if (button.win().isFocused()) { // focused texture 782 if (button.win().isFocused()) { // focused texture
774 m_icon_container.setSelected(m_icon_container.find(&button)); 783 m_icon_container.setSelected(m_icon_container.find(&button));
@@ -968,3 +977,7 @@ void IconbarTool::timedRender() {
968 renderButton(*current_button); 977 renderButton(*current_button);
969} 978}
970 979
980void IconbarTool::setOrientation(FbTk::Orientation orient) {
981 m_icon_container.setOrientation(orient);
982 ToolbarItem::setOrientation(orient);
983}