summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog/widget.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-08-10 19:25:41 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-08-31 14:50:39 +0000
commita4eea75612acbbfd6b8aed6b48090ca2c76ee657 (patch)
treee53efaa60e611bc73c20b628c1c6e725c6f89f75 /src/extension/prefdialog/widget.cpp
parentAdd new widget "separator" which draws a line between widgets (diff)
downloadinkscape-a4eea75612acbbfd6b8aed6b48090ca2c76ee657.tar.gz
inkscape-a4eea75612acbbfd6b8aed6b48090ca2c76ee657.zip
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.
Diffstat (limited to 'src/extension/prefdialog/widget.cpp')
-rw-r--r--src/extension/prefdialog/widget.cpp5
1 files changed, 4 insertions, 1 deletions
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 <algorithm>
@@ -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<std::string> valid_names = {"hbox", "vbox", "label", "separator", "param"};
+ static const std::vector<std::string> valid_names = {"hbox", "vbox", "label", "separator", "spacer", "param"};
if (std::find(valid_names.begin(), valid_names.end(), name) != valid_names.end()) {
return true;