mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 08:18:49 +00:00
LibGUI: Convert GWidget to ObjectPtr
This commit is contained in:
parent
e4e92980a1
commit
ff6ce422dd
Notes:
sideshowbarker
2024-07-19 12:01:44 +09:00
Author: https://github.com/awesomekling
Commit: ff6ce422dd
41 changed files with 115 additions and 107 deletions
|
@ -50,7 +50,7 @@ bool GMessageBox::should_include_cancel_button() const
|
|||
|
||||
void GMessageBox::build()
|
||||
{
|
||||
auto* widget = new GWidget;
|
||||
auto widget = GWidget::construct();
|
||||
set_main_widget(widget);
|
||||
|
||||
int text_width = widget->font().width(m_text);
|
||||
|
@ -62,9 +62,9 @@ void GMessageBox::build()
|
|||
widget->layout()->set_margins({ 0, 15, 0, 15 });
|
||||
widget->layout()->set_spacing(15);
|
||||
|
||||
GWidget* message_container = widget;
|
||||
ObjectPtr<GWidget> message_container = widget;
|
||||
if (m_type != Type::None) {
|
||||
message_container = new GWidget(widget);
|
||||
message_container = GWidget::construct(widget);
|
||||
message_container->set_layout(make<GBoxLayout>(Orientation::Horizontal));
|
||||
message_container->layout()->set_margins({ 8, 0, 8, 0 });
|
||||
message_container->layout()->set_spacing(8);
|
||||
|
@ -80,7 +80,7 @@ void GMessageBox::build()
|
|||
label->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
label->set_preferred_size(text_width, 16);
|
||||
|
||||
auto* button_container = new GWidget(widget);
|
||||
auto button_container = GWidget::construct(widget);
|
||||
button_container->set_layout(make<GBoxLayout>(Orientation::Horizontal));
|
||||
button_container->layout()->set_spacing(5);
|
||||
button_container->layout()->set_margins({ 15, 0, 15, 0 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue