Properly hide the status bar at startup
Previously, the status bar was always shown at startup, even if the status bar had been previously disabled. This fixes the issue by hiding the status bar when it is first set up, if needed.
This commit is contained in:
parent
e19e13fa0a
commit
71ca0fb270
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue