right click on iconbutton toggles menu
This commit is contained in:
parent
4bb6a027e3
commit
a8e3f500c2
2 changed files with 8 additions and 9 deletions
|
@ -1,6 +1,8 @@
|
|||
(Format: Year/Month/Day)
|
||||
Changes for 1.0rc3:
|
||||
*07/01/16:
|
||||
* Make right-clicking on iconbar button behave the same way as tabs (Mark)
|
||||
IconButton.cc
|
||||
* Don't force user to reconfigure manually in order to apply menu and
|
||||
default window transparency changes; instead, in order to conserve system
|
||||
resources, do it a half-second after the user stops changing them (Mark)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "Window.hh"
|
||||
#include "WinClient.hh"
|
||||
#include "CommandParser.hh"
|
||||
#include "WindowCmd.hh"
|
||||
|
||||
#include "FbTk/App.hh"
|
||||
#include "FbTk/SimpleCommand.hh"
|
||||
|
@ -56,6 +57,11 @@ class ShowMenu: public FbTk::Command {
|
|||
public:
|
||||
explicit ShowMenu(FluxboxWindow &win):m_win(win) { }
|
||||
void execute() {
|
||||
// hide the menu if it's already showing for this FluxboxWindow
|
||||
if (m_win.menu().isVisible() && WindowCmd<void>::window() == &m_win) {
|
||||
m_win.screen().hideMenus();
|
||||
return;
|
||||
}
|
||||
m_win.screen().hideMenus();
|
||||
// get last button pos
|
||||
const XEvent &event = Fluxbox::instance()->lastEvent();
|
||||
|
@ -146,15 +152,6 @@ IconButton::IconButton(const IconbarTool& tool, const FbTk::FbWindow &parent,
|
|||
|
||||
RefCmd next_workspace(new ::WheelWorkspaceCmd(tool, m_win, "nextworkspace"));
|
||||
RefCmd prev_workspace(new ::WheelWorkspaceCmd(tool, m_win, "prevworkspace"));
|
||||
|
||||
//!! TODO: There're some issues with MacroCommand when
|
||||
// this object dies when the last macrocommand is executed (focused cmd)
|
||||
// In iconbar mode Icons
|
||||
//
|
||||
// RefCmd hidemenus(new FbTk::SimpleCommand<BScreen>(win.screen(), &BScreen::hideMenus));
|
||||
// FbTk::MacroCommand *focus_macro = new FbTk::MacroCommand();
|
||||
// focus_macro->add(hidemenus);
|
||||
// focus_macro->add(focus);
|
||||
|
||||
RefCmd focus_cmd(new ::FocusCommand(tool, m_win));
|
||||
RefCmd menu_cmd(new ::ShowMenu(m_win));
|
||||
|
|
Loading…
Reference in a new issue