diff options
author | markt <markt> | 2007-01-16 16:25:43 (GMT) |
---|---|---|
committer | markt <markt> | 2007-01-16 16:25:43 (GMT) |
commit | a8e3f500c29c9d0c94233ce499e54fadd83fa764 (patch) | |
tree | 96042412ce9cb9856af4bc926b263b4aeae07c5e /src/IconButton.cc | |
parent | 4bb6a027e31cd91b06eecd1cd942f7a2d8cd8fa2 (diff) | |
download | fluxbox_pavel-a8e3f500c29c9d0c94233ce499e54fadd83fa764.zip fluxbox_pavel-a8e3f500c29c9d0c94233ce499e54fadd83fa764.tar.bz2 |
right click on iconbutton toggles menu
Diffstat (limited to 'src/IconButton.cc')
-rw-r--r-- | src/IconButton.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc index eaae85e..545ee1d 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "Window.hh" | 30 | #include "Window.hh" |
31 | #include "WinClient.hh" | 31 | #include "WinClient.hh" |
32 | #include "CommandParser.hh" | 32 | #include "CommandParser.hh" |
33 | #include "WindowCmd.hh" | ||
33 | 34 | ||
34 | #include "FbTk/App.hh" | 35 | #include "FbTk/App.hh" |
35 | #include "FbTk/SimpleCommand.hh" | 36 | #include "FbTk/SimpleCommand.hh" |
@@ -56,6 +57,11 @@ class ShowMenu: public FbTk::Command { | |||
56 | public: | 57 | public: |
57 | explicit ShowMenu(FluxboxWindow &win):m_win(win) { } | 58 | explicit ShowMenu(FluxboxWindow &win):m_win(win) { } |
58 | void execute() { | 59 | void execute() { |
60 | // hide the menu if it's already showing for this FluxboxWindow | ||
61 | if (m_win.menu().isVisible() && WindowCmd<void>::window() == &m_win) { | ||
62 | m_win.screen().hideMenus(); | ||
63 | return; | ||
64 | } | ||
59 | m_win.screen().hideMenus(); | 65 | m_win.screen().hideMenus(); |
60 | // get last button pos | 66 | // get last button pos |
61 | const XEvent &event = Fluxbox::instance()->lastEvent(); | 67 | const XEvent &event = Fluxbox::instance()->lastEvent(); |
@@ -146,15 +152,6 @@ IconButton::IconButton(const IconbarTool& tool, const FbTk::FbWindow &parent, | |||
146 | 152 | ||
147 | RefCmd next_workspace(new ::WheelWorkspaceCmd(tool, m_win, "nextworkspace")); | 153 | RefCmd next_workspace(new ::WheelWorkspaceCmd(tool, m_win, "nextworkspace")); |
148 | RefCmd prev_workspace(new ::WheelWorkspaceCmd(tool, m_win, "prevworkspace")); | 154 | RefCmd prev_workspace(new ::WheelWorkspaceCmd(tool, m_win, "prevworkspace")); |
149 | |||
150 | //!! TODO: There're some issues with MacroCommand when | ||
151 | // this object dies when the last macrocommand is executed (focused cmd) | ||
152 | // In iconbar mode Icons | ||
153 | // | ||
154 | // RefCmd hidemenus(new FbTk::SimpleCommand<BScreen>(win.screen(), &BScreen::hideMenus)); | ||
155 | // FbTk::MacroCommand *focus_macro = new FbTk::MacroCommand(); | ||
156 | // focus_macro->add(hidemenus); | ||
157 | // focus_macro->add(focus); | ||
158 | 155 | ||
159 | RefCmd focus_cmd(new ::FocusCommand(tool, m_win)); | 156 | RefCmd focus_cmd(new ::FocusCommand(tool, m_win)); |
160 | RefCmd menu_cmd(new ::ShowMenu(m_win)); | 157 | RefCmd menu_cmd(new ::ShowMenu(m_win)); |