1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 10:05:10 +00:00

LibGUI: Add a simple GSplitter container widget.

This allows you to put multiple widgets in a container and makes the space
in between them draggable to resize the two adjacent widgets.
This commit is contained in:
Andreas Kling 2019-03-30 13:53:30 +01:00
parent f242d6e559
commit 9538c06a45
6 changed files with 127 additions and 4 deletions

View file

@ -13,6 +13,7 @@
#include <LibGUI/GProgressBar.h>
#include <LibGUI/GTreeView.h>
#include <LibGUI/GFileSystemModel.h>
#include <LibGUI/GSplitter.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
@ -50,9 +51,7 @@ int main(int argc, char** argv)
auto* location_textbox = new GTextEditor(GTextEditor::SingleLine, location_toolbar);
// FIXME: Implement an actual GSplitter widget.
auto* splitter = new GWidget(widget);
splitter->set_layout(make<GBoxLayout>(Orientation::Horizontal));
auto* splitter = new GSplitter(Orientation::Horizontal, widget);
auto* tree_view = new GTreeView(splitter);
auto file_system_model = GFileSystemModel::create("/", GFileSystemModel::Mode::DirectoriesOnly);
tree_view->set_model(file_system_model.copy_ref());