added custommenu command
This commit is contained in:
parent
d948abb81b
commit
74216903cc
4 changed files with 27 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 1.0rc3:
|
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:
|
*07/03/11:
|
||||||
* Fixed display bug with ParentRelative menu highlight (thanks Julien Trolet)
|
* Fixed display bug with ParentRelative menu highlight (thanks Julien Trolet)
|
||||||
FbTk/Menu.cc
|
FbTk/Menu.cc
|
||||||
|
|
|
@ -65,6 +65,7 @@ FbCommandFactory::FbCommandFactory() {
|
||||||
"close",
|
"close",
|
||||||
"closeallwindows",
|
"closeallwindows",
|
||||||
"commanddialog",
|
"commanddialog",
|
||||||
|
"custommenu",
|
||||||
"deiconify",
|
"deiconify",
|
||||||
"detachclient",
|
"detachclient",
|
||||||
"export",
|
"export",
|
||||||
|
@ -438,6 +439,8 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
|
||||||
return new HideMenuCmd();
|
return new HideMenuCmd();
|
||||||
else if (command == "rootmenu")
|
else if (command == "rootmenu")
|
||||||
return new ShowRootMenuCmd();
|
return new ShowRootMenuCmd();
|
||||||
|
else if (command == "custommenu")
|
||||||
|
return new ShowCustomMenuCmd(arguments.c_str());
|
||||||
else if (command == "workspacemenu")
|
else if (command == "workspacemenu")
|
||||||
return new ShowWorkspaceMenuCmd();
|
return new ShowWorkspaceMenuCmd();
|
||||||
else if (command == "setworkspacename") {
|
else if (command == "setworkspacename") {
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "Workspace.hh"
|
#include "Workspace.hh"
|
||||||
#include "Window.hh"
|
#include "Window.hh"
|
||||||
#include "Keys.hh"
|
#include "Keys.hh"
|
||||||
|
#include "MenuCreator.hh"
|
||||||
|
|
||||||
#include "FbTk/Theme.hh"
|
#include "FbTk/Theme.hh"
|
||||||
#include "FbTk/Menu.hh"
|
#include "FbTk/Menu.hh"
|
||||||
|
@ -269,6 +270,16 @@ void HideMenuCmd::execute() {
|
||||||
screen->workspaceMenu().hide();
|
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() {
|
void ShowRootMenuCmd::execute() {
|
||||||
BScreen *screen = Fluxbox::instance()->mouseScreen();
|
BScreen *screen = Fluxbox::instance()->mouseScreen();
|
||||||
if (screen == 0)
|
if (screen == 0)
|
||||||
|
|
|
@ -118,6 +118,15 @@ public:
|
||||||
void execute();
|
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 {
|
class ShowRootMenuCmd: public FbTk::Command {
|
||||||
public:
|
public:
|
||||||
void execute();
|
void execute();
|
||||||
|
|
Loading…
Reference in a new issue