From 54af44e354b78eb0669e9a1ca3f943868a10a112 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 19 Apr 2019 23:48:19 +0200 Subject: [PATCH] VisualBuilder: Expose some more widget properties. --- Applications/VisualBuilder/VBWidget.cpp | 11 +++++++++-- Applications/VisualBuilder/VBWidgetRegistry.cpp | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Applications/VisualBuilder/VBWidget.cpp b/Applications/VisualBuilder/VBWidget.cpp index cb52e184a5..6341b35cd3 100644 --- a/Applications/VisualBuilder/VBWidget.cpp +++ b/Applications/VisualBuilder/VBWidget.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include VBWidget::VBWidget(VBWidgetType type, VBForm& form) @@ -112,8 +113,9 @@ void VBWidget::setup_properties() VB_ADD_PROPERTY(GWidget, "visible", is_visible, set_visible, bool); VB_ADD_PROPERTY(GWidget, "enabled", is_enabled, set_enabled, bool); VB_ADD_PROPERTY(GWidget, "tooltip", tooltip, set_tooltip, string); - VB_ADD_PROPERTY(GWidget, "background_color", background_color, set_background_color, color); - VB_ADD_PROPERTY(GWidget, "foreground_color", foreground_color, set_foreground_color, color); + VB_ADD_PROPERTY(GWidget, "backcolor", background_color, set_background_color, color); + VB_ADD_PROPERTY(GWidget, "forecolor", foreground_color, set_foreground_color, color); + VB_ADD_PROPERTY(GWidget, "autofill", fill_with_background_color, set_fill_with_background_color, bool); if (m_type == VBWidgetType::GLabel) { VB_ADD_PROPERTY(GLabel, "text", text, set_text, string); @@ -150,6 +152,11 @@ void VBWidget::setup_properties() VB_ADD_PROPERTY(GTextEditor, "text", text, set_text, string); VB_ADD_PROPERTY(GTextEditor, "ruler_visible", is_ruler_visible, set_ruler_visible, bool); } + + if (m_type == VBWidgetType::GCheckBox) { + VB_ADD_PROPERTY(GCheckBox, "caption", caption, set_caption, string); + VB_ADD_PROPERTY(GCheckBox, "checked", is_checked, set_checked, bool); + } } void VBWidget::synchronize_properties() diff --git a/Applications/VisualBuilder/VBWidgetRegistry.cpp b/Applications/VisualBuilder/VBWidgetRegistry.cpp index 14c27e8e81..7aacaddda3 100644 --- a/Applications/VisualBuilder/VBWidgetRegistry.cpp +++ b/Applications/VisualBuilder/VBWidgetRegistry.cpp @@ -36,6 +36,7 @@ static GWidget* build_gwidget(VBWidgetType type, GWidget* parent) return new GGroupBox("groupbox_1", parent); case VBWidgetType::GLabel: { auto* label = new GLabel(parent); + label->set_fill_with_background_color(true); label->set_text("label_1"); return label; }