diff options
author | fluxgen <fluxgen> | 2004-06-07 21:02:49 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-06-07 21:02:49 (GMT) |
commit | 2bb46b002064f8cd354ff7b06bb602709395a874 (patch) | |
tree | 7479341db419677048a2b25f5bbad8c363ee49f1 /src | |
parent | 8eb2ea889d00a6facba0259883d9d29b0deac2ff (diff) | |
download | fluxbox-2bb46b002064f8cd354ff7b06bb602709395a874.zip fluxbox-2bb46b002064f8cd354ff7b06bb602709395a874.tar.bz2 |
item and title height specified by style
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/MenuTheme.cc | 15 | ||||
-rw-r--r-- | src/FbTk/MenuTheme.hh | 7 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/FbTk/MenuTheme.cc b/src/FbTk/MenuTheme.cc index 95d15d1..fa0977a 100644 --- a/src/FbTk/MenuTheme.cc +++ b/src/FbTk/MenuTheme.cc | |||
@@ -1,5 +1,5 @@ | |||
1 | // MenuTheme.cc for FbTk | 1 | // MenuTheme.cc for FbTk |
2 | // Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) | 2 | // Copyright (c) 2002-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net) |
3 | // | 3 | // |
4 | // Permission is hereby granted, free of charge, to any person obtaining a | 4 | // Permission is hereby granted, free of charge, to any person obtaining a |
5 | // copy of this software and associated documentation files (the "Software"), | 5 | // copy of this software and associated documentation files (the "Software"), |
@@ -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.15 2004/04/26 15:04:37 rathnor Exp $ | 22 | // $Id: MenuTheme.cc,v 1.16 2004/06/07 21:02:49 fluxgen Exp $ |
23 | 23 | ||
24 | #include "MenuTheme.hh" | 24 | #include "MenuTheme.hh" |
25 | 25 | ||
@@ -30,6 +30,7 @@ | |||
30 | #include "StringUtil.hh" | 30 | #include "StringUtil.hh" |
31 | 31 | ||
32 | #include <cstdio> | 32 | #include <cstdio> |
33 | #include <algorithm> | ||
33 | 34 | ||
34 | namespace FbTk { | 35 | namespace FbTk { |
35 | 36 | ||
@@ -48,6 +49,8 @@ MenuTheme::MenuTheme(int screen_num): | |||
48 | titlefont_justify(*this, "menu.title.justify", "Menu.Title.Justify"), | 49 | titlefont_justify(*this, "menu.title.justify", "Menu.Title.Justify"), |
49 | bullet_pos(*this, "menu.bullet.position", "Menu.Bullet.Position"), | 50 | bullet_pos(*this, "menu.bullet.position", "Menu.Bullet.Position"), |
50 | m_bullet(*this, "menu.bullet", "Menu.Bullet"), | 51 | m_bullet(*this, "menu.bullet", "Menu.Bullet"), |
52 | m_title_height(*this, "menu.titleHeight", "Menu.TitleHeight"), | ||
53 | m_item_height(*this, "menu.itemHeight", "Menu.ItemHeight"), | ||
51 | m_border_width(*this, "menu.borderWidth", "Menu.BorderWidth"), | 54 | m_border_width(*this, "menu.borderWidth", "Menu.BorderWidth"), |
52 | m_bevel_width(*this, "menu.bevelWidth", "Menu.BevelWidth"), | 55 | m_bevel_width(*this, "menu.bevelWidth", "Menu.BevelWidth"), |
53 | m_border_color(*this, "menu.borderColor", "Menu.BorderColor"), | 56 | m_border_color(*this, "menu.borderColor", "Menu.BorderColor"), |
@@ -90,9 +93,11 @@ void MenuTheme::reconfigTheme() { | |||
90 | if (*m_border_width > 20) | 93 | if (*m_border_width > 20) |
91 | *m_border_width = 20; | 94 | *m_border_width = 20; |
92 | 95 | ||
93 | m_bullet_pixmap->scale(frameFont().height(), frameFont().height()); | 96 | int item_height = std::max(itemHeight(), frameFont().height() + bevelWidth()); |
94 | m_selected_pixmap->scale(frameFont().height(), frameFont().height()); | 97 | |
95 | m_unselected_pixmap->scale(frameFont().height(), frameFont().height()); | 98 | m_bullet_pixmap->scale(item_height, item_height); |
99 | m_selected_pixmap->scale(item_height, item_height); | ||
100 | m_unselected_pixmap->scale(item_height, item_height); | ||
96 | 101 | ||
97 | t_text_gc.setForeground(*t_text); | 102 | t_text_gc.setForeground(*t_text); |
98 | f_text_gc.setForeground(*f_text); | 103 | f_text_gc.setForeground(*f_text); |
diff --git a/src/FbTk/MenuTheme.hh b/src/FbTk/MenuTheme.hh index dfac7b1..4102552 100644 --- a/src/FbTk/MenuTheme.hh +++ b/src/FbTk/MenuTheme.hh | |||
@@ -1,5 +1,5 @@ | |||
1 | // MenuTheme.hh for FbTk | 1 | // MenuTheme.hh for FbTk |
2 | // Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) | 2 | // Copyright (c) 2002-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net) |
3 | // | 3 | // |
4 | // Permission is hereby granted, free of charge, to any person obtaining a | 4 | // Permission is hereby granted, free of charge, to any person obtaining a |
5 | // copy of this software and associated documentation files (the "Software"), | 5 | // copy of this software and associated documentation files (the "Software"), |
@@ -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.hh,v 1.13 2003/12/17 00:43:22 fluxgen Exp $ | 22 | // $Id: MenuTheme.hh,v 1.14 2004/06/07 21:02:49 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef FBTK_MENUTHEME_HH | 24 | #ifndef FBTK_MENUTHEME_HH |
25 | #define FBTK_MENUTHEME_HH | 25 | #define FBTK_MENUTHEME_HH |
@@ -102,6 +102,8 @@ public: | |||
102 | BulletType bullet() const { return *m_bullet; } | 102 | BulletType bullet() const { return *m_bullet; } |
103 | FbTk::Justify bulletPos() const { return *bullet_pos; } | 103 | FbTk::Justify bulletPos() const { return *bullet_pos; } |
104 | 104 | ||
105 | unsigned int titleHeight() const { return *m_title_height; } | ||
106 | unsigned int itemHeight() const { return *m_item_height; } | ||
105 | unsigned int borderWidth() const { return *m_border_width; } | 107 | unsigned int borderWidth() const { return *m_border_width; } |
106 | unsigned int bevelWidth() const { return *m_bevel_width; } | 108 | unsigned int bevelWidth() const { return *m_bevel_width; } |
107 | 109 | ||
@@ -126,6 +128,7 @@ private: | |||
126 | FbTk::ThemeItem<FbTk::Justify> framefont_justify, titlefont_justify; | 128 | FbTk::ThemeItem<FbTk::Justify> framefont_justify, titlefont_justify; |
127 | FbTk::ThemeItem<FbTk::Justify> bullet_pos; | 129 | FbTk::ThemeItem<FbTk::Justify> bullet_pos; |
128 | FbTk::ThemeItem<BulletType> m_bullet; | 130 | FbTk::ThemeItem<BulletType> m_bullet; |
131 | FbTk::ThemeItem<unsigned int> m_title_height, m_item_height; | ||
129 | FbTk::ThemeItem<unsigned int> m_border_width; | 132 | FbTk::ThemeItem<unsigned int> m_border_width; |
130 | FbTk::ThemeItem<unsigned int> m_bevel_width; | 133 | FbTk::ThemeItem<unsigned int> m_bevel_width; |
131 | FbTk::ThemeItem<FbTk::Color> m_border_color; | 134 | FbTk::ThemeItem<FbTk::Color> m_border_color; |