1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:58:12 +00:00

LibGUI: Set a fixed width for the SettingsWindow reset-to-default button

Otherwise, any subclass which increased the size of the window would see
a very large reset button. The width chosen here is the same width as
the other buttons in this window.
This commit is contained in:
Timothy Flynn 2022-02-01 14:50:30 -05:00 committed by Andreas Kling
parent 2560d0b9ad
commit 7b41a09540

View file

@ -39,6 +39,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(String title, Show
if (show_defaults_button == ShowDefaultsButton::Yes) {
window->m_reset_button = TRY(button_container->try_add<GUI::Button>("Defaults"));
window->m_reset_button->set_fixed_width(75);
window->m_reset_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) mutable {
for (auto& tab : window->m_tabs) {
tab.reset_default_values();