all repos — fluxbox @ 74216903cc04b9b4492925fc4f90e9f5f378d8c1

custom fork of the fluxbox windowmanager

added custommenu command
markt markt
commit

74216903cc04b9b4492925fc4f90e9f5f378d8c1

parent

d948abb81b104dd1562015c4dfa0d080480b6ce2

4 files changed, 27 insertions(+), 0 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,9 @@

(Format: Year/Month/Day) Changes for 1.0rc3: +*07/03/16: + * Added key command to open a custom menu file (thanks Matteo Galiazzo) + - :CustomMenu /path/to/file + FbCommands.cc/hh FbCommandFactory.cc *07/03/11: * Fixed display bug with ParentRelative menu highlight (thanks Julien Trolet) FbTk/Menu.cc
M src/FbCommandFactory.ccsrc/FbCommandFactory.cc

@@ -65,6 +65,7 @@ "bindkey",

"close", "closeallwindows", "commanddialog", + "custommenu", "deiconify", "detachclient", "export",

@@ -438,6 +439,8 @@ else if (command == "hidemenus")

return new HideMenuCmd(); else if (command == "rootmenu") return new ShowRootMenuCmd(); + else if (command == "custommenu") + return new ShowCustomMenuCmd(arguments.c_str()); else if (command == "workspacemenu") return new ShowWorkspaceMenuCmd(); else if (command == "setworkspacename") {
M src/FbCommands.ccsrc/FbCommands.cc

@@ -28,6 +28,7 @@ #include "CommandDialog.hh"

#include "Workspace.hh" #include "Window.hh" #include "Keys.hh" +#include "MenuCreator.hh" #include "FbTk/Theme.hh" #include "FbTk/Menu.hh"

@@ -267,6 +268,16 @@ if (screen->rootMenu().isVisible())

screen->rootMenu().hide(); if (screen->workspaceMenu().isVisible()) screen->workspaceMenu().hide(); +} + +ShowCustomMenuCmd::ShowCustomMenuCmd(const string &arguments) : custom_menu_file(arguments) {} + +void ShowCustomMenuCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen == 0) + return; + ::showMenu(*screen, *MenuCreator::createFromFile(custom_menu_file, + screen->screenNumber(), true)); } void ShowRootMenuCmd::execute() {
M src/FbCommands.hhsrc/FbCommands.hh

@@ -118,6 +118,15 @@ public:

void execute(); }; +class ShowCustomMenuCmd: public FbTk::Command { +public: + explicit ShowCustomMenuCmd(const std::string &arguments); + void execute(); +private: + std::string custom_menu_file; + +}; + class ShowRootMenuCmd: public FbTk::Command { public: void execute();