summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog/widget.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-08-10 17:29:51 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-08-31 14:50:39 +0000
commitadceddc7970f1e88081f78f890906d9ca60d1f76 (patch)
tree70eaaf707e133d710ab0e053aba477c4cdd8f139 /src/extension/prefdialog/widget.cpp
parentUpdate POTFILES.in (diff)
downloadinkscape-adceddc7970f1e88081f78f890906d9ca60d1f76.tar.gz
inkscape-adceddc7970f1e88081f78f890906d9ca60d1f76.zip
Add new widgets "hbox" and "vbox" for layouting purposes
Diffstat (limited to 'src/extension/prefdialog/widget.cpp')
-rw-r--r--src/extension/prefdialog/widget.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/extension/prefdialog/widget.cpp b/src/extension/prefdialog/widget.cpp
index 7d37dd122..097406763 100644
--- a/src/extension/prefdialog/widget.cpp
+++ b/src/extension/prefdialog/widget.cpp
@@ -12,6 +12,7 @@
#include "parameter.h"
#include "widget.h"
+#include "widget-box.h"
#include "widget-label.h"
#include <algorithm>
@@ -38,10 +39,14 @@ InxWidget *InxWidget::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex
name++;
}
+ // decide on widget type based on tag name
+ // keep in sync with list of names supported in InxWidget::is_valid_widget_name() below
if (!name) {
// we can't create a widget without name
g_warning("InxWidget without name in extension '%s'.", in_ext->get_id());
- } else if (!strcmp(name, "description")) {
+ } else if (!strcmp(name, "hbox") || !strcmp(name, "vbox")) {
+ widget = new WidgetBox(in_repr, in_ext);
+ } else if (!strcmp(name, "label")) {
widget = new WidgetLabel(in_repr, in_ext);
} else if (!strcmp(name, "param")) {
widget = InxParameter::make(in_repr, in_ext);
@@ -56,7 +61,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 = {"description", "param"};
+ static const std::vector<std::string> valid_names = {"hbox", "vbox", "label", "param"};
if (std::find(valid_names.begin(), valid_names.end(), name) != valid_names.end()) {
return true;