Preferences: Fixes invalidation of the m_settings_layout_changed flag.

+ TopBar: Fixed margins for Settings button and refresh of the PopupButtons
This commit is contained in:
YuSanka 2024-07-18 15:11:34 +02:00 committed by Lukas Matena
parent f004f815ce
commit 795c3a7dd6
2 changed files with 5 additions and 2 deletions

View File

@ -158,6 +158,9 @@ void PreferencesDialog::show(const std::string& highlight_opt_key /*= std::strin
update_color(color_pickres[mode], palette[mode]);
}
// invalidate this flag before show preferences
m_settings_layout_changed = false;
this->ShowModal();
}
@ -787,7 +790,6 @@ void PreferencesDialog::accept(wxEvent&)
if (auto it = m_values.find("seq_top_layer_only"); it != m_values.end())
m_seq_top_layer_only_changed = app_config->get("seq_top_layer_only") != it->second;
m_settings_layout_changed = false;
for (const std::string& key : { "old_settings_layout_mode",
"dlg_settings_layout_mode" })
{

View File

@ -204,6 +204,7 @@ void TopBarItemsCtrl::ButtonWithPopup::SetLabel(const wxString& label)
}
m_label = text;
Refresh();
GetParent()->Layout();
}
@ -421,7 +422,7 @@ TopBarItemsCtrl::TopBarItemsCtrl(wxWindow *parent, TopBarMenus* menus/* = nullpt
if (m_cb_settings_btn) {
m_settings_btn = new Button(this, _L("Settings"/*, "settings"*/));
m_settings_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) { m_cb_settings_btn(); });
left_sizer->Add(m_settings_btn, 0, wxALIGN_CENTER_VERTICAL);
left_sizer->Add(m_settings_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, m_btn_margin);
}
m_buttons_sizer = new wxFlexGridSizer(1, m_btn_margin, m_btn_margin);