Browse Source

Make SettingCheckBox properly handle the value

Arjen Hiemstra 8 years ago
parent
commit
06432c3b0b
1 changed files with 9 additions and 10 deletions
  1. 9 10
      resources/qml/Settings/SettingCheckBox.qml

+ 9 - 10
resources/qml/Settings/SettingCheckBox.qml

@@ -19,20 +19,19 @@ SettingItem
 
         property bool checked:
         {
-            if(value == "True")
+            switch(propertyProvider.properties.value)
             {
-                return true;
-            }
-            else if(value == "False")
-            {
-                return false;
-            }
-            else
-            {
-                return value;
+                case "True":
+                    return true
+                case "False":
+                    return false
+                default:
+                    return propertyProvider.properties.value
             }
         }
 
+        onClicked: propertyProvider.setPropertyValue("value", !checked)
+
         Rectangle
         {
             anchors