summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-27 10:55:10 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-27 10:55:10 +0100
commit6906edee9a89619eefbea614983fa0c61d20c8a7 (patch)
tree747858f7635aacd5724e8735a42707f9edff2964 /DevTools
parent137a45dff2a6c60dbca34ee6b1e27ff476fe9b40 (diff)
downloadserenity-6906edee9a89619eefbea614983fa0c61d20c8a7.zip
LibGUI: Add 64-bit signed integer support to GVariant
What was previously the "Int" type is now "Int32" and "Int64".
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/VisualBuilder/VBForm.cpp6
-rw-r--r--DevTools/VisualBuilder/VBPropertiesWindow.cpp2
-rw-r--r--DevTools/VisualBuilder/VBWidget.cpp34
3 files changed, 22 insertions, 20 deletions
diff --git a/DevTools/VisualBuilder/VBForm.cpp b/DevTools/VisualBuilder/VBForm.cpp
index c289ef4f84..cb844cfa9f 100644
--- a/DevTools/VisualBuilder/VBForm.cpp
+++ b/DevTools/VisualBuilder/VBForm.cpp
@@ -431,8 +431,10 @@ void VBForm::write_to_file(const String& path)
widget.for_each_property([&](auto& property) {
if (property.value().is_bool())
widget_object.set(property.name(), property.value().to_bool());
- else if (property.value().is_int())
- widget_object.set(property.name(), property.value().to_int());
+ else if (property.value().is_i32())
+ widget_object.set(property.name(), property.value().to_i32());
+ else if (property.value().is_i64())
+ widget_object.set(property.name(), property.value().to_i64());
else
widget_object.set(property.name(), property.value().to_string());
});
diff --git a/DevTools/VisualBuilder/VBPropertiesWindow.cpp b/DevTools/VisualBuilder/VBPropertiesWindow.cpp
index ae557a8c6c..6965e31b38 100644
--- a/DevTools/VisualBuilder/VBPropertiesWindow.cpp
+++ b/DevTools/VisualBuilder/VBPropertiesWindow.cpp
@@ -95,7 +95,7 @@ VBPropertiesWindow::VBPropertiesWindow()
if (!m_table_view->model())
return nullptr;
auto type_index = m_table_view->model()->index(index.row(), VBWidgetPropertyModel::Column::Type);
- auto type = m_table_view->model()->data(type_index, GModel::Role::Custom).to_int();
+ auto type = m_table_view->model()->data(type_index, GModel::Role::Custom).to_i32();
switch ((GVariant::Type)type) {
case GVariant::Type::Bool:
return make<BoolModelEditingDelegate>();
diff --git a/DevTools/VisualBuilder/VBWidget.cpp b/DevTools/VisualBuilder/VBWidget.cpp
index a7d7f43213..96862f5d85 100644
--- a/DevTools/VisualBuilder/VBWidget.cpp
+++ b/DevTools/VisualBuilder/VBWidget.cpp
@@ -140,10 +140,10 @@ void VBWidget::setup_properties()
{
VB_ADD_PROPERTY(CObject, "name", name, set_name, string);
- VB_ADD_PROPERTY(GWidget, "width", width, set_width, int);
- VB_ADD_PROPERTY(GWidget, "height", height, set_height, int);
- VB_ADD_PROPERTY(GWidget, "x", x, set_x, int);
- VB_ADD_PROPERTY(GWidget, "y", y, set_y, int);
+ VB_ADD_PROPERTY(GWidget, "width", width, set_width, i32);
+ VB_ADD_PROPERTY(GWidget, "height", height, set_height, i32);
+ VB_ADD_PROPERTY(GWidget, "x", x, set_x, i32);
+ VB_ADD_PROPERTY(GWidget, "y", y, set_y, i32);
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);
@@ -164,28 +164,28 @@ void VBWidget::setup_properties()
}
if (m_type == VBWidgetType::GScrollBar) {
- VB_ADD_PROPERTY(GScrollBar, "min", min, set_min, int);
- VB_ADD_PROPERTY(GScrollBar, "max", max, set_max, int);
- VB_ADD_PROPERTY(GScrollBar, "value", value, set_value, int);
- VB_ADD_PROPERTY(GScrollBar, "step", step, set_step, int);
+ VB_ADD_PROPERTY(GScrollBar, "min", min, set_min, i32);
+ VB_ADD_PROPERTY(GScrollBar, "max", max, set_max, i32);
+ VB_ADD_PROPERTY(GScrollBar, "value", value, set_value, i32);
+ VB_ADD_PROPERTY(GScrollBar, "step", step, set_step, i32);
}
if (m_type == VBWidgetType::GSpinBox) {
- VB_ADD_PROPERTY(GSpinBox, "min", min, set_min, int);
- VB_ADD_PROPERTY(GSpinBox, "max", max, set_max, int);
- VB_ADD_PROPERTY(GSpinBox, "value", value, set_value, int);
+ VB_ADD_PROPERTY(GSpinBox, "min", min, set_min, i32);
+ VB_ADD_PROPERTY(GSpinBox, "max", max, set_max, i32);
+ VB_ADD_PROPERTY(GSpinBox, "value", value, set_value, i32);
}
if (m_type == VBWidgetType::GProgressBar) {
- VB_ADD_PROPERTY(GProgressBar, "min", min, set_min, int);
- VB_ADD_PROPERTY(GProgressBar, "max", max, set_max, int);
- VB_ADD_PROPERTY(GProgressBar, "value", value, set_value, int);
+ VB_ADD_PROPERTY(GProgressBar, "min", min, set_min, i32);
+ VB_ADD_PROPERTY(GProgressBar, "max", max, set_max, i32);
+ VB_ADD_PROPERTY(GProgressBar, "value", value, set_value, i32);
}
if (m_type == VBWidgetType::GSlider) {
- VB_ADD_PROPERTY(GSlider, "min", min, set_min, int);
- VB_ADD_PROPERTY(GSlider, "max", max, set_max, int);
- VB_ADD_PROPERTY(GSlider, "value", value, set_value, int);
+ VB_ADD_PROPERTY(GSlider, "min", min, set_min, i32);
+ VB_ADD_PROPERTY(GSlider, "max", max, set_max, i32);
+ VB_ADD_PROPERTY(GSlider, "value", value, set_value, i32);
}
if (m_type == VBWidgetType::GTextEditor) {