forked from mia/Aegisub
Add option to hide the main toolbar. Updates #1399.
Originally committed to SVN as r6340.
This commit is contained in:
parent
c8099decf3
commit
1f8005d8d1
4 changed files with 22 additions and 6 deletions
|
@ -241,11 +241,24 @@ FrameMain::~FrameMain () {
|
||||||
SubsGrid->Destroy();
|
SubsGrid->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Initialize toolbar
|
void FrameMain::InitToolbar() {
|
||||||
void FrameMain::InitToolbar () {
|
|
||||||
wxSystemOptions::SetOption("msw.remap", 0);
|
wxSystemOptions::SetOption("msw.remap", 0);
|
||||||
|
OPT_SUB("App/Show Toolbar", &FrameMain::EnableToolBar, this);
|
||||||
|
EnableToolBar(*OPT_GET("App/Show Toolbar"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void FrameMain::EnableToolBar(agi::OptionValue const& opt) {
|
||||||
|
if (opt.GetBool()) {
|
||||||
|
if (!GetToolBar()) {
|
||||||
toolbar::AttachToolbar(this, "main", context.get(), "Default");
|
toolbar::AttachToolbar(this, "main", context.get(), "Default");
|
||||||
GetToolBar()->Realize();
|
GetToolBar()->Realize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (wxToolBar *old_tb = GetToolBar()) {
|
||||||
|
SetToolBar(0);
|
||||||
|
delete old_tb;
|
||||||
|
Layout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameMain::InitContents() {
|
void FrameMain::InitContents() {
|
||||||
|
|
|
@ -113,6 +113,8 @@ class FrameMain: public wxFrame {
|
||||||
|
|
||||||
void OnSubtitlesOpen();
|
void OnSubtitlesOpen();
|
||||||
|
|
||||||
|
void EnableToolBar(agi::OptionValue const& opt);
|
||||||
|
|
||||||
SubtitlesGrid *SubsGrid; ///< The subtitle editing area
|
SubtitlesGrid *SubsGrid; ///< The subtitle editing area
|
||||||
AudioBox *audioBox; ///< The audio area
|
AudioBox *audioBox; ///< The audio area
|
||||||
VideoBox *videoBox; ///< The video area
|
VideoBox *videoBox; ///< The video area
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
"Locale" : -1,
|
"Locale" : -1,
|
||||||
"Maximized" : false,
|
"Maximized" : false,
|
||||||
"Save Charset" : "UTF-8",
|
"Save Charset" : "UTF-8",
|
||||||
|
"Show Toolbar" : true,
|
||||||
"Toolbar Icon Size" : 16
|
"Toolbar Icon Size" : 16
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -105,12 +105,12 @@ General::General(wxTreebook *book, Preferences *parent): OptionPage(book, parent
|
||||||
|
|
||||||
wxFlexGridSizer *general = PageSizer(_("General"));
|
wxFlexGridSizer *general = PageSizer(_("General"));
|
||||||
OptionAdd(general, _("Check for updates on startup"), "App/Auto/Check For Updates");
|
OptionAdd(general, _("Check for updates on startup"), "App/Auto/Check For Updates");
|
||||||
CellSkip(general);
|
OptionAdd(general, _("Show main toolbar"), "App/Show Toolbar");
|
||||||
|
|
||||||
|
OptionAdd(general, _("Toolbar Icon Size"), "App/Toolbar Icon Size");
|
||||||
wxString autoload_modes[] = { _("Never"), _("Always"), _("Ask") };
|
wxString autoload_modes[] = { _("Never"), _("Always"), _("Ask") };
|
||||||
wxArrayString autoload_modes_arr(3, autoload_modes);
|
wxArrayString autoload_modes_arr(3, autoload_modes);
|
||||||
OptionChoice(general, _("Automatically load linked files"), autoload_modes_arr, "App/Auto/Load Linked Files");
|
OptionChoice(general, _("Automatically load linked files"), autoload_modes_arr, "App/Auto/Load Linked Files");
|
||||||
OptionAdd(general, _("Toolbar Icon Size"), "App/Toolbar Icon Size");
|
|
||||||
OptionAdd(general, _("Undo Levels"), "Limits/Undo Levels", 2);
|
OptionAdd(general, _("Undo Levels"), "Limits/Undo Levels", 2);
|
||||||
|
|
||||||
wxFlexGridSizer *recent = PageSizer(_("Recently Used Lists"));
|
wxFlexGridSizer *recent = PageSizer(_("Recently Used Lists"));
|
||||||
|
|
Loading…
Reference in a new issue