diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-10-13 04:55:03 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-10-13 04:55:03 (GMT) |
commit | 5b07791ed4c33a11f8fabd274b07056e4fa6996d (patch) | |
tree | 5b62f4b779aab02f5115d15c5682977ccab4b99a /src | |
parent | e5fd401f4eadef1aa4ab91b11d38653d1a4b7194 (diff) | |
download | fluxbox_pavel-5b07791ed4c33a11f8fabd274b07056e4fa6996d.zip fluxbox_pavel-5b07791ed4c33a11f8fabd274b07056e4fa6996d.tar.bz2 |
merge menuDelay and menuDelayClose options
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/Menu.cc | 4 | ||||
-rw-r--r-- | src/FbTk/MenuTheme.cc | 3 | ||||
-rw-r--r-- | src/FbTk/MenuTheme.hh | 9 | ||||
-rw-r--r-- | src/Screen.cc | 17 | ||||
-rw-r--r-- | src/Screen.hh | 2 |
5 files changed, 9 insertions, 26 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index a61bbc7..7cf2ac9 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc | |||
@@ -998,7 +998,7 @@ void Menu::motionNotifyEvent(XMotionEvent &me) { | |||
998 | // start submenu open delay | 998 | // start submenu open delay |
999 | timeval timeout; | 999 | timeval timeout; |
1000 | timeout.tv_sec = 0; | 1000 | timeout.tv_sec = 0; |
1001 | timeout.tv_usec = theme()->delayOpen() * 1000; // transformed to usec | 1001 | timeout.tv_usec = theme()->getDelay() * 1000; // transformed to usec |
1002 | m_submenu_timer.setTimeout(timeout); | 1002 | m_submenu_timer.setTimeout(timeout); |
1003 | m_submenu_timer.start(); | 1003 | m_submenu_timer.start(); |
1004 | } else if (isItemSelectable(w)){ | 1004 | } else if (isItemSelectable(w)){ |
@@ -1191,7 +1191,7 @@ void Menu::closeMenu() { | |||
1191 | void Menu::startHide() { | 1191 | void Menu::startHide() { |
1192 | timeval timeout; | 1192 | timeval timeout; |
1193 | timeout.tv_sec = 0; | 1193 | timeout.tv_sec = 0; |
1194 | timeout.tv_usec = theme()->delayClose() * 1000; // transformed to usec | 1194 | timeout.tv_usec = theme()->getDelay() * 1000; // transformed to usec |
1195 | m_hide_timer.setTimeout(timeout); | 1195 | m_hide_timer.setTimeout(timeout); |
1196 | m_hide_timer.start(); | 1196 | m_hide_timer.start(); |
1197 | } | 1197 | } |
diff --git a/src/FbTk/MenuTheme.cc b/src/FbTk/MenuTheme.cc index b6e8f93..28bcc35 100644 --- a/src/FbTk/MenuTheme.cc +++ b/src/FbTk/MenuTheme.cc | |||
@@ -72,8 +72,7 @@ MenuTheme::MenuTheme(int screen_num): | |||
72 | d_text_gc(RootWindow(m_display, screen_num)), | 72 | d_text_gc(RootWindow(m_display, screen_num)), |
73 | hilite_gc(RootWindow(m_display, screen_num)), | 73 | hilite_gc(RootWindow(m_display, screen_num)), |
74 | m_alpha(255), | 74 | m_alpha(255), |
75 | m_delayopen(0), // no delay as default | 75 | m_delay(0), // no delay as default |
76 | m_delayclose(0), // no delay as default | ||
77 | m_real_title_height(*m_title_height), | 76 | m_real_title_height(*m_title_height), |
78 | m_real_item_height(*m_item_height) | 77 | m_real_item_height(*m_item_height) |
79 | { | 78 | { |
diff --git a/src/FbTk/MenuTheme.hh b/src/FbTk/MenuTheme.hh index 59fcbaf..c10615b 100644 --- a/src/FbTk/MenuTheme.hh +++ b/src/FbTk/MenuTheme.hh | |||
@@ -111,10 +111,8 @@ public: | |||
111 | // this isn't actually a theme item | 111 | // this isn't actually a theme item |
112 | // but we'll let it be here for now, until there's a better way to | 112 | // but we'll let it be here for now, until there's a better way to |
113 | // get resources into menu | 113 | // get resources into menu |
114 | void setDelayOpen(int msec) { m_delayopen = msec; } | 114 | void setDelay(int msec) { m_delay = msec; } |
115 | void setDelayClose(int msec) { m_delayclose = msec; } | 115 | int getDelay() const { return m_delay; } |
116 | int delayOpen() const { return m_delayopen; } | ||
117 | int delayClose() const { return m_delayclose; } | ||
118 | 116 | ||
119 | const Color &borderColor() const { return *m_border_color; } | 117 | const Color &borderColor() const { return *m_border_color; } |
120 | Shape::ShapePlace shapePlaces() const { return *m_shapeplace; } | 118 | Shape::ShapePlace shapePlaces() const { return *m_shapeplace; } |
@@ -157,8 +155,7 @@ private: | |||
157 | GContext t_text_gc, f_text_gc, u_text_gc, h_text_gc, d_text_gc, hilite_gc; | 155 | GContext t_text_gc, f_text_gc, u_text_gc, h_text_gc, d_text_gc, hilite_gc; |
158 | 156 | ||
159 | unsigned char m_alpha; | 157 | unsigned char m_alpha; |
160 | unsigned int m_delayopen; ///< in msec | 158 | unsigned int m_delay; ///< in msec |
161 | unsigned int m_delayclose; ///< in msec | ||
162 | unsigned int m_real_title_height; ///< the calculated item height (from font and menu.titleHeight) | 159 | unsigned int m_real_title_height; ///< the calculated item height (from font and menu.titleHeight) |
163 | unsigned int m_real_item_height; ///< the calculated item height (from font and menu.itemHeight) | 160 | unsigned int m_real_item_height; ///< the calculated item height (from font and menu.itemHeight) |
164 | }; | 161 | }; |
diff --git a/src/Screen.cc b/src/Screen.cc index e6d10ff..776dd29 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -305,7 +305,6 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, | |||
305 | unfocused_alpha(rm, 255, scrname+".window.unfocus.alpha", altscrname+".Window.Unfocus.Alpha"), | 305 | unfocused_alpha(rm, 255, scrname+".window.unfocus.alpha", altscrname+".Window.Unfocus.Alpha"), |
306 | menu_alpha(rm, 255, scrname+".menu.alpha", altscrname+".Menu.Alpha"), | 306 | menu_alpha(rm, 255, scrname+".menu.alpha", altscrname+".Menu.Alpha"), |
307 | menu_delay(rm, 200, scrname + ".menuDelay", altscrname+".MenuDelay"), | 307 | menu_delay(rm, 200, scrname + ".menuDelay", altscrname+".MenuDelay"), |
308 | menu_delay_close(rm, 200, scrname + ".menuDelayClose", altscrname+".MenuDelayClose"), | ||
309 | tab_width(rm, 64, scrname + ".tab.width", altscrname+".Tab.Width"), | 308 | tab_width(rm, 64, scrname + ".tab.width", altscrname+".Tab.Width"), |
310 | tooltip_delay(rm, 500, scrname + ".tooltipDelay", altscrname+".TooltipDelay"), | 309 | tooltip_delay(rm, 500, scrname + ".tooltipDelay", altscrname+".TooltipDelay"), |
311 | allow_remote_actions(rm, false, scrname+".allowRemoteActions", altscrname+".AllowRemoteActions"), | 310 | allow_remote_actions(rm, false, scrname+".allowRemoteActions", altscrname+".AllowRemoteActions"), |
@@ -455,13 +454,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
455 | if (*resource.menu_delay < 0) | 454 | if (*resource.menu_delay < 0) |
456 | *resource.menu_delay = 0; | 455 | *resource.menu_delay = 0; |
457 | 456 | ||
458 | if (*resource.menu_delay_close > 5000) | 457 | m_menutheme->setDelay(*resource.menu_delay); |
459 | *resource.menu_delay_close = 5000; | ||
460 | if (*resource.menu_delay_close < 0) | ||
461 | *resource.menu_delay_close = 0; | ||
462 | |||
463 | m_menutheme->setDelayOpen(*resource.menu_delay); | ||
464 | m_menutheme->setDelayClose(*resource.menu_delay_close); | ||
465 | 458 | ||
466 | focusedWinFrameTheme()->reconfigSig().attach(this);// for geom window | 459 | focusedWinFrameTheme()->reconfigSig().attach(this);// for geom window |
467 | 460 | ||
@@ -915,13 +908,7 @@ void BScreen::reconfigure() { | |||
915 | if (*resource.menu_delay < 0) | 908 | if (*resource.menu_delay < 0) |
916 | *resource.menu_delay = 0; | 909 | *resource.menu_delay = 0; |
917 | 910 | ||
918 | if (*resource.menu_delay_close > 5000) | 911 | m_menutheme->setDelay(*resource.menu_delay); |
919 | *resource.menu_delay_close = 5000; | ||
920 | if (*resource.menu_delay_close < 0) | ||
921 | *resource.menu_delay_close = 0; | ||
922 | |||
923 | m_menutheme->setDelayOpen(*resource.menu_delay); | ||
924 | m_menutheme->setDelayClose(*resource.menu_delay_close); | ||
925 | 912 | ||
926 | // realize the number of workspaces from the init-file | 913 | // realize the number of workspaces from the init-file |
927 | const unsigned int nr_ws = *resource.workspaces; | 914 | const unsigned int nr_ws = *resource.workspaces; |
diff --git a/src/Screen.hh b/src/Screen.hh index 91cf94a..2267d86 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -545,7 +545,7 @@ private: | |||
545 | FbTk::Resource<std::string> windowmenufile; | 545 | FbTk::Resource<std::string> windowmenufile; |
546 | FbTk::Resource<unsigned int> typing_delay; | 546 | FbTk::Resource<unsigned int> typing_delay; |
547 | FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha, | 547 | FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha, |
548 | unfocused_alpha, menu_alpha, menu_delay, menu_delay_close, | 548 | unfocused_alpha, menu_alpha, menu_delay, |
549 | tab_width, tooltip_delay; | 549 | tab_width, tooltip_delay; |
550 | FbTk::Resource<bool> allow_remote_actions; | 550 | FbTk::Resource<bool> allow_remote_actions; |
551 | FbTk::Resource<bool> clientmenu_use_pixmap; | 551 | FbTk::Resource<bool> clientmenu_use_pixmap; |