From 92dc8d745214ac4f8c81bbad6d529a19fb4fe46c Mon Sep 17 00:00:00 2001 From: rathnor Date: Sun, 29 Aug 2004 12:33:55 +0000 Subject: fix toolbar localtion (visible when 100%) fix menu font size when no style --- src/FbTk/MenuTheme.cc | 6 +++++- 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: MenuTheme.cc,v 1.18 2004/06/13 12:01:15 fluxgen Exp $ +// $Id: MenuTheme.cc,v 1.19 2004/08/29 12:33:55 rathnor Exp $ #include "MenuTheme.hh" @@ -70,6 +70,10 @@ MenuTheme::MenuTheme(int screen_num): m_real_title_height(*m_title_height), m_real_item_height(*m_item_height) { + m_real_item_height = std::max(*m_item_height, frameFont().height() + 2*bevelWidth()); + m_real_title_height = std::max(*m_title_height, + titleFont().height() + 2*bevelWidth()); + m_real_item_height = m_real_item_height == 0 ? 1 : m_real_item_height; m_real_title_height = m_real_title_height == 0 ? 1 : m_real_title_height; 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.149 2004/08/29 08:33:12 rathnor Exp $ +// $Id: Toolbar.cc,v 1.150 2004/08/29 12:33:53 rathnor Exp $ #include "Toolbar.hh" @@ -609,7 +609,10 @@ void Toolbar::setPlacement(Toolbar::Placement where) { head_h = screen().getHeadHeight(head); } - frame.width = head_w * (*m_rc_width_percent) / 100; + int bevel_width = theme().bevelWidth(); + int border_width = theme().border().width(); + + frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100; //!! TODO: change this // max height of each toolbar items font... unsigned int max_height = m_tool_factory.maxFontHeight(); @@ -625,9 +628,6 @@ void Toolbar::setPlacement(Toolbar::Placement where) { frame.height += 2; frame.height += (frame.bevel_w * 2); - int bevel_width = theme().bevelWidth(); - int border_width = theme().border().width(); - // should we flipp sizes? if (isVertical()) { frame.width = frame.height; @@ -660,7 +660,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) { break; case TOPCENTER: - frame.x = head_x + (head_w - frame.width) / 2; + frame.x = head_x + (head_w - frame.width) / 2 - border_width; frame.y = head_y; frame.x_hidden = frame.x; frame.y_hidden = head_y + bevel_width - border_width - frame.height; @@ -686,7 +686,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) { case BOTTOMCENTER: // default is BOTTOMCENTER default: - frame.x = head_x + (head_w - frame.width) / 2; + frame.x = head_x + (head_w - frame.width) / 2 - border_width; frame.y = head_y + head_h - frame.height - border_width*2; frame.x_hidden = frame.x; frame.y_hidden = head_y + head_h - bevel_width - border_width; @@ -695,7 +695,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) { break; case LEFTCENTER: frame.x = head_x; - frame.y = head_y + (head_h - frame.height)/2; + frame.y = head_y + (head_h - frame.height)/2 - border_width; frame.x_hidden = frame.x - frame.width + bevel_width + border_width; frame.y_hidden = frame.y; if (m_shape.get()) @@ -719,7 +719,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) { break; case RIGHTCENTER: frame.x = head_x + head_w - frame.width - border_width*2; - frame.y = head_y + (head_h - frame.height)/2; + frame.y = head_y + (head_h - frame.height)/2 - border_width; frame.x_hidden = frame.x + frame.width - bevel_width - border_width; frame.y_hidden = frame.y; if (m_shape.get()) -- cgit v0.11.2