diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 16:11:02 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 16:11:02 +0200 |
commit | 4f4438c04c8cd5d52e367d1fda65b469c72c75c4 (patch) | |
tree | da99e71981526bb4c30ae119f225bf1bda142a51 | |
parent | efb8f9d538724d5ee7420f055f049498021e7551 (diff) | |
download | serenity-4f4438c04c8cd5d52e367d1fda65b469c72c75c4.zip |
LibGUI: Convert GSplitter to ObjectPtr
-rw-r--r-- | Applications/DisplayProperties/DisplayProperties.cpp | 4 | ||||
-rw-r--r-- | Applications/FileManager/main.cpp | 2 | ||||
-rw-r--r-- | Applications/IRCClient/IRCAppWindow.cpp | 2 | ||||
-rw-r--r-- | Applications/IRCClient/IRCWindow.cpp | 2 | ||||
-rw-r--r-- | Applications/SystemMonitor/main.cpp | 2 | ||||
-rw-r--r-- | DevTools/Inspector/main.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GSplitter.h | 4 |
7 files changed, 10 insertions, 8 deletions
diff --git a/Applications/DisplayProperties/DisplayProperties.cpp b/Applications/DisplayProperties/DisplayProperties.cpp index a21caba385..5ccb2f0b13 100644 --- a/Applications/DisplayProperties/DisplayProperties.cpp +++ b/Applications/DisplayProperties/DisplayProperties.cpp @@ -94,7 +94,7 @@ void DisplayPropertiesWidget::create_frame() auto* tab_widget = new GTabWidget(m_root_widget); // First, let's create the "Background" tab - auto* background_splitter = new GSplitter(Orientation::Vertical, nullptr); + auto background_splitter = GSplitter::construct(Orientation::Vertical, nullptr); tab_widget->add_widget("Wallpaper", background_splitter); auto* background_content = new GWidget(background_splitter); @@ -117,7 +117,7 @@ void DisplayPropertiesWidget::create_frame() }; // Let's add the settings tab - auto* settings_splitter = new GSplitter(Orientation::Vertical, nullptr); + auto settings_splitter = GSplitter::construct(Orientation::Vertical, nullptr); tab_widget->add_widget("Settings", settings_splitter); auto* settings_content = new GWidget(settings_splitter); diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index c7530435b3..3bee49895f 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char** argv) auto location_textbox = GTextEditor::construct(GTextEditor::SingleLine, location_toolbar); - auto* splitter = new GSplitter(Orientation::Horizontal, widget); + auto splitter = GSplitter::construct(Orientation::Horizontal, widget); auto tree_view = GTreeView::construct(splitter); auto file_system_model = GFileSystemModel::create("/", GFileSystemModel::Mode::DirectoriesOnly); tree_view->set_model(file_system_model); diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp index 201fd2b0df..faec839ccd 100644 --- a/Applications/IRCClient/IRCAppWindow.cpp +++ b/Applications/IRCClient/IRCAppWindow.cpp @@ -175,7 +175,7 @@ void IRCAppWindow::setup_widgets() outer_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); outer_container->layout()->set_margins({ 2, 0, 2, 2 }); - auto* horizontal_container = new GSplitter(Orientation::Horizontal, outer_container); + auto horizontal_container = GSplitter::construct(Orientation::Horizontal, outer_container); m_window_list = GTableView::construct(horizontal_container); m_window_list->set_headers_visible(false); diff --git a/Applications/IRCClient/IRCWindow.cpp b/Applications/IRCClient/IRCWindow.cpp index 64d0db3063..0c08206e54 100644 --- a/Applications/IRCClient/IRCWindow.cpp +++ b/Applications/IRCClient/IRCWindow.cpp @@ -19,7 +19,7 @@ IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& na set_layout(make<GBoxLayout>(Orientation::Vertical)); // Make a container for the log buffer view + (optional) member list. - auto* container = new GSplitter(Orientation::Horizontal, this); + auto container = GSplitter::construct(Orientation::Horizontal, this); m_table_view = GTableView::construct(container); m_table_view->set_size_columns_to_fit_content(true); diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp index c0bb1bf4af..587812a1d2 100644 --- a/Applications/SystemMonitor/main.cpp +++ b/Applications/SystemMonitor/main.cpp @@ -55,7 +55,7 @@ int main(int argc, char** argv) auto* tabwidget = new GTabWidget(keeper); - auto* process_container_splitter = new GSplitter(Orientation::Vertical, nullptr); + auto process_container_splitter = GSplitter::construct(Orientation::Vertical, nullptr); tabwidget->add_widget("Processes", process_container_splitter); auto* process_table_container = new GWidget(process_container_splitter); diff --git a/DevTools/Inspector/main.cpp b/DevTools/Inspector/main.cpp index c2d20710e5..892f482acb 100644 --- a/DevTools/Inspector/main.cpp +++ b/DevTools/Inspector/main.cpp @@ -37,7 +37,7 @@ int main(int argc, char** argv) widget->set_fill_with_background_color(true); widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); - auto* splitter = new GSplitter(Orientation::Horizontal, widget); + auto splitter = GSplitter::construct(Orientation::Horizontal, widget); RemoteProcess remote_process(pid); diff --git a/Libraries/LibGUI/GSplitter.h b/Libraries/LibGUI/GSplitter.h index dac51ebc92..6efb040e33 100644 --- a/Libraries/LibGUI/GSplitter.h +++ b/Libraries/LibGUI/GSplitter.h @@ -3,11 +3,13 @@ #include <LibGUI/GFrame.h> class GSplitter : public GFrame { + C_OBJECT(GSplitter) public: - GSplitter(Orientation, GWidget* parent); virtual ~GSplitter() override; protected: + GSplitter(Orientation, GWidget* parent); + virtual void mousedown_event(GMouseEvent&) override; virtual void mousemove_event(GMouseEvent&) override; virtual void mouseup_event(GMouseEvent&) override; |