all repos — fluxbox @ 2bb46b002064f8cd354ff7b06bb602709395a874

custom fork of the fluxbox windowmanager

item and title height specified by style
fluxgen fluxgen
commit

2bb46b002064f8cd354ff7b06bb602709395a874

parent

8eb2ea889d00a6facba0259883d9d29b0deac2ff

2 files changed, 15 insertions(+), 7 deletions(-)

jump to
M src/FbTk/MenuTheme.ccsrc/FbTk/MenuTheme.cc

@@ -1,5 +1,5 @@

// MenuTheme.cc for FbTk -// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) +// Copyright (c) 2002-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net) // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"),

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: MenuTheme.cc,v 1.15 2004/04/26 15:04:37 rathnor Exp $ +// $Id: MenuTheme.cc,v 1.16 2004/06/07 21:02:49 fluxgen Exp $ #include "MenuTheme.hh"

@@ -30,6 +30,7 @@ #include "App.hh"

#include "StringUtil.hh" #include <cstdio> +#include <algorithm> namespace FbTk {

@@ -48,6 +49,8 @@ framefont_justify(*this, "menu.frame.justify", "Menu.Frame.Justify"),

titlefont_justify(*this, "menu.title.justify", "Menu.Title.Justify"), bullet_pos(*this, "menu.bullet.position", "Menu.Bullet.Position"), m_bullet(*this, "menu.bullet", "Menu.Bullet"), + m_title_height(*this, "menu.titleHeight", "Menu.TitleHeight"), + m_item_height(*this, "menu.itemHeight", "Menu.ItemHeight"), m_border_width(*this, "menu.borderWidth", "Menu.BorderWidth"), m_bevel_width(*this, "menu.bevelWidth", "Menu.BevelWidth"), m_border_color(*this, "menu.borderColor", "Menu.BorderColor"),

@@ -90,9 +93,11 @@ *m_bevel_width = 20;

if (*m_border_width > 20) *m_border_width = 20; - m_bullet_pixmap->scale(frameFont().height(), frameFont().height()); - m_selected_pixmap->scale(frameFont().height(), frameFont().height()); - m_unselected_pixmap->scale(frameFont().height(), frameFont().height()); + int item_height = std::max(itemHeight(), frameFont().height() + bevelWidth()); + + m_bullet_pixmap->scale(item_height, item_height); + m_selected_pixmap->scale(item_height, item_height); + m_unselected_pixmap->scale(item_height, item_height); t_text_gc.setForeground(*t_text); f_text_gc.setForeground(*f_text);
M src/FbTk/MenuTheme.hhsrc/FbTk/MenuTheme.hh

@@ -1,5 +1,5 @@

// MenuTheme.hh for FbTk -// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) +// Copyright (c) 2002-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net) // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"),

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: MenuTheme.hh,v 1.13 2003/12/17 00:43:22 fluxgen Exp $ +// $Id: MenuTheme.hh,v 1.14 2004/06/07 21:02:49 fluxgen Exp $ #ifndef FBTK_MENUTHEME_HH #define FBTK_MENUTHEME_HH

@@ -102,6 +102,8 @@ ///@}

BulletType bullet() const { return *m_bullet; } FbTk::Justify bulletPos() const { return *bullet_pos; } + unsigned int titleHeight() const { return *m_title_height; } + unsigned int itemHeight() const { return *m_item_height; } unsigned int borderWidth() const { return *m_border_width; } unsigned int bevelWidth() const { return *m_bevel_width; }

@@ -126,6 +128,7 @@ FbTk::ThemeItem<FbTk::Font> titlefont, framefont;

FbTk::ThemeItem<FbTk::Justify> framefont_justify, titlefont_justify; FbTk::ThemeItem<FbTk::Justify> bullet_pos; FbTk::ThemeItem<BulletType> m_bullet; + FbTk::ThemeItem<unsigned int> m_title_height, m_item_height; FbTk::ThemeItem<unsigned int> m_border_width; FbTk::ThemeItem<unsigned int> m_bevel_width; FbTk::ThemeItem<FbTk::Color> m_border_color;