From a47cfaa01be1e9079e388bf48bb4f0f6b3f13ae0 Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Wed, 27 Jan 2010 18:38:09 +0100
Subject: [PATCH] QmlDesigner.PropertyEditor: Refactoring and polishing

I polished and refactored most of the property editor (again)
I introduced more custom widgets with expression editing, fixed bugs
and polished the visual design
---
 .../Qt/BorderImageSpecifics.qml               |  21 +-
 .../propertyeditor/Qt/CheckBox.qml            |   7 +
 .../propertyeditor/Qt/ComboBox.qml            |  15 +
 .../propertyeditor/Qt/DoubleSpinBox.qml       |   2 +
 .../propertyeditor/Qt/ExpressionEditor.qml    |   2 +
 .../propertyeditor/Qt/Extended.qml            |   6 +-
 .../Qt/ExtendedFunctionButton.qml             |   2 +-
 .../propertyeditor/Qt/FontGroupBox.qml        |  49 +++
 .../propertyeditor/Qt/Geometry.qml            |   8 +-
 .../propertyeditor/Qt/HorizontalLayout.qml    |   2 +-
 .../propertyeditor/Qt/ImageSpecifics.qml      |   7 +-
 .../propertyeditor/Qt/IntEditor.qml           |   9 +-
 .../qmldesigner/propertyeditor/Qt/Label.qml   |  10 +
 .../propertyeditor/Qt/LineEdit.qml            |  32 ++
 .../propertyeditor/Qt/Modifiers.qml           |  21 +-
 .../propertyeditor/Qt/PlaceHolder.qml         |   7 +
 .../propertyeditor/Qt/PropertyFrame.qml       |   2 +-
 .../propertyeditor/Qt/RectangleSpecifics.qml  |  34 +--
 .../propertyeditor/Qt/SliderWidget.qml        |   2 +-
 .../Qt/StandardTextGroupBox.qml               |  87 ++++++
 .../propertyeditor/Qt/TextEditSpecifics.qml   | 285 +++---------------
 .../propertyeditor/Qt/TextInputGroupBox.qml   |  58 ++++
 .../propertyeditor/Qt/TextInputSpecifics.qml  | 175 +----------
 .../propertyeditor/Qt/TextSpecifics.qml       | 170 +----------
 .../qmldesigner/propertyeditor/Qt/Type.qml    |  62 +---
 25 files changed, 393 insertions(+), 682 deletions(-)
 create mode 100644 share/qtcreator/qmldesigner/propertyeditor/Qt/ComboBox.qml
 create mode 100644 share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml
 create mode 100644 share/qtcreator/qmldesigner/propertyeditor/Qt/Label.qml
 create mode 100644 share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml
 create mode 100644 share/qtcreator/qmldesigner/propertyeditor/Qt/PlaceHolder.qml
 create mode 100644 share/qtcreator/qmldesigner/propertyeditor/Qt/StandardTextGroupBox.qml
 create mode 100644 share/qtcreator/qmldesigner/propertyeditor/Qt/TextInputGroupBox.qml

diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/BorderImageSpecifics.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/BorderImageSpecifics.qml
index a085c27cd62..3db8a3bf5b5 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/BorderImageSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/BorderImageSpecifics.qml
@@ -4,31 +4,26 @@ import Bauhaus 1.0
 GroupBox {
     maximumHeight: 240;
 
-
     finished: finishedNotify;
     caption: "Image";
 
-    layout: QVBoxLayout {
-        topMargin: 12;
-        bottomMargin: 12;
-        leftMargin: 12;
-        rightMargin: 12;
-
+    layout: VerticalLayout {
+        
         FileWidget {
             enabled: isBaseState || backendValues.id.value != "";
             maximumWidth: 250;
-            text: "Source: ";
+            text: "Source";
             fileName: backendValues.source.value;
             onFileNameChanged: {
                 backendValues.source.value = fileName;
             }
-        }
+        }        
 
 
         IntEditor {
             id: pixelSize;
             backendValue: backendValues.border_left;
-            caption: "Border Left:       "
+            caption: "Left"
             baseStateFlag: isBaseState;
 
             step: 1;
@@ -38,7 +33,7 @@ GroupBox {
 
         IntEditor {
             backendValue: backendValues.border_right;
-            caption: "Border Right:    "
+            caption: "Right"
             baseStateFlag: isBaseState;
 
             step: 1;
@@ -48,7 +43,7 @@ GroupBox {
 
         IntEditor {
             backendValue: backendValues.border_top;
-            caption: "Border Top:       "
+            caption: "Top"
             baseStateFlag: isBaseState;
 
             step: 1;
@@ -58,7 +53,7 @@ GroupBox {
 
         IntEditor {
             backendValue: backendValues.border_bottom;
-            caption: "Border Bottom:"
+            caption: "Bottom"
             baseStateFlag: isBaseState;
 
             step: 1;
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/CheckBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/CheckBox.qml
index 83b06e95678..88c2328e722 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/CheckBox.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/CheckBox.qml
@@ -35,4 +35,11 @@ QCheckBox { //This is a special CheckBox that does color coding for states
             }
 		}
    }
+   
+   ExtendedFunctionButton {
+        backendValue: CheckBox.backendValue
+        y: 2
+        x: 0
+        visible: CheckBox.enabled
+    }
 }
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/ComboBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/ComboBox.qml
new file mode 100644
index 00000000000..791960f90c6
--- /dev/null
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/ComboBox.qml
@@ -0,0 +1,15 @@
+import Qt 4.6
+import Bauhaus 1.0
+
+QComboBox {
+	id: ComboBox
+	
+	property var backendValue
+	
+	ExtendedFunctionButton {
+        backendValue: ComboBox.backendValue
+        y: 3
+        x: 3
+        visible: CheckBox.enabled
+    }
+}
\ No newline at end of file
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml
index ef08a437f8d..b62afbfd337 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml
@@ -55,7 +55,9 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
         QLabel {
             visible: text != ""
             id: label;
+            font.bold: true;
             alignment: "Qt::AlignRight | Qt::AlignVCenter"
+            maximumWidth: 80
         }
 
         QDoubleSpinBox {
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/ExpressionEditor.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/ExpressionEditor.qml
index 43cf5ba72d1..cb209001147 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/ExpressionEditor.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/ExpressionEditor.qml
@@ -13,6 +13,8 @@ QWidget {
 
     onActiveChanged: {
         //text = "";
+        print("active")
+        print(y)
         if (active) {
             textEdit.plainText = backendValue.expression
             textEdit.setFocus();
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/Extended.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/Extended.qml
index 86c12d97835..06ff881cfae 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/Extended.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/Extended.qml
@@ -14,10 +14,8 @@ layout: VerticalLayout{
     QWidget  {
         maximumHeight: 40;
         layout: HorizontalLayout {
-            QLabel {
-                text: "Effect ";
-                font.bold: true;
-				alignment: "Qt::AlignRight | Qt::AlignVCenter"
+            Label {
+                text: "Effect ";             
              }
              QComboBox {
                  enabled: isBaseState;
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/ExtendedFunctionButton.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/ExtendedFunctionButton.qml
index 280be6d2a98..6e2a3d21c5c 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/ExtendedFunctionButton.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/ExtendedFunctionButton.qml
@@ -74,7 +74,7 @@ QToolButton {
     QAction {
         text: "Set Expression";
         onTriggered: {
-            expressionEdit.globalY = box.globalY;
+            expressionEdit.globalY = ExtendedFunctionButton.globalY;
             expressionEdit.backendValue = ExtendedFunctionButton.backendValue
             expressionEdit.show();
             expressionEdit.raise();
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml
new file mode 100644
index 00000000000..f8c89a880cc
--- /dev/null
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml
@@ -0,0 +1,49 @@
+import Qt 4.6
+import Bauhaus 1.0
+
+GroupBox {
+    id: FontGroupBox
+    caption: "Font";
+
+    layout: VerticalLayout {
+
+        QWidget {
+            layout: HorizontalLayout {
+                Label {
+                    text: "Font"
+                }
+                QFontComboBox {
+                    minimumWidth: 200
+                }
+                IntEditor {
+                    caption: "Size"
+                    slider: false
+                    backendValue: backendValues.font_pointSize
+                    baseStateFlag: isBaseState;
+                }
+
+            }
+        }
+
+        QWidget {
+            layout: HorizontalLayout {
+                Label {
+                    text: "Style"
+                }
+
+                CheckBox {
+                    text: "Bold";
+                    backendValue: backendValues.font_bold
+                    baseStateFlag: isBaseState;
+                    checkable: true;
+                }
+                CheckBox {
+                    text: "Italic";
+                    backendValue: backendValues.font_italic
+                    baseStateFlag: isBaseState;
+                    checkable: true;
+                }
+            }
+        }
+    }
+}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/Geometry.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/Geometry.qml
index 9fa801baa88..6601b878de8 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/Geometry.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/Geometry.qml
@@ -5,16 +5,13 @@ GroupBox {
     id: Geometry;
     caption: "Geometry";
 
-    maximumHeight: 240;
-
     layout: VerticalLayout {        
 
         QWidget {  // 1
             layout: HorizontalLayout {
 
-                QLabel {
+                Label {
                     text: "Position"
-                    alignment: "Qt::AlignRight | Qt::AlignVCenter"
                 }
 
                 DoubleSpinBox {
@@ -48,9 +45,8 @@ GroupBox {
         QWidget {
             layout: HorizontalLayout {				
 
-                QLabel {
+                Label {
                     text: "Size"
-                    alignment: "Qt::AlignRight | Qt::AlignVCenter"
                 }
 
                 DoubleSpinBox {
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/HorizontalLayout.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/HorizontalLayout.qml
index 57501510461..d3205ef7cb0 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/HorizontalLayout.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/HorizontalLayout.qml
@@ -3,7 +3,7 @@ import Bauhaus 1.0
 
 QHBoxLayout { 
     id: HorizontalLayout
-    spacing: 20
+    spacing: 10
     topMargin: 0
     bottomMargin: 0
     leftMargin: 0
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/ImageSpecifics.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/ImageSpecifics.qml
index 28d475853f2..7b1c502e9e5 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/ImageSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/ImageSpecifics.qml
@@ -7,15 +7,10 @@ GroupBox {
     finished: finishedNotify;
     caption: "Image";
 
-    layout: QVBoxLayout {
-        topMargin: 12;
-        bottomMargin: 12;
-        leftMargin: 2;
-        rightMargin: 2;
+    layout: VerticalLayout {
 
         FileWidget {
             enabled: isBaseState || backendValues.id.value != "";
-            maximumWidth: 250;
             text: "Source: ";
             fileName: backendValues.source.value;
             onFileNameChanged: {
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
index 045812a103b..6cecedfd920 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
@@ -13,12 +13,12 @@ QWidget {
     property var minimumValue: 0
     property var step: 1
     property bool slider: true
+    property alias alignment: label.alignment
 
     layout: HorizontalLayout {
-        QLabel {
-            text: caption
-            font.bold: true;
-            alignment: "Qt::AlignRight | Qt::AlignVCenter"
+        Label {
+            id: label
+            text: caption        
         }
 
         SpinBox {
@@ -32,7 +32,6 @@ QWidget {
         QWidget {
             visible: IntEditor.slider
             id: sliderWidget
-            fixedWidth: 100
             QSlider {
                 y: sliderWidget.height / 2 - 12
                 width: sliderWidget.width
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/Label.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/Label.qml
new file mode 100644
index 00000000000..da5984aa466
--- /dev/null
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/Label.qml
@@ -0,0 +1,10 @@
+import Qt 4.6
+import Bauhaus 1.0
+
+QLabel {          
+	id: Label
+	font.bold: true;
+	alignment: "Qt::AlignRight | Qt::AlignVCenter"
+        //maximumWidth: 80
+        fixedWidth: 80
+}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml
new file mode 100644
index 00000000000..f0b4461dec9
--- /dev/null
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml
@@ -0,0 +1,32 @@
+import Qt 4.6
+import Bauhaus 1.0
+
+QWidget {
+    id: LineEdit
+
+    property var backendValue
+
+    minimumHeight: 24;
+
+    QLineEdit {
+        id: lineEditWidget
+        x: 18
+        width: LineEdit.width - 18
+        height: LineEdit.height
+
+        text: backendValue.value
+
+        onTextEdited: {
+            print("text edited")
+            backendValue.value = text
+        }
+
+
+    }    
+    ExtendedFunctionButton {
+        backendValue: LineEdit.backendValue
+        y: 4
+        x: 3
+        visible: LineEdit.enabled
+    }
+}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml
index efce139a8f5..b46f8a4f9e6 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml
@@ -11,9 +11,8 @@ GroupBox {
 
         QWidget {
             layout: HorizontalLayout {
-                QLabel {
+                Label {
                     text: "Visibility"
-                    alignment: "Qt::AlignRight | Qt::AlignVCenter"
                 }
 
                 CheckBox {
@@ -29,16 +28,14 @@ GroupBox {
                     backendValue: backendValues.clip === undefined ? false : backendValues.clip;
                     baseStateFlag: isBaseState;
                     checkable: true;
-                    fixedWidth: 100
                 }
             }
         }
         QWidget {
             layout: HorizontalLayout {
 
-                QLabel {
+                Label {
                     text: "Opacity"
-                    alignment: "Qt::AlignRight | Qt::AlignVCenter"
                 }
 
                 DoubleSpinBox {
@@ -66,12 +63,13 @@ GroupBox {
         QWidget {
             layout: HorizontalLayout {
 
-                QLabel {
+                Label {
                     text: "Origin";
-                    alignment: "Qt::AlignRight | Qt::AlignVCenter"
                 }
-                QComboBox {
+                ComboBox {
                     minimumWidth: 20
+					
+					backendValue: backendValues.transformOrigin
                     items : { [
                         "TopLeft", "Top", "TopRight", "Left", "Center", "Right", "BottomLeft", "Bottom",
                         "BottomRight"
@@ -85,18 +83,13 @@ GroupBox {
                         backendValues.transformOrigin.value = currentText;
                     }
                 }
-                QWidget {
-                    fixedWidth: 100
-                }
-
             }
         }
         QWidget {
             layout: HorizontalLayout {
 
-                QLabel {
+                Label {
                     text: "Scale"
-                    alignment: "Qt::AlignRight | Qt::AlignVCenter"
                 }
 
                 DoubleSpinBox {
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/PlaceHolder.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/PlaceHolder.qml
new file mode 100644
index 00000000000..39b72401435
--- /dev/null
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/PlaceHolder.qml
@@ -0,0 +1,7 @@
+import Qt 4.6
+import Bauhaus 1.0
+
+QWidget {
+	id: PlaceHolder
+	fixedWidth: 100
+	}
\ No newline at end of file
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/PropertyFrame.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/PropertyFrame.qml
index 9d02bb47f56..947f5b133e4 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/PropertyFrame.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/PropertyFrame.qml
@@ -3,7 +3,7 @@ import Qt 4.6
 WidgetFrame {
    id: PropertyFrame;
 
-    minimumWidth: 350;
+    minimumWidth: 320;
     //maximumWidth: 300;
     styleSheetFile: "propertyEditor.css";
     //visible: isBaseState;
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleSpecifics.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleSpecifics.qml
index ac8619c9b02..6d0d2d205d9 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleSpecifics.qml
@@ -8,16 +8,25 @@ GroupBox {
 
     maximumHeight: 340;
 
-    layout: QVBoxLayout {
-        topMargin: 20;
-        bottomMargin: 4;
-        leftMargin: 0;
-        rightMargin: 10;
+    layout: VerticalLayout {
 
         IntEditor {
             backendValue: backendValues.radius
             caption: "Radius"
             baseStateFlag: isBaseState;
+            step: 1;
+            minimumValue: 0;
+            maximumValue: 100;
+        }        
+
+
+        IntEditor {
+            id: borderWidth;
+            backendValue: backendValues.border_width === undefined ? 0 : backendValues.border_width
+
+            caption: "Pen Width"
+            baseStateFlag: isBaseState;
+
             step: 1;
             minimumValue: 0;
             maximumValue: 100;
@@ -32,8 +41,9 @@ GroupBox {
             //modelNode: backendValues.color.modelNode;
             complexGradientNode: backendValues.color === undefined ? null : backendValues.color.complexNode
 
-            showGradientButton: true;
+            //showGradientButton: true;
         }
+
         ColorWidget {
             text: "Tint color";
             color: backendValues.tintColor === undefined ? "black" : backendValues.tintColor.value
@@ -42,18 +52,6 @@ GroupBox {
             }
         }
 
-
-        IntEditor {
-            id: borderWidth;
-            backendValue: backendValues.border_width === undefined ? 0 : backendValues.border_width
-
-            caption: "Pen Width"
-            baseStateFlag: isBaseState;
-
-            step: 1;
-            minimumValue: 0;
-            maximumValue: 100;
-        }
         ColorWidget {
             id: PenColor;
             text: "Pen Color";
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml
index 018809d19f0..69c6220b380 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml
@@ -4,7 +4,7 @@ import Bauhaus 1.0
 QWidget {
     id: SliderWidget
     visible: IntEditor.slider
-    fixedWidth: 100
+    //fixedWidth: 100
 
     property alias value: slider.value
     property alias singleStep: slider.singleStep
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/StandardTextGroupBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/StandardTextGroupBox.qml
new file mode 100644
index 00000000000..0dacdcbdf31
--- /dev/null
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/StandardTextGroupBox.qml
@@ -0,0 +1,87 @@
+import Qt 4.6
+import Bauhaus 1.0
+
+GroupBox {
+    id: StandardTextGroupBox
+
+    caption: "Text";
+
+    property bool showStyleColor: false;
+
+    layout: VerticalLayout {
+        QWidget {
+            layout: HorizontalLayout {
+
+                Label {
+                    text: "Text"
+                }
+
+                LineEdit {
+                    backendValue: backendValues.text
+                }
+
+                CheckBox {
+                    fixedWidth: 70
+                    baseStateFlag: isBaseState;
+                    text: "Wraps";
+                    checkable: true;
+                    backendValue: backendValues.wrap;
+                }
+            }
+        }
+
+
+
+        QWidget {
+            layout: HorizontalLayout {
+
+                Label {
+                    text: "Alignment"
+                }
+
+                ComboBox {
+                    items : { ["AlignLeft", "AlignRight", "AlignHCenter"] }
+                    currentText: backendValues.horizontalAlignment.value;
+                    onItemsChanged: {
+                        currentText =  backendValues.horizontalAlignment.value;
+                    }
+
+                    onCurrentTextChanged: {
+                        if (count == 3);
+                        backendValues.horizontalAlignment.value = currentText;
+                    }
+
+                }
+
+                ComboBox {
+                    items : { ["AlignTop", "AlignBottom", "AlignVCenter"] }
+                    currentText: backendValues.verticalAlignment.value;
+                    onItemsChanged: {
+                        currentText =  backendValues.verticalAlignment.value;
+                    }
+
+                    onCurrentTextChanged: {
+                        if (count == 3)
+                            backendValues.verticalAlignment.value = currentText;
+                    }
+
+                }
+            }
+        }
+        ColorWidget {
+            text: "Color:";
+            color: backendValues.color.value;
+            onColorChanged: {
+                backendValues.color.value = strColor;
+            }
+        }
+        ColorWidget {
+            visible: showStyleColor
+            text: "Style color:";
+            color: backendValues.styleColor.value;
+            onColorChanged: {
+                backendValues.styleColor.value = strColor;
+            }
+        }
+    }
+}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/TextEditSpecifics.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/TextEditSpecifics.qml
index 34fd8168b63..2999ec26c5e 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/TextEditSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/TextEditSpecifics.qml
@@ -1,273 +1,60 @@
 import Qt 4.6
 import Bauhaus 1.0
 
-GroupBox {
-    maximumHeight: 600;
-
-    finished: finishedNotify;
-    caption: "Text Edit";
+QWidget {
+    id: textSpecifics;
 
     layout: QVBoxLayout {
-        id: textSpecifics;
-        topMargin: 20;
-        bottomMargin: 2;
-        leftMargin: 4;
-        rightMargin: 4;
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 8;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 0;
-                spacing: 20;
-                QLabel {
-                    alignment: "AlignTop";
-                    text: "Text:"
-                    font.bold: true;
-                }
-                QTextEdit {
-                    minimumHeight: 80;
-                    property var localText: backendValues.text.value;
-                    onLocalTextChanged: {
-                        if (localText != plainText)
-                            plainText = localText;
-                    }
-
-                    onTextChanged: {
-                        backendValues.text.value = plainText;
-                    }
-
-                }
-            }
-        }
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 2;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
-                QLabel {
-                    text: "wrap:"
-                    font.bold: true;
-                }
-                CheckBox {
-                    text: "isWrapping";
-					baseStateFlag: isBaseState;
-					checkable: true;
-                    backendValue: backendValues.wrap;
-                }
-            }
-        }
-
-        FontWidget {
-            text: "Font:";
-
-            bold: backendValues.font_bold.value;
-            italic: backendValues.font_italic.value;
-            family: backendValues.font_family.value;
-            fontSize: backendValues.font_pointSize.value;
-
-            onDataFontChanged: {
-                if (bold)
-                    backendValues.font_bold.value = bold;
-                else
-                    backendValues.font_bold.resetValue();
-
-                if (italic)
-                    backendValues.font_italic.value = bold;
-                else
-                    backendValues.font_italic.resetValue();
-
-                backendValues.font_family.value = family;
-                backendValues.font_pointSize.value = fontSize;
-            }
-        }
-
-        HorizontalLine {
-        }
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 4;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 6;
-
-            }
-        }
-
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 4;
-                bottomMargin: 8;
-                leftMargin: 6;
-                rightMargin: 6;
-                QLabel {
-                    text: "Text Format:"
-                    font.bold: true;
-                }
-
-                QComboBox {
-                    minimumHeight: 22;
-                    items : { ["PlainText", "RichText", "AutoText"] }
-                    currentText: backendValues.textFormat.value;
-                    onItemsChanged: {
-                        currentText =  backendValues.textFormat.value;
-                    }
-
-                    onCurrentTextChanged: {
-                        if (count == 3)
-                        backendValues.textFormat.value = currentText;
-                    }
-                }
-            }
-        }
-
+        topMargin: 0
+        bottomMargin: 0
+        leftMargin: 0
+        rightMargin: 0
+        spacing: 0
 
-        HorizontalLine {
-        }
-
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 4;
-                bottomMargin: 2;
-                leftMargin: 6;
-                rightMargin: 6;
-                QLabel {
-                    text: "Horizontal Alignment:"
-                    font.bold: true;
-                }
-
-                QComboBox {
-                    items : { ["AlignLeft", "AlignRight", "AlignHCenter"] }
-                    currentText: backendValues.horizontalAlignment.value;
-                    onItemsChanged: {
-                        currentText =  backendValues.horizontalAlignment.value;
-                    }
+        StandardTextGroupBox {
+            showStyleColor: true
+            finished: finishedNotify;
 
-                    onCurrentTextChanged: {
-                        if (count == 3)
-                        backendValues.horizontalAlignment.value = currentText;
-                    }
-                }
-            }
         }
 
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 4;
-                bottomMargin: 2;
-                leftMargin: 6;
-                rightMargin: 6;
-                QLabel {
-                    text: "Vertical Alignment:"
-                    font.bold: true;
-                }
+        GroupBox {
+            caption: "Text Edit"
+            finished: finishedNotify;
+            layout: VerticalLayout {
 
-                QComboBox {
-                    items : { ["AlignTop", "AlignBottom", "AlignVCenter"] }
-                    currentText: backendValues.verticalAlignment.value;
-                    onItemsChanged: {
-                        currentText =  backendValues.verticalAlignment.value;
-                    }
+                QWidget {
+                    layout: HorizontalLayout {
+                        Label {
+                            text: "Text Format"
+                        }
+                        ComboBox {
+                            minimumHeight: 22;
+                            items : { ["PlainText", "RichText", "AutoText"] }
+                            currentText: backendValues.textFormat.value;
+                            onItemsChanged: {
+                                currentText =  backendValues.textFormat.value;
+                            }
 
-                    onCurrentTextChanged: {
-                        if (count == 3)
-                        backendValues.verticalAlignment.value = currentText;
+                            onCurrentTextChanged: {
+                                if (count == 3)
+                                    backendValues.textFormat.value = currentText;
+                            }
+                        }
                     }
                 }
-            }
-        }
-
-        HorizontalLine {
-        }
 
-        ColorWidget {
-            minimumHeight: 20;
-            maximumHeight: 20;
-            text: "Color:";
-            color: backendValues.color.value;
-            onColorChanged: {
-                backendValues.color.value = strColor;
             }
         }
 
-        ColorWidget {
-            minimumHeight: 20;
-            maximumHeight: 20;
-            text: "Selection Color:";
-            color: backendValues.selectionColor.value;
-            onColorChanged: {
-                backendValues.selectionColor.value = strColor;
-            }
-        }
+        FontGroupBox {
+            finished: finishedNotify;
 
-        ColorWidget {
-            minimumHeight: 20;
-            maximumHeight: 20;
-            text: "Selected Text Color:";
-            color: backendValues.selectedTextColor.value;
-            onColorChanged: {
-                backendValues.selectedTextColor.value = strColor;
-            }
         }
 
-        HorizontalLine {
+        TextInputGroupBox {
+            finished: finishedNotify;
         }
-
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 2;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
-
-                CheckBox {
-
-                    text: "Read Only";
-					baseStateFlag: isBaseState;
-                    checkable: true;
-                    backendValue: backendValues.readOnly;
-                }
-
-                CheckBox {
-                    text: "Cursor Visible";
-					baseStateFlag: isBaseState;
-                    checkable: true;
-                    backendValue: backendValues.cursorVisible;
-                }
-            }
-        }
-
-        HorizontalLine {
+        QScrollArea {
         }
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 2;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
-
-                CheckBox {
-                    text: "Focus On Press";
-					baseStateFlag: isBaseState;
-                    checkable: true;
-                    backendValue:  backendValues. focusOnPress.value;
-                }
-
-                CheckBox {
-                    text: "Persistent Selection";
-					baseStateFlag: isBaseState;
-                    checkable: true;
-                    backendValue: backendValues.persistentSelection.value;
-                }
-
-            }
-        }
-
     }
 }
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/TextInputGroupBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/TextInputGroupBox.qml
new file mode 100644
index 00000000000..635b9e8bb83
--- /dev/null
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/TextInputGroupBox.qml
@@ -0,0 +1,58 @@
+import Qt 4.6
+import Bauhaus 1.0
+
+GroupBox {
+
+    id: TextInputGroupBox
+    caption: "Text Input";
+
+    layout: VerticalLayout {
+
+        ColorWidget {
+            text: "Selection Color:";
+            color: backendValues.selectionColor.value;
+            onColorChanged: {
+                backendValues.selectionColor.value = strColor;
+            }
+        }
+
+        ColorWidget {
+            text: "Selected Text Color:";
+            color: backendValues.selectedTextColor.value;
+            onColorChanged: {
+                backendValues.selectedTextColor.value = strColor;
+            }
+        }
+
+
+
+        QWidget {
+            layout: HorizontalLayout {
+
+                CheckBox {
+
+                    text: "Read Only";
+                    baseStateFlag: isBaseState;
+                    checkable: true;
+                    backendValue: backendValues.readOnly;
+                }
+
+                CheckBox {
+
+                    text: "Cursor Visible";
+                    baseStateFlag: isBaseState;
+                    checkable: true;
+                    backendValue: backendValues.cursorVisible;
+
+                }
+
+                CheckBox {
+                    text: "Focus On Press";
+                    baseStateFlag: isBaseState;
+                    checkable: true;
+                    backendValue:  backendValues. focusOnPress;
+                }
+            }
+        }
+    }
+}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/TextInputSpecifics.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/TextInputSpecifics.qml
index 78091f5ee0c..caf0f8567c7 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/TextInputSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/TextInputSpecifics.qml
@@ -1,176 +1,31 @@
 import Qt 4.6
 import Bauhaus 1.0
 
-GroupBox {
-    maximumHeight: 420;
-    minimumHeight: 420;
-
-    finished: finishedNotify;
-    caption: "Text Input";
+QWidget {
+    id: textSpecifics;
 
     layout: QVBoxLayout {
-        id: textSpecifics;
-        topMargin: 12;
-        bottomMargin: 2;
-        leftMargin: 10;
-        rightMargin: 10;
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 8;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
-                QLabel {
-                    text: "Text:"
-                    font.bold: true;
-                }
-                QLineEdit {
-                    minimumHeight: 24;
-                    text: backendValues.text.value;
-                    onTextChanged: {
-                        backendValues.text.value = text;
-                    }
-                }
-            }
-        }
-
-        FontWidget {
-            text: "Font:";
-
-            bold: backendValues.font_bold.value;
-            italic: backendValues.font_italic.value;
-            family: backendValues.font_family.value;
-            fontSize: backendValues.font_pointSize.value;
-
-            onDataFontChanged: {
-
-                if (bold)
-                    backendValues.font_bold.value = bold;
-                else
-                    backendValues.font_bold.resetValue();
-
-                if (italic)
-                    backendValues.font_italic.value = bold;
-                else
-                    backendValues.font_italic.resetValue();
-
-                backendValues.font_family.value = family;
-                backendValues.font_pointSize.value = fontSize;
-            }
-        }
-
-        HorizontalLine {
-        }
-
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 4;
-                bottomMargin: 2;
-                leftMargin: 6;
-                rightMargin: 6;
-                QLabel {
-                    text: "Horizontal Alignment:"
-                    font.bold: true;
-                }
-
-                QComboBox {
-                    items : { ["AlignLeft", "AlignRight", "AlignHCenter"] }
-                    currentText: backendValues.horizontalAlignment.value;
-                    onItemsChanged: {
-                        currentText =  backendValues.horizontalAlignment.value;
-                    }
-
-                    onCurrentTextChanged: {
-                        if (count == 3)
-                            backendValues.horizontalAlignment.value = currentText;
-                    }
-
-                }
-            }
-        }
-
-        HorizontalLine {
-        }
-
-        ColorWidget {
-            minimumHeight: 20;
-            maximumHeight: 20;
-            text: "Color:";
-            color: backendValues.color.value;
-            onColorChanged: {
-                backendValues.color.value = strColor;
-            }
-        }
-
-        ColorWidget {
-            minimumHeight: 20;
-            maximumHeight: 20;
-            text: "Selection Color:";
-            color: backendValues.selectionColor.value;
-            onColorChanged: {
-                backendValues.selectionColor.value = strColor;
-            }
-        }
+        topMargin: 0
+        bottomMargin: 0
+        leftMargin: 0
+        rightMargin: 0
+        spacing: 0
 
-        ColorWidget {
-            minimumHeight: 20;
-            maximumHeight: 20;
-            text: "Selected Text Color:";
-            color: backendValues.selectedTextColor.value;
-            onColorChanged: {
-                backendValues.selectedTextColor.value = strColor;
-            }
-        }
+        StandardTextGroupBox {
+            showStyleColor: true
+            finished: finishedNotify;
 
-        HorizontalLine {
         }
 
+        FontGroupBox {
+            finished: finishedNotify;
 
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 2;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
-
-                CheckBox {
-
-                    text: "Read Only";
-                    baseStateFlag: isBaseState;
-                    checkable: true;
-                    backendValue: backendValues.readOnly;
-                }
-
-                CheckBox {
-
-                    text: "Cursor Visible";
-                    baseStateFlag: isBaseState;
-                    checkable: true;
-                    backendValue: backendValues.cursorVisible;
-
-                }
-            }
         }
 
-        HorizontalLine {
+        TextInputGroupBox {
+            finished: finishedNotify;
         }
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 2;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
-
-                CheckBox {
-                    text: "Focus On Press";
-                    baseStateFlag: isBaseState;
-                    checkable: true;
-                    backendValue:  backendValues. focusOnPress;
-                }
-
-            }
+        QScrollArea {
         }
     }
 }
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/TextSpecifics.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/TextSpecifics.qml
index a0d39f071ef..a09610df27e 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/TextSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/TextSpecifics.qml
@@ -1,172 +1,28 @@
 import Qt 4.6
 import Bauhaus 1.0
 
-GroupBox {
-    maximumHeight: 280;
-
-    finished: finishedNotify;
-    caption: "Text";
+QWidget {
+    id: textSpecifics;
 
     layout: QVBoxLayout {
-        id: textSpecifics;
-        topMargin: 18;
-        bottomMargin: 2;
-        leftMargin: 4;
-        rightMargin: 4;
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 8;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
-                QLabel {
-                    text: "Text:"
-                    font.bold: true;
-                }
-                QLineEdit {
-                    minimumHeight: 24;
-                    text: backendValues.text.value;
-                    onTextChanged: {
-                        backendValues.text.value = text;
-                    }
-                }
-            }
-        }
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 6;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
-                QLabel {
-                    text: "wrap:"
-                    font.bold: true;
-                }
-                CheckBox {
-                    baseStateFlag: isBaseState;
-                    text: "isWrapping";
-                    checkable: true;
-                    backendValue: backendValues.wrap;
-                }
-            }
-        }
-
-        FontWidget {
-            text: "Font:";
-
-            bold: backendValues.font_bold.value;
-            italic: backendValues.font_italic.value;
-            family: backendValues.font_family.value;
-            fontSize: backendValues.font_pointSize.value;
-
-            onDataFontChanged: {
+        topMargin: 0
+        bottomMargin: 0
+        leftMargin: 0
+        rightMargin: 0
+        spacing: 0
 
-                if (bold)
-                    backendValues.font_bold.value = bold;
-                else
-                    backendValues.font_bold.resetValue();
+        StandardTextGroupBox {
+            showStyleColor: true
+            finished: finishedNotify;
 
-                if (italic)
-                    backendValues.font_italic.value = bold;
-                else
-                    backendValues.font_italic.resetValue();
-
-                backendValues.font_family.value = family;
-                backendValues.font_pointSize.value = fontSize;
-            }
-        }
-
-        HorizontalLine {
         }
 
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 4;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 6;
-
-            }
-        }
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 4;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 6;
-                QLabel {
-                    text: "Horizontal Alignment:"
-                    font.bold: true;
-                }
-
-                QComboBox {
-                    items : { ["AlignLeft", "AlignRight", "AlignHCenter"] }
-                    currentText: backendValues.horizontalAlignment.value;
-                    onItemsChanged: {
-                        currentText =  backendValues.horizontalAlignment.value;
-                    }
-
-                    onCurrentTextChanged: {
-                        if (count == 3);
-                        backendValues.horizontalAlignment.value = currentText;
-                    }
-
-                }
-            }
-        }
-
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 4;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 6;
-                QLabel {
-                    text: "Vertical Alignment:"
-                    font.bold: true;
-                }
-
-                QComboBox {
-                    items : { ["AlignTop", "AlignBottom", "AlignVCenter"] }
-                    currentText: backendValues.verticalAlignment.value;
-                    onItemsChanged: {
-                        currentText =  backendValues.verticalAlignment.value;
-                    }
-
-                    onCurrentTextChanged: {
-                        if (count == 3)
-                            backendValues.verticalAlignment.value = currentText;
-                    }
-
-                }
-            }
-        }
+        FontGroupBox {
+            finished: finishedNotify;
 
-        HorizontalLine {
         }
-        QWidget {
-            layout: QHBoxLayout {
-                topMargin: 2;
-                bottomMargin: 2;
-                leftMargin: 10;
-                rightMargin: 10;
 
-                ColorWidget {
-                    text: "Color:";
-                    color: backendValues.color.value;
-                    onColorChanged: {
-                        backendValues.color.value = strColor;
-                    }
-                }
-                ColorWidget {
-                    text: "Style color:";
-                    color: backendValues.styleColor.value;
-                    onColorChanged: {
-                        backendValues.styleColor.value = strColor;
-                    }
-                }
-            }
+        QScrollArea {
         }
     }
 }
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/Type.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/Type.qml
index c20362bc843..4dfd15083dc 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/Type.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/Type.qml
@@ -5,51 +5,25 @@ GroupBox {
     finished: finishedNotify;
     caption: "Type";
 
-    maximumHeight: 100;
-    minimumWidth: 280;
-    layout: QHBoxLayout {
-        topMargin: 18;
-        bottomMargin: 0;
-        leftMargin: 60;
-        rightMargin: 10;
-
-
-
+    layout: VerticalLayout {
         QWidget {
-            layout: QVBoxLayout {
-                topMargin: 6;
-                bottomMargin: 0;
-                leftMargin: 10;
-                bottomMargin: 10;
-
-                QLabel {
+            layout: HorizontalLayout {
+                Label {
                     text: "Type";
-                    windowTextColor: isBaseState ? "#000000" : "#FF0000";
-                    alignment: "Qt::AlignRight | Qt::AlignVCenter"
-                }
-
-                QLabel {
-                    font.bold: true;
-                    text: "Id";
-                    alignment: "Qt::AlignRight | Qt::AlignVCenter"
-                }
-
-
-            } //QVBoxLayout
-        } //QWidget
-        QWidget {
-
-            layout: QVBoxLayout {
-                topMargin: 6;
-                bottomMargin: 0;
-                leftMargin: 10;
-                bottomMargin: 10;
-
+                    windowTextColor: isBaseState ? "#000000" : "#FF0000";                 
+                }                
                 QLineEdit {
                     styleSheetFile: "typeLabel.css"
                     text: backendValues.className === undefined ? "" : backendValues.className.value;
                     readOnly :true;
                 }
+            }
+        }
+        QWidget {            
+            layout: HorizontalLayout {
+                Label {
+                    text: "Id";
+                }
 
                 QLineEdit {
                     id: IdLineEdit;
@@ -59,12 +33,8 @@ GroupBox {
                     onEditingFinished: {
                         backendValues.id.value = text;
                     }
-                } //LineEdit
-
-
-            } //QVBoxLayout
-        } //QWidget
-
-
-    } //QHBoxLayout
+                }
+            }
+        }
+    }
 }
-- 
GitLab