aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qmldesigner/propertyeditor/Qt/AlignmentHorizontalButtons.qml
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@nokia.com>2010-04-20 17:07:37 +0200
committerThomas Hartmann <Thomas.Hartmann@nokia.com>2010-04-21 11:45:37 +0200
commitf088c39579766746822150fb8a29758f81c203c7 (patch)
treea5af67e2c2ae066c52ac8ff585ff2c852982d39c /share/qtcreator/qmldesigner/propertyeditor/Qt/AlignmentHorizontalButtons.qml
parentf8b8c3a9189e38e2100e7ef2e9aaf5b1cd4d1cc0 (diff)
QmlDesigner.propertyEditor: cleanup buttons for alignment and colors
This commit cleans up the design of the buttons and fixes BAUHAUS-612
Diffstat (limited to 'share/qtcreator/qmldesigner/propertyeditor/Qt/AlignmentHorizontalButtons.qml')
-rw-r--r--share/qtcreator/qmldesigner/propertyeditor/Qt/AlignmentHorizontalButtons.qml92
1 files changed, 81 insertions, 11 deletions
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/AlignmentHorizontalButtons.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/AlignmentHorizontalButtons.qml
index c5df4da92f..1b4c5cd8e9 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/AlignmentHorizontalButtons.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/AlignmentHorizontalButtons.qml
@@ -3,6 +3,56 @@ import Bauhaus 1.0
QGroupBox {
id: aligmentHorizontalButtons
+
+ property variant theValue: backendValues.horizontalAlignment.value;
+
+ property bool blueHigh: false
+
+ property bool baseStateFlag: isBaseState;
+
+ property variant backendValue: backendValues.horizontalAlignment;
+
+
+ onBaseStateFlagChanged: {
+ evaluate();
+ }
+
+ property bool isInModel: backendValue.isInModel;
+ onIsInModelChanged: {
+ evaluate();
+ }
+ property bool isInSubState: backendValue.isInSubState;
+ onIsInSubStateChanged: {
+ evaluate();
+ }
+
+ onTheValueChanged: {
+ if (theValue != undefined) {
+ leftButton.checked = theValue == "AlignLeft";
+ centerButton.checked = theValue == "AlignHCenter";
+ rightButton.checked = theValue == "AlignRight";
+ }
+ evaluate();
+ }
+
+ function evaluate() {
+ if (!enabled) {
+ fontSelector.setStyleSheet("color: "+scheme.disabledColor);
+ } else {
+ if (baseStateFlag) {
+ if (backendValue != null && backendValue.isInModel)
+ blueHigh = true;
+ else
+ blueHigh = false;
+ } else {
+ if (backendValue != null && backendValue.isInSubState)
+ blueHigh = true;
+ else
+ blueHigh = false;
+ }
+ }
+ }
+
layout: HorizontalLayout {
topMargin: 6
@@ -11,12 +61,18 @@ QGroupBox {
QPushButton {
id: leftButton
+
checkable: true
- fixedWidth: 32
+ iconSize.width: 24;
+ iconSize.height: 24;
+ fixedWidth: 52
width: fixedWidth
- fixedHeight: 32
+ fixedHeight: 28
height: fixedHeight
- styleSheetFile: "alignmentleftbutton.css";
+ styleSheetFile: "styledbuttonleft.css";
+
+ iconFromFile: blueHigh ? "images/alignmentleft-h-icon.png" : "images/alignmentleft-icon.png"
+
checked: backendValues.horizontalAlignment.value == "AlignLeft"
onClicked: {
@@ -26,17 +82,27 @@ QGroupBox {
rightButton.checked = false;
}
+ ExtendedFunctionButton {
+ backendValue: backendValues.horizontalAlignment;
+ y: 7
+ x: 2
+ }
+
}
QPushButton {
id: centerButton
- x: 32
+ x: 52
checkable: true
- fixedWidth: 32
+ iconSize.width: 24;
+ iconSize.height: 24;
+ fixedWidth: 31
width: fixedWidth
- fixedHeight: 32
+ fixedHeight: 28
height: fixedHeight
+ styleSheetFile: "styledbuttonmiddle.css";
+
+ iconFromFile: blueHigh ? "images/alignmentcenterh-h-icon.png" : "images/alignmentcenterh-icon.png"
- styleSheetFile: "alignmentcenterhbutton.css";
checked: backendValues.horizontalAlignment.value == "AlignHCenter"
onClicked: {
@@ -49,14 +115,18 @@ QGroupBox {
}
QPushButton {
id: rightButton
- x: 64
+ x: 83
checkable: true
- fixedWidth: 32
+ iconSize.width: 24;
+ iconSize.height: 24;
+ fixedWidth: 31
width: fixedWidth
- fixedHeight: 32
+ fixedHeight: 28
height: fixedHeight
+ styleSheetFile: "styledbuttonright.css";
+
+ iconFromFile: blueHigh ? "images/alignmentright-h-icon.png" : "images/alignmentright-icon.png"
- styleSheetFile: "alignmentrightbutton.css";
checked: backendValues.horizontalAlignment.value == "AlignRight"
onClicked: {