diff options
author | simonb <simonb> | 2006-04-17 13:35:20 (GMT) |
---|---|---|
committer | simonb <simonb> | 2006-04-17 13:35:20 (GMT) |
commit | 9ff23f01ca0a0a6c83a3a5e5d933fffbb59dfab8 (patch) | |
tree | 5fdb90654a54c93b653e6ce8d2f7f9452e146367 | |
parent | c5b67f9a42731e5841bfd40e41268ed308225b30 (diff) | |
download | fluxbox-9ff23f01ca0a0a6c83a3a5e5d933fffbb59dfab8.zip fluxbox-9ff23f01ca0a0a6c83a3a5e5d933fffbb59dfab8.tar.bz2 |
fix some rotation issues
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/FbTk/TextButton.cc | 2 | ||||
-rw-r--r-- | src/IconbarTool.cc | 24 | ||||
-rw-r--r-- | src/Toolbar.cc | 35 |
4 files changed, 25 insertions, 38 deletions
@@ -1,6 +1,8 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 0.9.16: | 2 | Changes for 0.9.16: |
3 | *06/04/17: | 3 | *06/04/17: |
4 | * Fix some rotated toolbar+textbutton issues (Simon) | ||
5 | Toolbar.cc IconbarTool.cc FbTk/TextButton.cc | ||
4 | * Fix /bin/sh portability for fbsetbg and startfluxbox (Simon) | 6 | * Fix /bin/sh portability for fbsetbg and startfluxbox (Simon) |
5 | (fluxbox-generate_menu is seriously broken wrt portability | 7 | (fluxbox-generate_menu is seriously broken wrt portability |
6 | atm though :-/) | 8 | atm though :-/) |
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc index 6bcb0e7..054995a 100644 --- a/src/FbTk/TextButton.cc +++ b/src/FbTk/TextButton.cc | |||
@@ -76,6 +76,8 @@ bool TextButton::setOrientation(FbTk::Orientation orient) { | |||
76 | } else { | 76 | } else { |
77 | m_orientation = orient; | 77 | m_orientation = orient; |
78 | } | 78 | } |
79 | updateBackground(false); | ||
80 | clear(); | ||
79 | return true; | 81 | return true; |
80 | } | 82 | } |
81 | 83 | ||
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index f49a1fe..e2eede4 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc | |||
@@ -701,12 +701,16 @@ void IconbarTool::renderTheme() { | |||
701 | Pixmap tmp = m_focused_pm; | 701 | Pixmap tmp = m_focused_pm; |
702 | Pixmap err_tmp = m_focused_err_pm; | 702 | Pixmap err_tmp = m_focused_err_pm; |
703 | unsigned int icon_width, icon_height; | 703 | unsigned int icon_width, icon_height; |
704 | unsigned int icon_width_off=0, icon_height_off=0; | ||
705 | |||
704 | if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180) { | 706 | if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180) { |
705 | icon_width = m_icon_container.maxWidthPerClient(); | 707 | icon_width = m_icon_container.maxWidthPerClient(); |
706 | icon_height = m_icon_container.height(); | 708 | icon_height = m_icon_container.height(); |
709 | icon_width_off = 1; | ||
707 | } else { | 710 | } else { |
708 | icon_width = m_icon_container.width(); | 711 | icon_width = m_icon_container.width(); |
709 | icon_height = m_icon_container.maxWidthPerClient(); | 712 | icon_height = m_icon_container.maxWidthPerClient(); |
713 | icon_height_off = 1; | ||
710 | } | 714 | } |
711 | 715 | ||
712 | if (!m_theme.focusedTexture().usePixmap()) { | 716 | if (!m_theme.focusedTexture().usePixmap()) { |
@@ -716,8 +720,8 @@ void IconbarTool::renderTheme() { | |||
716 | m_focused_pm = m_screen.imageControl().renderImage(icon_width, | 720 | m_focused_pm = m_screen.imageControl().renderImage(icon_width, |
717 | icon_height, | 721 | icon_height, |
718 | m_theme.focusedTexture(), orientation()); | 722 | m_theme.focusedTexture(), orientation()); |
719 | m_focused_err_pm = m_screen.imageControl().renderImage(icon_width+1, | 723 | m_focused_err_pm = m_screen.imageControl().renderImage(icon_width+icon_width_off, |
720 | icon_height, | 724 | icon_height+icon_height_off, |
721 | m_theme.focusedTexture(), orientation()); | 725 | m_theme.focusedTexture(), orientation()); |
722 | } | 726 | } |
723 | 727 | ||
@@ -736,8 +740,8 @@ void IconbarTool::renderTheme() { | |||
736 | m_unfocused_pm = m_screen.imageControl().renderImage(icon_width, | 740 | m_unfocused_pm = m_screen.imageControl().renderImage(icon_width, |
737 | icon_height, | 741 | icon_height, |
738 | m_theme.unfocusedTexture(), orientation()); | 742 | m_theme.unfocusedTexture(), orientation()); |
739 | m_unfocused_err_pm = m_screen.imageControl().renderImage(icon_width+1, | 743 | m_unfocused_err_pm = m_screen.imageControl().renderImage(icon_width+icon_width_off, |
740 | icon_height, | 744 | icon_height+icon_height_off, |
741 | m_theme.unfocusedTexture(), orientation()); | 745 | m_theme.unfocusedTexture(), orientation()); |
742 | } | 746 | } |
743 | if (tmp) | 747 | if (tmp) |
@@ -780,9 +784,15 @@ void IconbarTool::renderButton(IconButton &button, bool clear) { | |||
780 | 784 | ||
781 | // The last button is always the regular width | 785 | // The last button is always the regular width |
782 | bool wider_button = false; | 786 | bool wider_button = false; |
783 | if (!m_icon_container.empty()) | 787 | if (!m_icon_container.empty()) { |
784 | wider_button = (button.width() != m_icon_container.back()->width() || // height to cover both orients | 788 | if (button.orientation() == FbTk::ROT0 || button.orientation() == FbTk::ROT180) |
785 | button.height() != m_icon_container.back()->height()); | 789 | wider_button = button.width() != m_icon_container.back()->width(); |
790 | else | ||
791 | wider_button = button.height() != m_icon_container.back()->height(); | ||
792 | // wider_button = (button.width() != m_icon_container.maxWidthPerClient() || // height to cover both orients | ||
793 | |||
794 | // button.height() != m_icon_container.back()->height()); | ||
795 | } | ||
786 | 796 | ||
787 | if (button.win().isFocused()) { // focused texture | 797 | if (button.win().isFocused()) { // focused texture |
788 | m_icon_container.setSelected(m_icon_container.find(&button)); | 798 | m_icon_container.setSelected(m_icon_container.find(&button)); |
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 84a6afb..0a9461a 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -609,21 +609,6 @@ void Toolbar::update(FbTk::Subject *subj) { | |||
609 | void Toolbar::setPlacement(Toolbar::Placement where) { | 609 | void Toolbar::setPlacement(Toolbar::Placement where) { |
610 | // disable vertical toolbar | 610 | // disable vertical toolbar |
611 | 611 | ||
612 | /* | ||
613 | switch (where) { | ||
614 | case LEFTTOP: | ||
615 | case LEFTCENTER: | ||
616 | case LEFTBOTTOM: | ||
617 | case RIGHTTOP: | ||
618 | case RIGHTCENTER: | ||
619 | case RIGHTBOTTOM: | ||
620 | where = BOTTOMCENTER; | ||
621 | break; | ||
622 | default: | ||
623 | break; | ||
624 | } | ||
625 | */ | ||
626 | |||
627 | *m_rc_placement = where; | 612 | *m_rc_placement = where; |
628 | int head_x = 0, | 613 | int head_x = 0, |
629 | head_y = 0, | 614 | head_y = 0, |
@@ -638,10 +623,6 @@ void Toolbar::setPlacement(Toolbar::Placement where) { | |||
638 | head_h = screen().getHeadHeight(head); | 623 | head_h = screen().getHeadHeight(head); |
639 | } | 624 | } |
640 | 625 | ||
641 | FbTk::Orientation was_orient = FbTk::ROT0; | ||
642 | if (!m_item_list.empty()) | ||
643 | was_orient = m_item_list.front()->orientation(); // all save orient (for rendering) | ||
644 | |||
645 | int bevel_width = theme().bevelWidth(); | 626 | int bevel_width = theme().bevelWidth(); |
646 | int border_width = theme().border().width(); | 627 | int border_width = theme().border().width(); |
647 | 628 | ||
@@ -784,18 +765,10 @@ void Toolbar::setPlacement(Toolbar::Placement where) { | |||
784 | break; | 765 | break; |
785 | } | 766 | } |
786 | 767 | ||
787 | if (was_orient != orient) { | 768 | ItemList::iterator item_it = m_item_list.begin(); |
788 | // hide for all this moving around | 769 | ItemList::iterator item_it_end = m_item_list.end(); |
789 | if (*m_rc_visible) | 770 | for (; item_it != item_it_end; ++item_it) |
790 | frame.window.hide(); | 771 | (*item_it)->setOrientation(orient); |
791 | ItemList::iterator item_it = m_item_list.begin(); | ||
792 | ItemList::iterator item_it_end = m_item_list.end(); | ||
793 | for (; item_it != item_it_end; ++item_it) { | ||
794 | (*item_it)->setOrientation(orient); | ||
795 | } | ||
796 | if (*m_rc_visible) | ||
797 | frame.window.show(); | ||
798 | } | ||
799 | } | 772 | } |
800 | 773 | ||
801 | void Toolbar::updateVisibleState() { | 774 | void Toolbar::updateVisibleState() { |