mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:57:36 +00:00
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.
This commit is contained in:
parent
ec1e25929e
commit
8dd08d47f1
9 changed files with 14 additions and 16 deletions
|
@ -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 {}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}));
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue