1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:27:35 +00:00

LibGUI: Add HorizontalSplitter and VerticalSplitter convenience classes

This commit is contained in:
Andreas Kling 2020-02-06 14:40:59 +01:00
parent 8bb75084fd
commit 6a71ba1deb
10 changed files with 37 additions and 13 deletions

View file

@ -39,7 +39,7 @@ InspectorWidget::InspectorWidget(GUI::Widget* parent)
: GUI::Widget(parent)
{
set_layout(make<GUI::VBoxLayout>());
auto splitter = GUI::Splitter::construct(Orientation::Vertical, this);
auto splitter = GUI::VerticalSplitter::construct(this);
m_dom_tree_view = GUI::TreeView::construct(splitter);
m_dom_tree_view->on_selection = [this](auto& index) {
auto* node = static_cast<Node*>(index.internal_data());

View file

@ -125,7 +125,7 @@ void DisplayPropertiesWidget::create_frame()
auto tab_widget = GUI::TabWidget::construct(m_root_widget);
// First, let's create the "Background" tab
auto background_splitter = GUI::Splitter::construct(Orientation::Vertical, nullptr);
auto background_splitter = GUI::VerticalSplitter::construct(nullptr);
tab_widget->add_widget("Wallpaper", background_splitter);
auto background_content = GUI::Widget::construct(background_splitter.ptr());
@ -155,7 +155,7 @@ void DisplayPropertiesWidget::create_frame()
};
// Let's add the settings tab
auto settings_splitter = GUI::Splitter::construct(Orientation::Vertical, nullptr);
auto settings_splitter = GUI::VerticalSplitter::construct(nullptr);
tab_widget->add_widget("Settings", settings_splitter);
auto settings_content = GUI::Widget::construct(settings_splitter.ptr());

View file

@ -103,7 +103,7 @@ int main(int argc, char** argv)
auto location_textbox = GUI::TextEditor::construct(GUI::TextEditor::SingleLine, location_toolbar);
auto splitter = GUI::Splitter::construct(Orientation::Horizontal, widget);
auto splitter = GUI::HorizontalSplitter::construct(widget);
auto tree_view = GUI::TreeView::construct(splitter);
auto directories_model = GUI::FileSystemModel::create("/", GUI::FileSystemModel::Mode::DirectoriesOnly);
tree_view->set_model(directories_model);

View file

@ -83,7 +83,7 @@ int main(int argc, char* argv[])
auto toolbar = GUI::ToolBar::construct(widget);
auto splitter = GUI::Splitter::construct(Orientation::Horizontal, widget);
auto splitter = GUI::HorizontalSplitter::construct(widget);
auto model = ManualModel::create();

View file

@ -199,7 +199,7 @@ void IRCAppWindow::setup_widgets()
outer_container->set_layout(make<GUI::VBoxLayout>());
outer_container->layout()->set_margins({ 2, 0, 2, 2 });
auto horizontal_container = GUI::Splitter::construct(Orientation::Horizontal, outer_container);
auto horizontal_container = GUI::HorizontalSplitter::construct(outer_container);
m_window_list = GUI::TableView::construct(horizontal_container);
m_window_list->set_headers_visible(false);

View file

@ -45,7 +45,7 @@ IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& na
set_layout(make<GUI::VBoxLayout>());
// Make a container for the log buffer view + (optional) member list.
auto container = GUI::Splitter::construct(Orientation::Horizontal, this);
auto container = GUI::HorizontalSplitter::construct(this);
m_html_view = HtmlView::construct(container);

View file

@ -121,7 +121,7 @@ int main(int argc, char** argv)
auto tabwidget = GUI::TabWidget::construct(keeper);
auto process_container_splitter = GUI::Splitter::construct(Orientation::Vertical, nullptr);
auto process_container_splitter = GUI::VerticalSplitter::construct(nullptr);
tabwidget->add_widget("Processes", process_container_splitter);
auto process_table_container = GUI::Widget::construct(process_container_splitter.ptr());