diff options
author | FrHun <28605587+frhun@users.noreply.github.com> | 2022-06-12 22:35:17 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-06-28 17:52:42 +0100 |
commit | 8dd08d47f1ebf7f248be27279d6b3a68e4c3f9a1 (patch) | |
tree | e3b923bcf570a704dff7ed10bbede69b6e11c1ee /Userland | |
parent | ec1e25929e79b34f2f602560280fe5f399bcc5d6 (diff) | |
download | serenity-8dd08d47f1ebf7f248be27279d6b3a68e4c3f9a1.zip |
Applications: Remove usages of deprecated implicit conversions
These deprecated conversions are currently in place to make the system
compile, but they are to be removed soon. This prepares that.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Demos/WidgetGallery/GalleryGML/SlidersTab.gml | 2 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/HackStudioWidget.cpp | 2 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/TimelineContainer.cpp | 14 | ||||
-rw-r--r-- | Userland/Games/Hearts/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Games/Minesweeper/Field.cpp | 2 | ||||
-rw-r--r-- | Userland/Games/Minesweeper/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Games/Solitaire/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Games/Spider/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/Taskbar/ClockWidget.cpp | 2 |
9 files changed, 14 insertions, 16 deletions
diff --git a/Userland/Demos/WidgetGallery/GalleryGML/SlidersTab.gml b/Userland/Demos/WidgetGallery/GalleryGML/SlidersTab.gml index 098736b78c..fef57a9eec 100644 --- a/Userland/Demos/WidgetGallery/GalleryGML/SlidersTab.gml +++ b/Userland/Demos/WidgetGallery/GalleryGML/SlidersTab.gml @@ -61,7 +61,6 @@ @GUI::Scrollbar { name: "enabled_scrollbar" fixed_height: 16 - fixed_width: -1 min: 0 max: 100 value: 50 @@ -76,7 +75,6 @@ @GUI::Scrollbar { name: "disabled_scrollbar" fixed_height: 16 - fixed_width: -1 } @GUI::Layout::Spacer {} diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index d63ba895e8..7f84e59d57 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -945,7 +945,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_add_terminal_action() void HackStudioWidget::reveal_action_tab(GUI::Widget& widget) { - if (m_action_tab_widget->min_height() < 200) + if (m_action_tab_widget->effective_min_size().height().as_int() < 200) m_action_tab_widget->set_fixed_height(200); m_action_tab_widget->set_active_widget(&widget); } diff --git a/Userland/DevTools/Profiler/TimelineContainer.cpp b/Userland/DevTools/Profiler/TimelineContainer.cpp index 5d54f4e114..65cfc60c4b 100644 --- a/Userland/DevTools/Profiler/TimelineContainer.cpp +++ b/Userland/DevTools/Profiler/TimelineContainer.cpp @@ -23,7 +23,7 @@ TimelineContainer::TimelineContainer(GUI::Widget& header_container, TimelineView update_widget_sizes(); update_widget_positions(); - int initial_height = min(300, timeline_view.height() + horizontal_scrollbar().max_height() + frame_thickness() * 2); + int initial_height = min(300, timeline_view.height() + 16 + frame_thickness() * 2); set_fixed_height(initial_height); m_timeline_view->on_scale_change = [this] { @@ -48,16 +48,16 @@ void TimelineContainer::update_widget_sizes() { { m_timeline_view->do_layout(); - auto preferred_size = m_timeline_view->layout()->preferred_size(); - m_timeline_view->resize(preferred_size); - set_content_size(preferred_size); + auto preferred_size = m_timeline_view->effective_preferred_size(); + m_timeline_view->resize(Gfx::IntSize(preferred_size)); + set_content_size(Gfx::IntSize(preferred_size)); } { m_header_container->do_layout(); - auto preferred_size = m_header_container->layout()->preferred_size(); - m_header_container->resize(preferred_size); - set_size_occupied_by_fixed_elements({ preferred_size.width(), 0 }); + auto preferred_size = m_header_container->effective_preferred_size(); + m_header_container->resize(Gfx::IntSize(preferred_size)); + set_size_occupied_by_fixed_elements({ preferred_size.width().as_int(), 0 }); } } diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp index 3ce2a8c0a4..b73081f1bb 100644 --- a/Userland/Games/Hearts/main.cpp +++ b/Userland/Games/Hearts/main.cpp @@ -104,7 +104,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Hearts", app_icon, window))); window->set_resizable(false); - window->resize(Hearts::Game::width, Hearts::Game::height + statusbar.max_height()); + window->resize(Hearts::Game::width, Hearts::Game::height + statusbar.max_height().as_int()); window->set_icon(app_icon.bitmap_for_size(16)); window->show(); game.setup(player_name); diff --git a/Userland/Games/Minesweeper/Field.cpp b/Userland/Games/Minesweeper/Field.cpp index 09bf9dc394..df88e1e0a3 100644 --- a/Userland/Games/Minesweeper/Field.cpp +++ b/Userland/Games/Minesweeper/Field.cpp @@ -518,7 +518,7 @@ void Field::set_field_size(Difficulty difficulty, size_t rows, size_t columns, s m_mine_count = mine_count; set_fixed_size(frame_thickness() * 2 + m_columns * square_size(), frame_thickness() * 2 + m_rows * square_size()); reset(); - m_on_size_changed(min_size()); + m_on_size_changed(Gfx::IntSize(min_size())); } void Field::set_single_chording(bool enabled) diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp index 94a90595fd..78e786eddf 100644 --- a/Userland/Games/Minesweeper/main.cpp +++ b/Userland/Games/Minesweeper/main.cpp @@ -90,7 +90,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) container->layout()->add_spacer(); auto field = TRY(widget->try_add<Field>(flag_label, time_label, face_button, [&](auto size) { - size.set_height(size.height() + container->min_size().height()); + size.set_height(size.height() + container->min_size().height().as_int()); window->resize(size); })); diff --git a/Userland/Games/Solitaire/main.cpp b/Userland/Games/Solitaire/main.cpp index a900574f74..663869ee8b 100644 --- a/Userland/Games/Solitaire/main.cpp +++ b/Userland/Games/Solitaire/main.cpp @@ -206,7 +206,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Solitaire", app_icon, window))); window->set_resizable(false); - window->resize(Solitaire::Game::width, Solitaire::Game::height + statusbar.max_height()); + window->resize(Solitaire::Game::width, Solitaire::Game::height + statusbar.max_height().as_int()); window->set_icon(app_icon.bitmap_for_size(16)); window->show(); diff --git a/Userland/Games/Spider/main.cpp b/Userland/Games/Spider/main.cpp index db67616b80..00db82211f 100644 --- a/Userland/Games/Spider/main.cpp +++ b/Userland/Games/Spider/main.cpp @@ -268,7 +268,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) help_menu->add_action(GUI::CommonActions::make_about_action("Spider", app_icon, window)); window->set_resizable(false); - window->resize(Spider::Game::width, Spider::Game::height + statusbar.max_height()); + window->resize(Spider::Game::width, Spider::Game::height + statusbar.max_height().as_int()); window->set_icon(app_icon.bitmap_for_size(16)); window->show(); diff --git a/Userland/Services/Taskbar/ClockWidget.cpp b/Userland/Services/Taskbar/ClockWidget.cpp index abbf982df9..4858105247 100644 --- a/Userland/Services/Taskbar/ClockWidget.cpp +++ b/Userland/Services/Taskbar/ClockWidget.cpp @@ -178,7 +178,7 @@ void ClockWidget::paint_event(GUI::PaintEvent& event) Gfx::Font const& font = Gfx::FontDatabase::default_font(); int const frame_width = frame_thickness(); int const ideal_width = m_time_width; - int const widget_width = max_width(); + int const widget_width = max_width().as_int(); int const translation_x = (widget_width - ideal_width) / 2 - frame_width; painter.draw_text(frame_inner_rect().translated(translation_x, frame_width), time_text, font, Gfx::TextAlignment::CenterLeft, palette().window_text()); |