diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 63421882..59a3b801 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -846,7 +846,7 @@ MainFrame::MainFrame() #endif keep_on_top_styler_(this), status_bar_observer_(config::OptionID::kGenStatusBar, - std::bind(&MainFrame::OnStatusBarChanged, this, std::placeholders::_1)) { + std::bind(&MainFrame::OnStatusBarChanged, this)) { jpoll = new JoystickPoller(); this->Connect(wxID_ANY, wxEVT_SHOW, wxShowEventHandler(JoystickPoller::ShowDialog), jpoll, jpoll); } @@ -857,12 +857,14 @@ MainFrame::~MainFrame() { #endif } -void MainFrame::OnStatusBarChanged(config::Option* option) { - if (option->GetBool()) - GetStatusBar()->Show(); - else - GetStatusBar()->Hide(); +void MainFrame::SetStatusBar(wxStatusBar* menu_bar) { + wxFrame::SetStatusBar(menu_bar); + // This will take care of hiding the menu bar at startup, if needed. + menu_bar->Show(OPTION(kGenStatusBar)); +} +void MainFrame::OnStatusBarChanged() { + GetStatusBar()->Show(OPTION(kGenStatusBar)); SendSizeEvent(); panel->AdjustSize(false); SendSizeEvent(); diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index 04e18c87..85ec2a05 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -362,11 +362,14 @@ private: const widgets::KeepOnTopStyler keep_on_top_styler_; const config::OptionsObserver status_bar_observer_; + // wxFrame override. + void SetStatusBar(wxStatusBar* menuBar) override; + // helper function for adding menu to accel editor void add_menu_accels(wxTreeCtrl* tc, wxTreeItemId& parent, wxMenu* menu); // For enabling / disabling the status bar. - void OnStatusBarChanged(config::Option* option); + void OnStatusBarChanged(); // for detecting window focus void OnActivate(wxActivateEvent&); // may work, may not... if so, load dropped file