|
@@ -5,11 +5,21 @@
|
|
#include <LibGUI/GToolBar.h>
|
|
#include <LibGUI/GToolBar.h>
|
|
|
|
|
|
GToolBar::GToolBar(GWidget* parent)
|
|
GToolBar::GToolBar(GWidget* parent)
|
|
|
|
+ : GToolBar(Orientation::Horizontal, parent)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+GToolBar::GToolBar(Orientation orientation, GWidget* parent)
|
|
: GWidget(parent)
|
|
: GWidget(parent)
|
|
{
|
|
{
|
|
- set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
|
|
|
- set_preferred_size(0, 28);
|
|
|
|
- set_layout(make<GBoxLayout>(Orientation::Horizontal));
|
|
|
|
|
|
+ if (orientation == Orientation::Horizontal) {
|
|
|
|
+ set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
|
|
|
+ set_preferred_size(0, 28);
|
|
|
|
+ } else {
|
|
|
|
+ set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
|
|
|
+ set_preferred_size(28, 0);
|
|
|
|
+ }
|
|
|
|
+ set_layout(make<GBoxLayout>(orientation));
|
|
layout()->set_spacing(0);
|
|
layout()->set_spacing(0);
|
|
layout()->set_margins({ 2, 2, 2, 2 });
|
|
layout()->set_margins({ 2, 2, 2, 2 });
|
|
}
|
|
}
|