aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/MenuTheme.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2005-04-26 01:41:55 (GMT)
committersimonb <simonb>2005-04-26 01:41:55 (GMT)
commit1c2f92a3d2288b1cae9500110a72173506a18072 (patch)
treecdb695da16dcee74872790c772bb535def9f2895 /src/FbTk/MenuTheme.cc
parentb49432be05c6cf748e662e196778463e2190b4c3 (diff)
downloadfluxbox-1c2f92a3d2288b1cae9500110a72173506a18072.zip
fluxbox-1c2f92a3d2288b1cae9500110a72173506a18072.tar.bz2
extension of previous big patch. Move a bunch of menu things onto
background pixmap. Same for textbuttons.
Diffstat (limited to 'src/FbTk/MenuTheme.cc')
-rw-r--r--src/FbTk/MenuTheme.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/FbTk/MenuTheme.cc b/src/FbTk/MenuTheme.cc
index bf4cfc6..1e02f63 100644
--- a/src/FbTk/MenuTheme.cc
+++ b/src/FbTk/MenuTheme.cc
@@ -61,6 +61,9 @@ MenuTheme::MenuTheme(int screen_num):
61 m_bullet_pixmap(*this, "menu.submenu.pixmap", "Menu.Submenu.Pixmap"), 61 m_bullet_pixmap(*this, "menu.submenu.pixmap", "Menu.Submenu.Pixmap"),
62 m_selected_pixmap(*this, "menu.selected.pixmap", "Menu.Selected.Pixmap"), 62 m_selected_pixmap(*this, "menu.selected.pixmap", "Menu.Selected.Pixmap"),
63 m_unselected_pixmap(*this, "menu.unselected.pixmap", "Menu.Unselected.Pixmap"), 63 m_unselected_pixmap(*this, "menu.unselected.pixmap", "Menu.Unselected.Pixmap"),
64 m_hl_bullet_pixmap(*this, "menu.hilite.submenu.pixmap", "Menu.Hilite.Submenu.Pixmap"),
65 m_hl_selected_pixmap(*this, "menu.hilite.selected.pixmap", "Menu.Hilite.Selected.Pixmap"),
66 m_hl_unselected_pixmap(*this, "menu.hilite.unselected.pixmap", "Menu.Hilite.Unselected.Pixmap"),
64 m_display(FbTk::App::instance()->display()), 67 m_display(FbTk::App::instance()->display()),
65 t_text_gc(RootWindow(m_display, screen_num)), 68 t_text_gc(RootWindow(m_display, screen_num)),
66 f_text_gc(RootWindow(m_display, screen_num)), 69 f_text_gc(RootWindow(m_display, screen_num)),
@@ -109,12 +112,18 @@ void MenuTheme::reconfigTheme() {
109 m_real_title_height = std::max(*m_title_height, 112 m_real_title_height = std::max(*m_title_height,
110 titleFont().height() + 2*bevelWidth()); 113 titleFont().height() + 2*bevelWidth());
111 114
112 m_real_item_height = m_real_item_height == 0 ? 1 : m_real_item_height; 115 unsigned int minsize = 2*bevelWidth()+1;
113 m_real_title_height = m_real_title_height == 0 ? 1 : m_real_title_height; 116 m_real_item_height = m_real_item_height < minsize ? minsize: m_real_item_height;
117 m_real_title_height = m_real_title_height == minsize ? minsize : m_real_title_height;
118 unsigned int item_pm_height = itemHeight();
119
120 m_bullet_pixmap->scale(item_pm_height, item_pm_height);
121 m_selected_pixmap->scale(item_pm_height, item_pm_height);
122 m_unselected_pixmap->scale(item_pm_height, item_pm_height);
114 123
115 m_bullet_pixmap->scale(itemHeight(), itemHeight()); 124 m_hl_bullet_pixmap->scale(item_pm_height, item_pm_height);
116 m_selected_pixmap->scale(itemHeight(), itemHeight()); 125 m_hl_selected_pixmap->scale(item_pm_height, item_pm_height);
117 m_unselected_pixmap->scale(itemHeight(), itemHeight()); 126 m_hl_unselected_pixmap->scale(item_pm_height, item_pm_height);
118 127
119 t_text_gc.setForeground(*t_text); 128 t_text_gc.setForeground(*t_text);
120 f_text_gc.setForeground(*f_text); 129 f_text_gc.setForeground(*f_text);