aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-06-13 10:59:54 (GMT)
committerfluxgen <fluxgen>2004-06-13 10:59:54 (GMT)
commit05a1b55901faaec99647e1b64ca78e72acce5c2e (patch)
tree1cf802ee6499b5e02a2b66ed7c2cdb60558a991c /src/FbTk
parent825c02ccb0690e7867d7ed92549a17050de6a7e5 (diff)
downloadfluxbox_paul-05a1b55901faaec99647e1b64ca78e72acce5c2e.zip
fluxbox_paul-05a1b55901faaec99647e1b64ca78e72acce5c2e.tar.bz2
minor fix for title and item height
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/MenuTheme.cc17
-rw-r--r--src/FbTk/MenuTheme.hh9
2 files changed, 15 insertions, 11 deletions
diff --git a/src/FbTk/MenuTheme.cc b/src/FbTk/MenuTheme.cc
index fa0977a..ebee2e5 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.16 2004/06/07 21:02:49 fluxgen Exp $ 22// $Id: MenuTheme.cc,v 1.17 2004/06/13 10:59:54 fluxgen Exp $
23 23
24#include "MenuTheme.hh" 24#include "MenuTheme.hh"
25 25
@@ -66,9 +66,10 @@ MenuTheme::MenuTheme(int screen_num):
66 m_alpha(255), 66 m_alpha(255),
67 m_menumode(DELAY_OPEN), 67 m_menumode(DELAY_OPEN),
68 m_delayopen(0), // no delay as default 68 m_delayopen(0), // no delay as default
69 m_delayclose(0) // no delay as default 69 m_delayclose(0), // no delay as default
70 m_real_title_height(*m_title_height),
71 m_real_item_height(*m_item_height)
70{ 72{
71
72 // set default values 73 // set default values
73 *m_border_width = 0; 74 *m_border_width = 0;
74 *m_bevel_width = 0; 75 *m_bevel_width = 0;
@@ -93,11 +94,13 @@ void MenuTheme::reconfigTheme() {
93 if (*m_border_width > 20) 94 if (*m_border_width > 20)
94 *m_border_width = 20; 95 *m_border_width = 20;
95 96
96 int item_height = std::max(itemHeight(), frameFont().height() + bevelWidth()); 97 m_real_item_height = std::max(*m_item_height, frameFont().height() + 2*bevelWidth());
98 m_real_title_height = std::max(*m_title_height,
99 titleFont().height() + 2*bevelWidth());
97 100
98 m_bullet_pixmap->scale(item_height, item_height); 101 m_bullet_pixmap->scale(itemHeight(), itemHeight());
99 m_selected_pixmap->scale(item_height, item_height); 102 m_selected_pixmap->scale(itemHeight(), itemHeight());
100 m_unselected_pixmap->scale(item_height, item_height); 103 m_unselected_pixmap->scale(itemHeight(), itemHeight());
101 104
102 t_text_gc.setForeground(*t_text); 105 t_text_gc.setForeground(*t_text);
103 f_text_gc.setForeground(*f_text); 106 f_text_gc.setForeground(*f_text);
diff --git a/src/FbTk/MenuTheme.hh b/src/FbTk/MenuTheme.hh
index 174e0b5..010e694 100644
--- a/src/FbTk/MenuTheme.hh
+++ b/src/FbTk/MenuTheme.hh
@@ -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.15 2004/06/13 00:33:06 fluxgen Exp $ 22// $Id: MenuTheme.hh,v 1.16 2004/06/13 10:59:24 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,8 +102,8 @@ public:
102 inline BulletType bullet() const { return *m_bullet; } 102 inline BulletType bullet() const { return *m_bullet; }
103 inline FbTk::Justify bulletPos() const { return *bullet_pos; } 103 inline FbTk::Justify bulletPos() const { return *bullet_pos; }
104 104
105 inline unsigned int titleHeight() const { return *m_title_height; } 105 inline unsigned int titleHeight() const { return m_real_title_height; }
106 inline unsigned int itemHeight() const { return *m_item_height; } 106 inline unsigned int itemHeight() const { return m_real_item_height; }
107 inline unsigned int borderWidth() const { return *m_border_width; } 107 inline unsigned int borderWidth() const { return *m_border_width; }
108 inline unsigned int bevelWidth() const { return *m_bevel_width; } 108 inline unsigned int bevelWidth() const { return *m_bevel_width; }
109 109
@@ -141,7 +141,8 @@ private:
141 MenuMode m_menumode; 141 MenuMode m_menumode;
142 unsigned int m_delayopen; ///< in msec 142 unsigned int m_delayopen; ///< in msec
143 unsigned int m_delayclose; ///< in msec 143 unsigned int m_delayclose; ///< in msec
144 144 int m_real_title_height; ///< the calculated item height (from font and menu.titleHeight)
145 int m_real_item_height; ///< the calculated item height (from font and menu.itemHeight)
145}; 146};
146 147
147} // end namespace FbTk 148} // end namespace FbTk