Add option to hide the main toolbar. Updates #1399.

Originally committed to SVN as r6340.
This commit is contained in:
Thomas Goyne 2012-01-22 23:44:24 +00:00
parent c8099decf3
commit 1f8005d8d1
4 changed files with 22 additions and 6 deletions

View File

@ -241,11 +241,24 @@ FrameMain::~FrameMain () {
SubsGrid->Destroy();
}
/// @brief Initialize toolbar
void FrameMain::InitToolbar () {
void FrameMain::InitToolbar() {
wxSystemOptions::SetOption("msw.remap", 0);
toolbar::AttachToolbar(this, "main", context.get(), "Default");
GetToolBar()->Realize();
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");
GetToolBar()->Realize();
}
}
else if (wxToolBar *old_tb = GetToolBar()) {
SetToolBar(0);
delete old_tb;
Layout();
}
}
void FrameMain::InitContents() {

View File

@ -113,6 +113,8 @@ class FrameMain: public wxFrame {
void OnSubtitlesOpen();
void EnableToolBar(agi::OptionValue const& opt);
SubtitlesGrid *SubsGrid; ///< The subtitle editing area
AudioBox *audioBox; ///< The audio area
VideoBox *videoBox; ///< The video area

View File

@ -13,6 +13,7 @@
"Locale" : -1,
"Maximized" : false,
"Save Charset" : "UTF-8",
"Show Toolbar" : true,
"Toolbar Icon Size" : 16
},

View File

@ -105,12 +105,12 @@ General::General(wxTreebook *book, Preferences *parent): OptionPage(book, parent
wxFlexGridSizer *general = PageSizer(_("General"));
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") };
wxArrayString autoload_modes_arr(3, autoload_modes);
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);
wxFlexGridSizer *recent = PageSizer(_("Recently Used Lists"));