diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/FbCommandFactory.cc | 3 | ||||
-rw-r--r-- | src/FbCommands.cc | 11 | ||||
-rw-r--r-- | src/FbCommands.hh | 9 |
4 files changed, 27 insertions, 0 deletions
@@ -1,5 +1,9 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 1.0rc3: | 2 | Changes for 1.0rc3: |
3 | *07/03/16: | ||
4 | * Added key command to open a custom menu file (thanks Matteo Galiazzo) | ||
5 | - :CustomMenu /path/to/file | ||
6 | FbCommands.cc/hh FbCommandFactory.cc | ||
3 | *07/03/11: | 7 | *07/03/11: |
4 | * Fixed display bug with ParentRelative menu highlight (thanks Julien Trolet) | 8 | * Fixed display bug with ParentRelative menu highlight (thanks Julien Trolet) |
5 | FbTk/Menu.cc | 9 | FbTk/Menu.cc |
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index 2f05e5a..c02365a 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc | |||
@@ -65,6 +65,7 @@ FbCommandFactory::FbCommandFactory() { | |||
65 | "close", | 65 | "close", |
66 | "closeallwindows", | 66 | "closeallwindows", |
67 | "commanddialog", | 67 | "commanddialog", |
68 | "custommenu", | ||
68 | "deiconify", | 69 | "deiconify", |
69 | "detachclient", | 70 | "detachclient", |
70 | "export", | 71 | "export", |
@@ -438,6 +439,8 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
438 | return new HideMenuCmd(); | 439 | return new HideMenuCmd(); |
439 | else if (command == "rootmenu") | 440 | else if (command == "rootmenu") |
440 | return new ShowRootMenuCmd(); | 441 | return new ShowRootMenuCmd(); |
442 | else if (command == "custommenu") | ||
443 | return new ShowCustomMenuCmd(arguments.c_str()); | ||
441 | else if (command == "workspacemenu") | 444 | else if (command == "workspacemenu") |
442 | return new ShowWorkspaceMenuCmd(); | 445 | return new ShowWorkspaceMenuCmd(); |
443 | else if (command == "setworkspacename") { | 446 | else if (command == "setworkspacename") { |
diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 692e12f..bef6402 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "Workspace.hh" | 28 | #include "Workspace.hh" |
29 | #include "Window.hh" | 29 | #include "Window.hh" |
30 | #include "Keys.hh" | 30 | #include "Keys.hh" |
31 | #include "MenuCreator.hh" | ||
31 | 32 | ||
32 | #include "FbTk/Theme.hh" | 33 | #include "FbTk/Theme.hh" |
33 | #include "FbTk/Menu.hh" | 34 | #include "FbTk/Menu.hh" |
@@ -269,6 +270,16 @@ void HideMenuCmd::execute() { | |||
269 | screen->workspaceMenu().hide(); | 270 | screen->workspaceMenu().hide(); |
270 | } | 271 | } |
271 | 272 | ||
273 | ShowCustomMenuCmd::ShowCustomMenuCmd(const string &arguments) : custom_menu_file(arguments) {} | ||
274 | |||
275 | void ShowCustomMenuCmd::execute() { | ||
276 | BScreen *screen = Fluxbox::instance()->mouseScreen(); | ||
277 | if (screen == 0) | ||
278 | return; | ||
279 | ::showMenu(*screen, *MenuCreator::createFromFile(custom_menu_file, | ||
280 | screen->screenNumber(), true)); | ||
281 | } | ||
282 | |||
272 | void ShowRootMenuCmd::execute() { | 283 | void ShowRootMenuCmd::execute() { |
273 | BScreen *screen = Fluxbox::instance()->mouseScreen(); | 284 | BScreen *screen = Fluxbox::instance()->mouseScreen(); |
274 | if (screen == 0) | 285 | if (screen == 0) |
diff --git a/src/FbCommands.hh b/src/FbCommands.hh index 59200d2..3bc5074 100644 --- a/src/FbCommands.hh +++ b/src/FbCommands.hh | |||
@@ -118,6 +118,15 @@ public: | |||
118 | void execute(); | 118 | void execute(); |
119 | }; | 119 | }; |
120 | 120 | ||
121 | class ShowCustomMenuCmd: public FbTk::Command { | ||
122 | public: | ||
123 | explicit ShowCustomMenuCmd(const std::string &arguments); | ||
124 | void execute(); | ||
125 | private: | ||
126 | std::string custom_menu_file; | ||
127 | |||
128 | }; | ||
129 | |||
121 | class ShowRootMenuCmd: public FbTk::Command { | 130 | class ShowRootMenuCmd: public FbTk::Command { |
122 | public: | 131 | public: |
123 | void execute(); | 132 | void execute(); |