From a4eea75612acbbfd6b8aed6b48090ca2c76ee657 Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Sat, 10 Aug 2019 21:25:41 +0200 Subject: Add new widget "spacer" which adds an empty space between widgets The attribute "size" allows to define the spacing in px. The special value "expand" can be used to make the spacer consume all available space in the parent. --- src/extension/prefdialog/widget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/extension/prefdialog/widget.cpp') diff --git a/src/extension/prefdialog/widget.cpp b/src/extension/prefdialog/widget.cpp index eb9d23e07..da4b6545d 100644 --- a/src/extension/prefdialog/widget.cpp +++ b/src/extension/prefdialog/widget.cpp @@ -15,6 +15,7 @@ #include "widget-box.h" #include "widget-label.h" #include "widget-separator.h" +#include "widget-spacer.h" #include @@ -51,6 +52,8 @@ InxWidget *InxWidget::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex widget = new WidgetLabel(in_repr, in_ext); } else if (!strcmp(name, "separator")) { widget = new WidgetSeparator(in_repr, in_ext); + } else if (!strcmp(name, "spacer")) { + widget = new WidgetSpacer(in_repr, in_ext); } else if (!strcmp(name, "param")) { widget = InxParameter::make(in_repr, in_ext); } else { @@ -64,7 +67,7 @@ InxWidget *InxWidget::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex bool InxWidget::is_valid_widget_name(const char *name) { // keep in sync with names supported in InxWidget::make() above - static const std::vector valid_names = {"hbox", "vbox", "label", "separator", "param"}; + static const std::vector valid_names = {"hbox", "vbox", "label", "separator", "spacer", "param"}; if (std::find(valid_names.begin(), valid_names.end(), name) != valid_names.end()) { return true; -- cgit v1.2.3