mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:27:45 +00:00
LibGUI: Convert remaining random little things to ObjectPtr
This commit is contained in:
parent
81a5c4fc56
commit
409494193e
11 changed files with 15 additions and 13 deletions
|
@ -22,7 +22,7 @@ int main(int argc, char** argv)
|
|||
widget->set_fill_with_background_color(true);
|
||||
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
|
||||
auto* board_combo = new GComboBox(widget);
|
||||
auto board_combo = GComboBox::construct(widget);
|
||||
board_combo->set_only_allow_values_from_model(true);
|
||||
board_combo->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
board_combo->set_preferred_size(0, 20);
|
||||
|
|
|
@ -23,10 +23,10 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Font>&& edited_fon
|
|||
else
|
||||
m_path = path;
|
||||
|
||||
m_glyph_map_widget = new GlyphMapWidget(*m_edited_font, this);
|
||||
m_glyph_map_widget = GlyphMapWidget::construct(*m_edited_font, this);
|
||||
m_glyph_map_widget->move_to({ 90, 5 });
|
||||
|
||||
m_glyph_editor_widget = new GlyphEditorWidget(*m_edited_font, this);
|
||||
m_glyph_editor_widget = GlyphEditorWidget::construct(*m_edited_font, this);
|
||||
m_glyph_editor_widget->move_to({ 5, 5 });
|
||||
|
||||
m_ui = make<UI_FontEditorBottom>();
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#include <LibGUI/GFrame.h>
|
||||
|
||||
class GlyphEditorWidget final : public GFrame {
|
||||
C_OBJECT(GlyphEditorWidget)
|
||||
public:
|
||||
GlyphEditorWidget(Font&, GWidget* parent);
|
||||
virtual ~GlyphEditorWidget() override;
|
||||
|
||||
u8 glyph() const { return m_glyph; }
|
||||
|
@ -18,6 +18,7 @@ public:
|
|||
Function<void(u8)> on_glyph_altered;
|
||||
|
||||
private:
|
||||
GlyphEditorWidget(Font&, GWidget* parent);
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void mousedown_event(GMouseEvent&) override;
|
||||
virtual void mousemove_event(GMouseEvent&) override;
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include <LibGUI/GFrame.h>
|
||||
|
||||
class GlyphMapWidget final : public GFrame {
|
||||
C_OBJECT(GlyphMapWidget)
|
||||
public:
|
||||
GlyphMapWidget(Font&, GWidget* parent);
|
||||
virtual ~GlyphMapWidget() override;
|
||||
|
||||
u8 selected_glyph() const { return m_selected_glyph; }
|
||||
|
@ -25,6 +25,7 @@ public:
|
|||
Function<void(u8)> on_glyph_selected;
|
||||
|
||||
private:
|
||||
GlyphMapWidget(Font&, GWidget* parent);
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void mousedown_event(GMouseEvent&) override;
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ void IRCAppWindow::setup_widgets()
|
|||
set_active_window(m_client.window_at(index.row()));
|
||||
};
|
||||
|
||||
m_container = new GStackWidget(horizontal_container);
|
||||
m_container = GStackWidget::construct(horizontal_container);
|
||||
m_container->on_active_widget_change = [this](auto*) {
|
||||
update_part_action();
|
||||
};
|
||||
|
|
|
@ -27,7 +27,7 @@ private:
|
|||
|
||||
IRCWindow& create_window(void* owner, IRCWindow::Type, const String& name);
|
||||
IRCClient m_client;
|
||||
GStackWidget* m_container { nullptr };
|
||||
ObjectPtr<GStackWidget> m_container;
|
||||
ObjectPtr<GTableView> m_window_list;
|
||||
RefPtr<GAction> m_join_action;
|
||||
RefPtr<GAction> m_part_action;
|
||||
|
|
|
@ -107,7 +107,7 @@ int main(int argc, char** argv)
|
|||
menu->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
||||
menu->set_preferred_size(200, 0);
|
||||
|
||||
auto* stack = new GStackWidget(main_section);
|
||||
auto stack = GStackWidget::construct(main_section);
|
||||
stack->set_size_policy(SizePolicy::Fill, SizePolicy::Fill);
|
||||
|
||||
for (auto& page : pages) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue