mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 07:18:13 +00:00
LibGUI: Convert GWidget to ObjectPtr
This commit is contained in:
parent
e4e92980a1
commit
ff6ce422dd
41 changed files with 115 additions and 107 deletions
|
@ -75,7 +75,7 @@ void DisplayPropertiesWidget::create_resolution_list()
|
|||
|
||||
void DisplayPropertiesWidget::create_root_widget()
|
||||
{
|
||||
m_root_widget = new GWidget;
|
||||
m_root_widget = GWidget::construct();
|
||||
m_root_widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
m_root_widget->set_fill_with_background_color(true);
|
||||
m_root_widget->layout()->set_margins({ 4, 4, 4, 16 });
|
||||
|
@ -97,7 +97,7 @@ void DisplayPropertiesWidget::create_frame()
|
|||
auto background_splitter = GSplitter::construct(Orientation::Vertical, nullptr);
|
||||
tab_widget->add_widget("Wallpaper", background_splitter);
|
||||
|
||||
auto* background_content = new GWidget(background_splitter);
|
||||
auto background_content = GWidget::construct(background_splitter);
|
||||
background_content->set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
background_content->layout()->set_margins({ 4, 4, 4, 4 });
|
||||
|
||||
|
@ -120,7 +120,7 @@ void DisplayPropertiesWidget::create_frame()
|
|||
auto settings_splitter = GSplitter::construct(Orientation::Vertical, nullptr);
|
||||
tab_widget->add_widget("Settings", settings_splitter);
|
||||
|
||||
auto* settings_content = new GWidget(settings_splitter);
|
||||
auto settings_content = GWidget::construct(settings_splitter);
|
||||
settings_content->set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
settings_content->layout()->set_margins({ 4, 4, 4, 4 });
|
||||
|
||||
|
@ -135,7 +135,7 @@ void DisplayPropertiesWidget::create_frame()
|
|||
settings_content->layout()->add_spacer();
|
||||
|
||||
// Add the apply and cancel buttons
|
||||
auto* bottom_widget = new GWidget(m_root_widget);
|
||||
auto bottom_widget = GWidget::construct(m_root_widget);
|
||||
bottom_widget->set_layout(make<GBoxLayout>(Orientation::Horizontal));
|
||||
bottom_widget->layout()->add_spacer();
|
||||
bottom_widget->set_size_policy(Orientation::Vertical, SizePolicy::Fixed);
|
||||
|
|
|
@ -29,7 +29,8 @@ public:
|
|||
void send_settings_to_window_server(int tabIndex);
|
||||
void create_frame();
|
||||
|
||||
inline GWidget* get_root_widget() const { return m_root_widget; }
|
||||
const GWidget* root_widget() const { return m_root_widget; }
|
||||
GWidget* root_widget() { return m_root_widget; }
|
||||
|
||||
private:
|
||||
void create_wallpaper_list();
|
||||
|
@ -39,7 +40,7 @@ private:
|
|||
private:
|
||||
String m_wallpaper_path;
|
||||
RefPtr<CConfigFile> m_wm_config;
|
||||
GWidget* m_root_widget { nullptr };
|
||||
ObjectPtr<GWidget> m_root_widget;
|
||||
Vector<Size> m_resolutions;
|
||||
Vector<String> m_wallpapers;
|
||||
ObjectPtr<GLabel> m_wallpaper_preview;
|
||||
|
|
|
@ -14,7 +14,7 @@ int main(int argc, char** argv)
|
|||
window->set_title("Display Properties");
|
||||
window->resize(400, 448);
|
||||
window->set_resizable(false);
|
||||
window->set_main_widget(instance.get_root_widget());
|
||||
window->set_main_widget(instance.root_widget());
|
||||
window->set_icon(load_png("/res/icons/16x16/app-display-properties.png"));
|
||||
|
||||
window->show();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue