Add Show/Hide toolbar to the View menu

The Apple HIG says to include this, and I see no reason not to include
it on the other platforms as well.

Originally committed to SVN as r6839.
This commit is contained in:
Thomas Goyne 2012-05-23 03:38:37 +00:00
parent b9154a79c1
commit 58de109085
3 changed files with 29 additions and 2 deletions

View file

@ -263,6 +263,28 @@ struct app_toggle_global_hotkeys : public Command {
}
};
/// Toggle the main toolbar
struct app_toggle_toolbar : public Command {
CMD_NAME("app/toggle/toolbar")
STR_HELP("Toggle the main toolbar")
CMD_TYPE(COMMAND_DYNAMIC_NAME)
wxString StrMenu(const agi::Context *) const {
return OPT_GET("App/Show Toolbar")->GetBool() ?
_("Hide Toolbar") :
_("Show Toolbar");
}
wxString StrDisplay(const agi::Context *) const {
return StrMenu(0);
}
void operator()(agi::Context *) {
agi::OptionValue *opt = OPT_SET("App/Show Toolbar");
opt->SetBool(!opt->GetBool());
}
};
/// Check to see if there is a new version of Aegisub available.
struct app_updates : public Command {
CMD_NAME("app/updates")
@ -291,6 +313,7 @@ namespace cmd {
reg(new app_new_window);
reg(new app_options);
reg(new app_toggle_global_hotkeys);
reg(new app_toggle_toolbar);
reg(new app_updates);
}
}

View file

@ -191,7 +191,9 @@
{},
{ "command" : "grid/tags/show" },
{ "command" : "grid/tags/simplify" },
{ "command" : "grid/tags/hide" }
{ "command" : "grid/tags/hide" },
{},
{ "command" : "app/toggle/toolbar" }
],
"main/help" : [
{ "command" : "help/contents" },

View file

@ -190,7 +190,9 @@
{},
{ "command" : "grid/tags/show" },
{ "command" : "grid/tags/simplify" },
{ "command" : "grid/tags/hide" }
{ "command" : "grid/tags/hide" },
{},
{ "command" : "app/toggle/toolbar" }
],
"main/help" : [
{ "command" : "help/contents" },