aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-28 09:14:19 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-28 09:14:19 (GMT)
commit0f6b73f36abb1fd31893ef16413f010e78ed84ab (patch)
tree68ebeaae3db4e0708f1d430c828a77ebce86c9f1 /src/FbTk
parent2940869cd7cc1688be5114451380275c9a85f5d1 (diff)
downloadfluxbox-0f6b73f36abb1fd31893ef16413f010e78ed84ab.zip
fluxbox-0f6b73f36abb1fd31893ef16413f010e78ed84ab.tar.bz2
move shape handling from FbMenu to FbTk::Menu
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Menu.cc4
-rw-r--r--src/FbTk/Menu.hh7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index 485b56c..00dcc54 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -92,6 +92,7 @@ Menu::Menu(MenuTheme &tm, ImageControl &imgctrl):
92 m_screen_height(DisplayHeight(FbTk::App::instance()->display(), tm.screenNum())), 92 m_screen_height(DisplayHeight(FbTk::App::instance()->display(), tm.screenNum())),
93 m_alignment(ALIGNDONTCARE), 93 m_alignment(ALIGNDONTCARE),
94 m_active_index(-1), 94 m_active_index(-1),
95 m_shape(new Shape(fbwindow(), tm.shapePlaces())),
95 m_need_update(true) { 96 m_need_update(true) {
96 // setup timers 97 // setup timers
97 98
@@ -496,6 +497,7 @@ void Menu::updateMenu(int active_index) {
496 497
497 clearWindow(); 498 clearWindow();
498 m_need_update = false; 499 m_need_update = false;
500 m_shape->update();
499} 501}
500 502
501 503
@@ -563,6 +565,7 @@ void Menu::clearWindow() {
563 for (size_t i = 0; i < menuitems.size(); i++) { 565 for (size_t i = 0; i < menuitems.size(); i++) {
564 clearItem(i, false); // no clear 566 clearItem(i, false); // no clear
565 } 567 }
568 m_shape->update();
566} 569}
567 570
568void Menu::redrawFrame(FbDrawable &drawable) { 571void Menu::redrawFrame(FbDrawable &drawable) {
@@ -1091,6 +1094,7 @@ void Menu::keyPressEvent(XKeyEvent &event) {
1091 1094
1092 1095
1093void Menu::reconfigure() { 1096void Menu::reconfigure() {
1097 m_shape->setPlaces(theme().shapePlaces());
1094 1098
1095 if (FbTk::Transparent::haveComposite()) { 1099 if (FbTk::Transparent::haveComposite()) {
1096 menu.window.setOpaque(alpha()); 1100 menu.window.setOpaque(alpha());
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh
index f16c443..54c6d62 100644
--- a/src/FbTk/Menu.hh
+++ b/src/FbTk/Menu.hh
@@ -203,13 +203,12 @@ private:
203 void startHide(); 203 void startHide();
204 void stopHide(); 204 void stopHide();
205 205
206
207 typedef std::vector<MenuItem *> Menuitems;
208 MenuTheme &m_theme; 206 MenuTheme &m_theme;
209 Menu *m_parent; 207 Menu *m_parent;
210 ImageControl &m_image_ctrl; 208 ImageControl &m_image_ctrl;
211 Menuitems menuitems;
212 209
210 typedef std::vector<MenuItem *> Menuitems;
211 Menuitems menuitems;
213 TypeAhead<Menuitems, MenuItem *> m_type_ahead; 212 TypeAhead<Menuitems, MenuItem *> m_type_ahead;
214 Menuitems m_matches; 213 Menuitems m_matches;
215 214
@@ -242,6 +241,8 @@ private:
242 241
243 int m_active_index; ///< current highlighted index 242 int m_active_index; ///< current highlighted index
244 243
244 std::auto_ptr<FbTk::Shape> m_shape;
245
245 Drawable m_root_pm; 246 Drawable m_root_pm;
246 static Menu *shown; ///< used for determining if there's a menu open at all 247 static Menu *shown; ///< used for determining if there's a menu open at all
247 static Menu *s_focused; ///< holds current input focused menu, so one can determine if a menu is focused 248 static Menu *s_focused; ///< holds current input focused menu, so one can determine if a menu is focused