mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:57:35 +00:00
LibGUI: Remove usages of deprecated implicit conversions
This commit is contained in:
parent
8dd08d47f1
commit
603034759f
5 changed files with 13 additions and 12 deletions
|
@ -411,7 +411,7 @@ void AbstractTableView::layout_headers()
|
||||||
int y = frame_thickness();
|
int y = frame_thickness();
|
||||||
int width = max(content_width(), rect().width() - frame_thickness() * 2 - row_header_width - vertical_scrollbar_width);
|
int width = max(content_width(), rect().width() - frame_thickness() * 2 - row_header_width - vertical_scrollbar_width);
|
||||||
|
|
||||||
column_header().set_relative_rect(x, y, width, column_header().min_size().height());
|
column_header().set_relative_rect(x, y, width, column_header().effective_min_size().height().as_int());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row_header().is_visible()) {
|
if (row_header().is_visible()) {
|
||||||
|
@ -422,7 +422,7 @@ void AbstractTableView::layout_headers()
|
||||||
int y = frame_thickness() + column_header_height - vertical_scrollbar().value();
|
int y = frame_thickness() + column_header_height - vertical_scrollbar().value();
|
||||||
int height = max(content_height(), rect().height() - frame_thickness() * 2 - column_header_height - horizontal_scrollbar_height);
|
int height = max(content_height(), rect().height() - frame_thickness() * 2 - column_header_height - horizontal_scrollbar_height);
|
||||||
|
|
||||||
row_header().set_relative_rect(x, y, row_header().min_size().width(), height);
|
row_header().set_relative_rect(x, y, row_header().effective_min_size().width().as_int(), height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row_header().is_visible() && column_header().is_visible()) {
|
if (row_header().is_visible() && column_header().is_visible()) {
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
void set_tooltip(String const& tooltip)
|
void set_tooltip(String const& tooltip)
|
||||||
{
|
{
|
||||||
m_label->set_text(Gfx::parse_ampersand_string(tooltip));
|
m_label->set_text(Gfx::parse_ampersand_string(tooltip));
|
||||||
int tooltip_width = m_label->min_width() + 10;
|
int tooltip_width = m_label->effective_min_size().width().as_int() + 10;
|
||||||
int line_count = m_label->text().count("\n");
|
int line_count = m_label->text().count("\n");
|
||||||
int glyph_height = m_label->font().glyph_height();
|
int glyph_height = m_label->font().glyph_height();
|
||||||
int tooltip_height = glyph_height * (1 + line_count) + ((glyph_height + 1) / 2) * line_count + 8;
|
int tooltip_height = glyph_height * (1 + line_count) + ((glyph_height + 1) / 2) * line_count + 8;
|
||||||
|
|
|
@ -176,7 +176,8 @@ void MessageBox::build()
|
||||||
int width = (button_count * button_width) + ((button_count - 1) * button_container.layout()->spacing()) + 32;
|
int width = (button_count * button_width) + ((button_count - 1) * button_container.layout()->spacing()) + 32;
|
||||||
width = max(width, text_width + icon_width + 56);
|
width = max(width, text_width + icon_width + 56);
|
||||||
|
|
||||||
set_rect(x(), y(), width, 80 + label.max_height());
|
// FIXME: Use shrink from new layout system
|
||||||
|
set_rect(x(), y(), width, 80 + label.preferred_height());
|
||||||
set_resizable(false);
|
set_resizable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,9 +62,10 @@ void Statusbar::update_segment(size_t index)
|
||||||
segment.set_fixed_width(width);
|
segment.set_fixed_width(width);
|
||||||
}
|
}
|
||||||
} else if (segment.mode() == Segment::Mode::Fixed) {
|
} else if (segment.mode() == Segment::Mode::Fixed) {
|
||||||
if (segment.max_width() != -1)
|
if (segment.max_width().is_int()) {
|
||||||
segment.set_restored_width(segment.max_width());
|
segment.set_restored_width(segment.max_width().as_int());
|
||||||
segment.set_fixed_width(segment.max_width());
|
segment.set_fixed_width(segment.max_width());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (segment.override_text().is_null()) {
|
if (segment.override_text().is_null()) {
|
||||||
|
@ -84,7 +85,7 @@ void Statusbar::update_segment(size_t index)
|
||||||
segment.set_text(segment.override_text());
|
segment.set_text(segment.override_text());
|
||||||
segment.set_frame_shape(Gfx::FrameShape::NoFrame);
|
segment.set_frame_shape(Gfx::FrameShape::NoFrame);
|
||||||
if (segment.mode() != Segment::Mode::Proportional)
|
if (segment.mode() != Segment::Mode::Proportional)
|
||||||
segment.set_fixed_width(-1);
|
segment.set_fixed_width(SpecialDimension::Grow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -723,10 +723,9 @@ void Window::set_main_widget(Widget* widget)
|
||||||
if (m_main_widget) {
|
if (m_main_widget) {
|
||||||
add_child(*widget);
|
add_child(*widget);
|
||||||
auto new_window_rect = rect();
|
auto new_window_rect = rect();
|
||||||
if (m_main_widget->min_width() >= 0)
|
auto new_widget_min_size = m_main_widget->effective_min_size();
|
||||||
new_window_rect.set_width(max(new_window_rect.width(), m_main_widget->min_width()));
|
new_window_rect.set_width(max(new_window_rect.width(), MUST(new_widget_min_size.width().shrink_value())));
|
||||||
if (m_main_widget->min_height() >= 0)
|
new_window_rect.set_height(max(new_window_rect.height(), MUST(new_widget_min_size.height().shrink_value())));
|
||||||
new_window_rect.set_height(max(new_window_rect.height(), m_main_widget->min_height()));
|
|
||||||
set_rect(new_window_rect);
|
set_rect(new_window_rect);
|
||||||
m_main_widget->set_relative_rect({ {}, new_window_rect.size() });
|
m_main_widget->set_relative_rect({ {}, new_window_rect.size() });
|
||||||
m_main_widget->set_window(this);
|
m_main_widget->set_window(this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue