1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

LibGUI: Add a ToolBarContainer widget and put most ToolBars in one

This mimics the Explorer toolbar container from Windows 2000 and looks
pretty neat! :^)
This commit is contained in:
Andreas Kling 2020-04-23 17:44:49 +02:00
parent 5b6c2f3bd6
commit ab336e895f
12 changed files with 179 additions and 18 deletions

View file

@ -46,15 +46,18 @@
#include <LibGUI/TextBox.h>
#include <LibGUI/TextEditor.h>
#include <LibGUI/ToolBar.h>
#include <LibGUI/ToolBarContainer.h>
#include <LibGfx/Font.h>
#include <string.h>
TextEditorWidget::TextEditorWidget()
{
set_fill_with_background_color(true);
set_layout<GUI::VerticalBoxLayout>();
layout()->set_spacing(0);
layout()->set_spacing(2);
auto& toolbar = add<GUI::ToolBar>();
auto& toolbar_container = add<GUI::ToolBarContainer>();
auto& toolbar = toolbar_container.add<GUI::ToolBar>();
m_editor = add<GUI::TextEditor>();
m_editor->set_ruler_visible(true);
m_editor->set_automatic_indentation_enabled(true);