mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
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:
parent
46d6347035
commit
f833473df0
Notes:
sideshowbarker
2024-07-17 07:47:36 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/f833473df0 Pull-request: https://github.com/SerenityOS/serenity/pull/15009 Issue: https://github.com/SerenityOS/serenity/issues/10970 Issue: https://github.com/SerenityOS/serenity/issues/13036
@ -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>());
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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>());
|
||||
|
||||
|
@ -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>());
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user