OSDN Git Service

QmlDesigner.propertyEditor: fix ui for borders and colors
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 21 Jul 2011 11:27:41 +0000 (13:27 +0200)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 21 Jul 2011 11:28:43 +0000 (13:28 +0200)
Hiding controls was a bad idea. It is better to disable them and give
them sensible tooltips.

Task-number: QTCREATORBUG-4667
Task-number: QTCREATORBUG-5433
Change-Id: I2361fbbd3c28a5b9c07787abedf0439d6a7d1ad1
Reviewed-on: http://codereview.qt.nokia.com/1946
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
share/qtcreator/qmldesigner/propertyeditor/Qt/ColorGroupBox.qml
share/qtcreator/qmldesigner/propertyeditor/Qt/ColorTypeButtons.qml
share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleSpecifics.qml

index 27b73c8..bf07ef2 100644 (file)
@@ -238,12 +238,14 @@ QExtGroupBox {
 
                     ColorTypeButtons {
                         id: buttons;
-                        visible: showButtons && baseStateFlag
+                        visible: showButtons
+                        enabled: baseStateFlag
+                        opacity: enabled ? 1 : 0.6
                         showGradientButton: colorGroupBox.showGradientButton
                     }
 
                     QWidget {
-                        visible: !(showButtons && baseStateFlag)
+                        visible: !(showButtons)
                         fixedHeight: 28
                         fixedWidth: 93
                         width: fixedWidth
index 2e02ac9..b66d2f4 100644 (file)
@@ -82,7 +82,7 @@ QWidget {
         
         styleSheetFile: "styledbuttonleft.css"                
         iconFromFile: "images/icon_color_solid.png"
-        toolTip: qsTr("Solid color")
+        toolTip: baseStateFlag ? qsTr("Solid color") : qsTr("Solid color (only editable in base state)")
 
         onToggled: {
             if (checked) {
@@ -107,7 +107,7 @@ QWidget {
 
         styleSheetFile: "styledbuttonmiddle.css"
         iconFromFile: "images/icon_color_gradient.png"
-        toolTip: qsTr("Gradient")
+        toolTip: baseStateFlag ? qsTr("Gradient") : qsTr("Gradient (only editable in base state)")
 
         onToggled: {
             if (checked) {
@@ -131,7 +131,7 @@ QWidget {
         fixedHeight: 28
         styleSheetFile: "styledbuttonright.css"
         iconFromFile: "images/icon_color_none.png"
-        toolTip: qsTr("Transparent")
+        toolTip: baseStateFlag ? qsTr("Transparent") : qsTr("Transparent (only editable in base state)")
 
         onToggled: {
             if (checked) {
index ebeb4af..081404b 100644 (file)
@@ -56,7 +56,9 @@ QWidget {
                 rightMargin: 24
 
                 IntEditor {
-                    visible: colorsBox.hasBorder
+                    enabled: colorsBox.hasBorder
+                    opacity: enabled ? 1 : 0.6
+                    toolTip: enabled ? qsTr("Border width") : qsTr("Border has to be solid to change width")
                     id: borderWidth;
                     backendValue: backendValues.border_width === undefined ? 0 : backendValues.border_width