diff options
author | rathnor <rathnor> | 2004-08-29 12:33:55 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2004-08-29 12:33:55 (GMT) |
commit | 92dc8d745214ac4f8c81bbad6d529a19fb4fe46c (patch) | |
tree | 723892acb509d69beec5b3fb875469fa321c778d | |
parent | 4d01d1b748a99f1380a582874ab46e900fc7eca2 (diff) | |
download | fluxbox_pavel-92dc8d745214ac4f8c81bbad6d529a19fb4fe46c.zip fluxbox_pavel-92dc8d745214ac4f8c81bbad6d529a19fb4fe46c.tar.bz2 |
fix toolbar localtion (visible when 100%)
fix menu font size when no style
-rw-r--r-- | src/FbTk/MenuTheme.cc | 6 | ||||
-rw-r--r-- | src/Toolbar.cc | 18 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/FbTk/MenuTheme.cc b/src/FbTk/MenuTheme.cc index 18861ab..4d04e17 100644 --- a/src/FbTk/MenuTheme.cc +++ b/src/FbTk/MenuTheme.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: MenuTheme.cc,v 1.18 2004/06/13 12:01:15 fluxgen Exp $ | 22 | // $Id: MenuTheme.cc,v 1.19 2004/08/29 12:33:55 rathnor Exp $ |
23 | 23 | ||
24 | #include "MenuTheme.hh" | 24 | #include "MenuTheme.hh" |
25 | 25 | ||
@@ -70,6 +70,10 @@ MenuTheme::MenuTheme(int screen_num): | |||
70 | m_real_title_height(*m_title_height), | 70 | m_real_title_height(*m_title_height), |
71 | m_real_item_height(*m_item_height) | 71 | m_real_item_height(*m_item_height) |
72 | { | 72 | { |
73 | m_real_item_height = std::max(*m_item_height, frameFont().height() + 2*bevelWidth()); | ||
74 | m_real_title_height = std::max(*m_title_height, | ||
75 | titleFont().height() + 2*bevelWidth()); | ||
76 | |||
73 | m_real_item_height = m_real_item_height == 0 ? 1 : m_real_item_height; | 77 | m_real_item_height = m_real_item_height == 0 ? 1 : m_real_item_height; |
74 | m_real_title_height = m_real_title_height == 0 ? 1 : m_real_title_height; | 78 | m_real_title_height = m_real_title_height == 0 ? 1 : m_real_title_height; |
75 | 79 | ||
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 1be10e2..97dfea3 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Toolbar.cc,v 1.149 2004/08/29 08:33:12 rathnor Exp $ | 25 | // $Id: Toolbar.cc,v 1.150 2004/08/29 12:33:53 rathnor Exp $ |
26 | 26 | ||
27 | #include "Toolbar.hh" | 27 | #include "Toolbar.hh" |
28 | 28 | ||
@@ -609,7 +609,10 @@ void Toolbar::setPlacement(Toolbar::Placement where) { | |||
609 | head_h = screen().getHeadHeight(head); | 609 | head_h = screen().getHeadHeight(head); |
610 | } | 610 | } |
611 | 611 | ||
612 | frame.width = head_w * (*m_rc_width_percent) / 100; | 612 | int bevel_width = theme().bevelWidth(); |
613 | int border_width = theme().border().width(); | ||
614 | |||
615 | frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100; | ||
613 | //!! TODO: change this | 616 | //!! TODO: change this |
614 | // max height of each toolbar items font... | 617 | // max height of each toolbar items font... |
615 | unsigned int max_height = m_tool_factory.maxFontHeight(); | 618 | unsigned int max_height = m_tool_factory.maxFontHeight(); |
@@ -625,9 +628,6 @@ void Toolbar::setPlacement(Toolbar::Placement where) { | |||
625 | frame.height += 2; | 628 | frame.height += 2; |
626 | frame.height += (frame.bevel_w * 2); | 629 | frame.height += (frame.bevel_w * 2); |
627 | 630 | ||
628 | int bevel_width = theme().bevelWidth(); | ||
629 | int border_width = theme().border().width(); | ||
630 | |||
631 | // should we flipp sizes? | 631 | // should we flipp sizes? |
632 | if (isVertical()) { | 632 | if (isVertical()) { |
633 | frame.width = frame.height; | 633 | frame.width = frame.height; |
@@ -660,7 +660,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) { | |||
660 | break; | 660 | break; |
661 | 661 | ||
662 | case TOPCENTER: | 662 | case TOPCENTER: |
663 | frame.x = head_x + (head_w - frame.width) / 2; | 663 | frame.x = head_x + (head_w - frame.width) / 2 - border_width; |
664 | frame.y = head_y; | 664 | frame.y = head_y; |
665 | frame.x_hidden = frame.x; | 665 | frame.x_hidden = frame.x; |
666 | frame.y_hidden = head_y + bevel_width - border_width - frame.height; | 666 | frame.y_hidden = head_y + bevel_width - border_width - frame.height; |
@@ -686,7 +686,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) { | |||
686 | 686 | ||
687 | case BOTTOMCENTER: // default is BOTTOMCENTER | 687 | case BOTTOMCENTER: // default is BOTTOMCENTER |
688 | default: | 688 | default: |
689 | frame.x = head_x + (head_w - frame.width) / 2; | 689 | frame.x = head_x + (head_w - frame.width) / 2 - border_width; |
690 | frame.y = head_y + head_h - frame.height - border_width*2; | 690 | frame.y = head_y + head_h - frame.height - border_width*2; |
691 | frame.x_hidden = frame.x; | 691 | frame.x_hidden = frame.x; |
692 | frame.y_hidden = head_y + head_h - bevel_width - border_width; | 692 | frame.y_hidden = head_y + head_h - bevel_width - border_width; |
@@ -695,7 +695,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) { | |||
695 | break; | 695 | break; |
696 | case LEFTCENTER: | 696 | case LEFTCENTER: |
697 | frame.x = head_x; | 697 | frame.x = head_x; |
698 | frame.y = head_y + (head_h - frame.height)/2; | 698 | frame.y = head_y + (head_h - frame.height)/2 - border_width; |
699 | frame.x_hidden = frame.x - frame.width + bevel_width + border_width; | 699 | frame.x_hidden = frame.x - frame.width + bevel_width + border_width; |
700 | frame.y_hidden = frame.y; | 700 | frame.y_hidden = frame.y; |
701 | if (m_shape.get()) | 701 | if (m_shape.get()) |
@@ -719,7 +719,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) { | |||
719 | break; | 719 | break; |
720 | case RIGHTCENTER: | 720 | case RIGHTCENTER: |
721 | frame.x = head_x + head_w - frame.width - border_width*2; | 721 | frame.x = head_x + head_w - frame.width - border_width*2; |
722 | frame.y = head_y + (head_h - frame.height)/2; | 722 | frame.y = head_y + (head_h - frame.height)/2 - border_width; |
723 | frame.x_hidden = frame.x + frame.width - bevel_width - border_width; | 723 | frame.x_hidden = frame.x + frame.width - bevel_width - border_width; |
724 | frame.y_hidden = frame.y; | 724 | frame.y_hidden = frame.y; |
725 | if (m_shape.get()) | 725 | if (m_shape.get()) |