mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:27:35 +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:
parent
5b6c2f3bd6
commit
ab336e895f
12 changed files with 179 additions and 18 deletions
|
@ -52,6 +52,7 @@
|
|||
#include <LibGUI/StatusBar.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibGUI/ToolBar.h>
|
||||
#include <LibGUI/ToolBarContainer.h>
|
||||
#include <LibGUI/TreeView.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
@ -237,12 +238,14 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
|
||||
auto& widget = window->set_main_widget<GUI::Widget>();
|
||||
widget.set_layout<GUI::VerticalBoxLayout>();
|
||||
widget.layout()->set_spacing(0);
|
||||
widget.set_fill_with_background_color(true);
|
||||
widget.layout()->set_spacing(2);
|
||||
|
||||
auto& main_toolbar = widget.add<GUI::ToolBar>();
|
||||
auto& location_toolbar = widget.add<GUI::ToolBar>();
|
||||
auto& toolbar_container = widget.add<GUI::ToolBarContainer>();
|
||||
|
||||
auto& main_toolbar = toolbar_container.add<GUI::ToolBar>();
|
||||
auto& location_toolbar = toolbar_container.add<GUI::ToolBar>();
|
||||
location_toolbar.layout()->set_margins({ 6, 3, 6, 3 });
|
||||
location_toolbar.set_preferred_size(0, 25);
|
||||
|
||||
auto& location_label = location_toolbar.add<GUI::Label>("Location: ");
|
||||
location_label.size_to_fit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue