summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Applications/FileManager/main.cpp4
-rw-r--r--Applications/IRCClient/IRCAppWindow.cpp2
-rw-r--r--Applications/SystemMonitor/main.cpp2
-rw-r--r--Applications/TextEditor/TextEditorWidget.cpp2
-rw-r--r--Libraries/LibGUI/GFilePicker.cpp2
-rw-r--r--Libraries/LibGUI/GToolBar.h6
6 files changed, 10 insertions, 8 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp
index 3bee49895f..6a294e1c31 100644
--- a/Applications/FileManager/main.cpp
+++ b/Applications/FileManager/main.cpp
@@ -48,8 +48,8 @@ int main(int argc, char** argv)
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
widget->layout()->set_spacing(0);
- auto* main_toolbar = new GToolBar(widget);
- auto* location_toolbar = new GToolBar(widget);
+ auto main_toolbar = GToolBar::construct(widget);
+ auto location_toolbar = GToolBar::construct(widget);
location_toolbar->layout()->set_margins({ 6, 3, 6, 3 });
location_toolbar->set_preferred_size(0, 25);
diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp
index faec839ccd..b8696da7a0 100644
--- a/Applications/IRCClient/IRCAppWindow.cpp
+++ b/Applications/IRCClient/IRCAppWindow.cpp
@@ -160,7 +160,7 @@ void IRCAppWindow::setup_widgets()
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
widget->layout()->set_spacing(0);
- auto* toolbar = new GToolBar(widget);
+ auto toolbar = GToolBar::construct(widget);
toolbar->set_has_frame(false);
toolbar->add_action(*m_change_nick_action);
toolbar->add_separator();
diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp
index 964232e0fe..fdf1c89d2b 100644
--- a/Applications/SystemMonitor/main.cpp
+++ b/Applications/SystemMonitor/main.cpp
@@ -106,7 +106,7 @@ int main(int argc, char** argv)
process_table_container->layout()->set_margins({ 4, 0, 4, 4 });
process_table_container->layout()->set_spacing(0);
- auto* toolbar = new GToolBar(process_table_container);
+ auto toolbar = GToolBar::construct(process_table_container);
toolbar->set_has_frame(false);
auto* process_table_view = new ProcessTableView(*cpu_graph, process_table_container);
auto* memory_stats_widget = new MemoryStatsWidget(*memory_graph, graphs_container);
diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp
index c98fc39d32..d62b4bdb8e 100644
--- a/Applications/TextEditor/TextEditorWidget.cpp
+++ b/Applications/TextEditor/TextEditorWidget.cpp
@@ -21,7 +21,7 @@ TextEditorWidget::TextEditorWidget()
set_layout(make<GBoxLayout>(Orientation::Vertical));
layout()->set_spacing(0);
- auto* toolbar = new GToolBar(this);
+ auto toolbar = GToolBar::construct(this);
m_editor = GTextEditor::construct(GTextEditor::MultiLine, this);
m_editor->set_ruler_visible(true);
m_editor->set_automatic_indentation_enabled(true);
diff --git a/Libraries/LibGUI/GFilePicker.cpp b/Libraries/LibGUI/GFilePicker.cpp
index 9dd57ee8f8..babccdcbaa 100644
--- a/Libraries/LibGUI/GFilePicker.cpp
+++ b/Libraries/LibGUI/GFilePicker.cpp
@@ -67,7 +67,7 @@ GFilePicker::GFilePicker(Mode mode, const StringView& file_name, const StringVie
upper_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
upper_container->set_preferred_size(0, 26);
- auto* toolbar = new GToolBar(upper_container);
+ auto toolbar = GToolBar::construct(upper_container);
toolbar->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
toolbar->set_preferred_size(85, 0);
toolbar->set_has_frame(false);
diff --git a/Libraries/LibGUI/GToolBar.h b/Libraries/LibGUI/GToolBar.h
index f1cf007a9b..f03d0148bc 100644
--- a/Libraries/LibGUI/GToolBar.h
+++ b/Libraries/LibGUI/GToolBar.h
@@ -8,7 +8,6 @@ class GAction;
class GToolBar : public GWidget {
C_OBJECT(GToolBar)
public:
- explicit GToolBar(GWidget* parent);
virtual ~GToolBar() override;
void add_action(GAction&);
@@ -17,9 +16,12 @@ public:
bool has_frame() const { return m_has_frame; }
void set_has_frame(bool has_frame) { m_has_frame = has_frame; }
-private:
+protected:
+ explicit GToolBar(GWidget* parent);
+
virtual void paint_event(GPaintEvent&) override;
+private:
struct Item {
enum Type {
Invalid,