summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-19 23:48:19 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-19 23:48:19 +0200
commit54af44e354b78eb0669e9a1ca3f943868a10a112 (patch)
treeb3e8315551a46bf6ae8a519f9890f1fefd6a8865 /Applications
parent986f5806d7c758490b57141f63a4c1d046269915 (diff)
downloadserenity-54af44e354b78eb0669e9a1ca3f943868a10a112.zip
VisualBuilder: Expose some more widget properties.
Diffstat (limited to 'Applications')
-rw-r--r--Applications/VisualBuilder/VBWidget.cpp11
-rw-r--r--Applications/VisualBuilder/VBWidgetRegistry.cpp1
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 <LibGUI/GSpinBox.h>
#include <LibGUI/GTextEditor.h>
#include <LibGUI/GGroupBox.h>
+#include <LibGUI/GCheckBox.h>
#include <LibGUI/GProgressBar.h>
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;
}