Apps+Demos+Dialogs: Remove unnecessary minimum window sizes

The new layout system conveniently calculates these for us now.
In the case of Mandelbrot where it needs to be overriden, make
sure to disable obey min widget size first. In EmojiInputDialog's
case, the window needs to be resized instead to center correctly.
This commit is contained in:
thankyouverycool 2022-08-17 19:38:46 -04:00 committed by Andreas Kling
parent 46d6347035
commit f833473df0
Notes: sideshowbarker 2024-07-17 07:47:36 +09:00
5 changed files with 2 additions and 5 deletions

View File

@ -35,7 +35,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::Window::try_create());
window->set_title("Calendar");
window->resize(600, 480);
window->set_minimum_size(171, 141);
window->set_icon(app_icon.bitmap_for_size(16));
auto main_widget = TRY(window->try_set_main_widget<GUI::Widget>());

View File

@ -29,7 +29,6 @@ SoundPlayerWidgetAdvancedView::SoundPlayerWidgetAdvancedView(GUI::Window& window
, m_window(window)
{
window.resize(455, 350);
window.set_minimum_size(600, 130);
window.set_resizable(true);
set_fill_with_background_color(true);

View File

@ -30,9 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::Window::try_create());
window->resize(480, 250);
window->center_on_screen();
window->set_title("Welcome");
window->set_minimum_size(480, 250);
window->set_icon(app_icon.bitmap_for_size(16));
auto welcome_widget = TRY(window->try_set_main_widget<WelcomeWidget>());

View File

@ -409,6 +409,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::Window::try_create());
window->set_double_buffering_enabled(false);
window->set_title("Mandelbrot");
window->set_obey_widget_min_size(false);
window->set_minimum_size(320, 240);
window->resize(window->minimum_size() * 2);
auto mandelbrot = TRY(window->try_set_main_widget<Mandelbrot>());

View File

@ -62,7 +62,7 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window)
int dialog_width = button_size * columns + magic_offset;
int dialog_height = button_size * rows;
set_minimum_size(dialog_width, dialog_height);
resize(dialog_width, dialog_height);
set_frameless(true);
for (size_t row = 0; row < rows && index < code_points.size(); ++row) {