From 5b07791ed4c33a11f8fabd274b07056e4fa6996d Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sun, 12 Oct 2008 21:55:03 -0700 Subject: merge menuDelay and menuDelayClose options --- ChangeLog | 3 +++ doc/asciidoc/fluxbox.1 | 32 ++++---------------------------- doc/asciidoc/fluxbox.txt | 16 ++-------------- doc/fluxbox.1.in | 32 ++++---------------------------- src/FbTk/Menu.cc | 4 ++-- src/FbTk/MenuTheme.cc | 3 +-- src/FbTk/MenuTheme.hh | 9 +++------ src/Screen.cc | 17 ++--------------- src/Screen.hh | 2 +- 9 files changed, 22 insertions(+), 96 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe11533..675b073 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.1.2 +*08/10/13: + * Merge menuDelay and menuDelayClose options in init (Mark) + Screen.cc/hh FbTk/MenuTheme.cc/hh FbTk/Menu.cc *08/10/07: * Allow relative paths for background images in style files (Mark) RootTheme.cc FbTk/Image.cc/hh diff --git a/doc/asciidoc/fluxbox.1 b/doc/asciidoc/fluxbox.1 index 9eae541..11cea60 100644 --- a/doc/asciidoc/fluxbox.1 +++ b/doc/asciidoc/fluxbox.1 @@ -1,12 +1,12 @@ .\" Title: fluxbox .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.74.0 -.\" Date: 10/04/2008 +.\" Date: 10/12/2008 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" -.TH "FLUXBOX" "1" "10/04/2008" "[FIXME: source]" "[FIXME: manual]" +.TH "FLUXBOX" "1" "10/12/2008" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * (re)Define some macros .\" ----------------------------------------------------------------- @@ -845,26 +845,6 @@ Button 3 (Un)Maximize window horizontally\&. .SS "Workspace Menu" .sp The workspace menu can be found by middle clicking on the background\&. A menu will popup giving you the option to add or remove a workspace\&. You will also see your workspaces listed there; middle clicking on a workspace name will take you to that workspace, whereas clicking on a window name in one of the per\-workspace submenus will take you to the workspace that window is on, and select the window\&. Last but not least you will notice the Icons menu\&. This is for applications which have been `iconified\'\&. -.SS "Menu Behavior" -.sp -The behavior of the submenus in a menu can be configured in the `init\' file, with the following entries (default for both is 0): -.sp -.if n \{\ -.RS 4 -.\} -.fam C -.ps -1 -.nf -.BB lightgray -session\&.screen0\&.menuDelay: -session\&.screen0\&.menuDelayClose: -.EB lightgray -.fi -.fam -.ps +1 -.if n \{\ -.RE -.\} .SS "Menu Syntax" .sp There are up to four fields in a menu line\&. They are of the form: @@ -1789,12 +1769,8 @@ session\&.screen0\&.defaultDeco: the APPLICATIONS section\&. Default: NORMAL\&. session\&.screen0\&.menuDelay: - This sets the delay in milliseconds for submenus to open with the previous - option set to `Delay\'\&. Default: 0 - -session\&.screen0\&.menuDelayClose: 0 - This value sets the delay in milliseconds that you would like the menu to - remain visible after you\'ve clicked out of it\&. Default: 0 + This sets the delay in milliseconds for submenus to open when you hover + over them or to close when you hover over another item\&. Default: 200 session\&.screen0\&.focusNewWindows: This sets whether or not new windows will become focused automatically\&. diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt index 179818b..1bb9123 100644 --- a/doc/asciidoc/fluxbox.txt +++ b/doc/asciidoc/fluxbox.txt @@ -367,14 +367,6 @@ workspace that window is on, and select the window. Last but not least you will notice the Icons menu. This is for applications which have been `iconified'. -Menu Behavior -~~~~~~~~~~~~~ -The behavior of the submenus in a menu can be configured in the `init' -file, with the following entries (default for both is 0): - - session.screen0.menuDelay: - session.screen0.menuDelayClose: - Menu Syntax ~~~~~~~~~~~ There are up to four fields in a menu line. They are of the form: @@ -837,12 +829,8 @@ session.screen0.defaultDeco: the APPLICATIONS section. Default: NORMAL. session.screen0.menuDelay: - This sets the delay in milliseconds for submenus to open with the previous - option set to `Delay'. Default: 0 - -session.screen0.menuDelayClose: 0 - This value sets the delay in milliseconds that you would like the menu to - remain visible after you've clicked out of it. Default: 0 + This sets the delay in milliseconds for submenus to open when you hover + over them or to close when you hover over another item. Default: 200 session.screen0.focusNewWindows: This sets whether or not new windows will become focused automatically. diff --git a/doc/fluxbox.1.in b/doc/fluxbox.1.in index 9eae541..11cea60 100644 --- a/doc/fluxbox.1.in +++ b/doc/fluxbox.1.in @@ -1,12 +1,12 @@ .\" Title: fluxbox .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.74.0 -.\" Date: 10/04/2008 +.\" Date: 10/12/2008 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" -.TH "FLUXBOX" "1" "10/04/2008" "[FIXME: source]" "[FIXME: manual]" +.TH "FLUXBOX" "1" "10/12/2008" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * (re)Define some macros .\" ----------------------------------------------------------------- @@ -845,26 +845,6 @@ Button 3 (Un)Maximize window horizontally\&. .SS "Workspace Menu" .sp The workspace menu can be found by middle clicking on the background\&. A menu will popup giving you the option to add or remove a workspace\&. You will also see your workspaces listed there; middle clicking on a workspace name will take you to that workspace, whereas clicking on a window name in one of the per\-workspace submenus will take you to the workspace that window is on, and select the window\&. Last but not least you will notice the Icons menu\&. This is for applications which have been `iconified\'\&. -.SS "Menu Behavior" -.sp -The behavior of the submenus in a menu can be configured in the `init\' file, with the following entries (default for both is 0): -.sp -.if n \{\ -.RS 4 -.\} -.fam C -.ps -1 -.nf -.BB lightgray -session\&.screen0\&.menuDelay: -session\&.screen0\&.menuDelayClose: -.EB lightgray -.fi -.fam -.ps +1 -.if n \{\ -.RE -.\} .SS "Menu Syntax" .sp There are up to four fields in a menu line\&. They are of the form: @@ -1789,12 +1769,8 @@ session\&.screen0\&.defaultDeco: the APPLICATIONS section\&. Default: NORMAL\&. session\&.screen0\&.menuDelay: - This sets the delay in milliseconds for submenus to open with the previous - option set to `Delay\'\&. Default: 0 - -session\&.screen0\&.menuDelayClose: 0 - This value sets the delay in milliseconds that you would like the menu to - remain visible after you\'ve clicked out of it\&. Default: 0 + This sets the delay in milliseconds for submenus to open when you hover + over them or to close when you hover over another item\&. Default: 200 session\&.screen0\&.focusNewWindows: This sets whether or not new windows will become focused automatically\&. 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) { // start submenu open delay timeval timeout; timeout.tv_sec = 0; - timeout.tv_usec = theme()->delayOpen() * 1000; // transformed to usec + timeout.tv_usec = theme()->getDelay() * 1000; // transformed to usec m_submenu_timer.setTimeout(timeout); m_submenu_timer.start(); } else if (isItemSelectable(w)){ @@ -1191,7 +1191,7 @@ void Menu::closeMenu() { void Menu::startHide() { timeval timeout; timeout.tv_sec = 0; - timeout.tv_usec = theme()->delayClose() * 1000; // transformed to usec + timeout.tv_usec = theme()->getDelay() * 1000; // transformed to usec m_hide_timer.setTimeout(timeout); m_hide_timer.start(); } 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): d_text_gc(RootWindow(m_display, screen_num)), hilite_gc(RootWindow(m_display, screen_num)), m_alpha(255), - m_delayopen(0), // no delay as default - m_delayclose(0), // no delay as default + m_delay(0), // no delay as default m_real_title_height(*m_title_height), m_real_item_height(*m_item_height) { 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: // this isn't actually a theme item // but we'll let it be here for now, until there's a better way to // get resources into menu - void setDelayOpen(int msec) { m_delayopen = msec; } - void setDelayClose(int msec) { m_delayclose = msec; } - int delayOpen() const { return m_delayopen; } - int delayClose() const { return m_delayclose; } + void setDelay(int msec) { m_delay = msec; } + int getDelay() const { return m_delay; } const Color &borderColor() const { return *m_border_color; } Shape::ShapePlace shapePlaces() const { return *m_shapeplace; } @@ -157,8 +155,7 @@ private: GContext t_text_gc, f_text_gc, u_text_gc, h_text_gc, d_text_gc, hilite_gc; unsigned char m_alpha; - unsigned int m_delayopen; ///< in msec - unsigned int m_delayclose; ///< in msec + unsigned int m_delay; ///< in msec unsigned int m_real_title_height; ///< the calculated item height (from font and menu.titleHeight) unsigned int m_real_item_height; ///< the calculated item height (from font and menu.itemHeight) }; 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, unfocused_alpha(rm, 255, scrname+".window.unfocus.alpha", altscrname+".Window.Unfocus.Alpha"), menu_alpha(rm, 255, scrname+".menu.alpha", altscrname+".Menu.Alpha"), menu_delay(rm, 200, scrname + ".menuDelay", altscrname+".MenuDelay"), - menu_delay_close(rm, 200, scrname + ".menuDelayClose", altscrname+".MenuDelayClose"), tab_width(rm, 64, scrname + ".tab.width", altscrname+".Tab.Width"), tooltip_delay(rm, 500, scrname + ".tooltipDelay", altscrname+".TooltipDelay"), allow_remote_actions(rm, false, scrname+".allowRemoteActions", altscrname+".AllowRemoteActions"), @@ -455,13 +454,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, if (*resource.menu_delay < 0) *resource.menu_delay = 0; - if (*resource.menu_delay_close > 5000) - *resource.menu_delay_close = 5000; - if (*resource.menu_delay_close < 0) - *resource.menu_delay_close = 0; - - m_menutheme->setDelayOpen(*resource.menu_delay); - m_menutheme->setDelayClose(*resource.menu_delay_close); + m_menutheme->setDelay(*resource.menu_delay); focusedWinFrameTheme()->reconfigSig().attach(this);// for geom window @@ -915,13 +908,7 @@ void BScreen::reconfigure() { if (*resource.menu_delay < 0) *resource.menu_delay = 0; - if (*resource.menu_delay_close > 5000) - *resource.menu_delay_close = 5000; - if (*resource.menu_delay_close < 0) - *resource.menu_delay_close = 0; - - m_menutheme->setDelayOpen(*resource.menu_delay); - m_menutheme->setDelayClose(*resource.menu_delay_close); + m_menutheme->setDelay(*resource.menu_delay); // realize the number of workspaces from the init-file 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: FbTk::Resource windowmenufile; FbTk::Resource typing_delay; FbTk::Resource workspaces, edge_snap_threshold, focused_alpha, - unfocused_alpha, menu_alpha, menu_delay, menu_delay_close, + unfocused_alpha, menu_alpha, menu_delay, tab_width, tooltip_delay; FbTk::Resource allow_remote_actions; FbTk::Resource clientmenu_use_pixmap; -- cgit v0.11.2