mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibGUI: Convert GSplitter to ObjectPtr
This commit is contained in:
parent
efb8f9d538
commit
4f4438c04c
Notes:
sideshowbarker
2024-07-19 12:02:06 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4f4438c04c8
7 changed files with 10 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue