Commit 9e94ca06 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: activate new color editing

parent a215012c
......@@ -2,194 +2,194 @@ import Qt 4.6
import Bauhaus 1.0
GroupBox {
caption: "Effect"
id: Extended;
maximumHeight: 260;
layout: VerticalLayout{
property var effect: backendValues.effect
property var complexNode: effect.complexNode
QWidget {
maximumHeight: 40;
layout: HorizontalLayout {
Label {
text: "Effect ";
}
QComboBox {
enabled: isBaseState;
property var type: backendValues.effect.complexNode.type
property var dirty;
id: effectComboBox;
items : { [
"None",
"Blur",
"Opacity",
"Colorize",
"DropShadow"
] }
onCurrentTextChanged: {
if (dirty) //avoid recursion;
return;
if (backendValues.effect.complexNode.exists)
backendValues.effect.complexNode.remove();
if (currentText == "None") {
;
} else if (backendValues.effect.complexNode != null) {
backendValues.effect.complexNode.add("Qt/" + currentText);
}
}
onTypeChanged: {
dirty = true;
if (backendValues.effect.complexNode.exists)
currentText = backendValues.effect.complexNode.type;
else
currentText = "None";
dirty = false;
}
}
QWidget {
caption: "Effect"
id: Extended;
maximumHeight: 260;
layout: VerticalLayout{
property var effect: backendValues.effect
property var complexNode: effect.complexNode
QWidget {
maximumHeight: 40;
layout: HorizontalLayout {
Label {
text: "Effect ";
}
QComboBox {
enabled: isBaseState;
property var type: backendValues.effect.complexNode.type
property var dirty;
id: effectComboBox;
items : { [
"None",
"Blur",
"Opacity",
"Colorize",
"DropShadow"
] }
onCurrentTextChanged: {
if (dirty) //avoid recursion;
return;
if (backendValues.effect.complexNode.exists)
backendValues.effect.complexNode.remove();
if (currentText == "None") {
;
} else if (backendValues.effect.complexNode != null) {
backendValues.effect.complexNode.add("Qt/" + currentText);
}
}
onTypeChanged: {
dirty = true;
if (backendValues.effect.complexNode.exists)
currentText = backendValues.effect.complexNode.type;
else
currentText = "None";
dirty = false;
}
}
QWidget {
fixedWidth: 100
}
}
}// QWidget
property var properties: complexNode == null ? null : complexNode.properties
QWidget {
minimumHeight: 20;
layout: QVBoxLayout {
QWidget {
visible: effectComboBox.currentText == "Blur";
layout: QVBoxLayout {
topMargin: 12;
IntEditor {
id: blurRadius;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.blurRadius : null;
caption: "Blur Radius:"
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 20;
}
}
}
QWidget {
visible: effectComboBox.currentText == "Opacity";
layout: QVBoxLayout {
DoubleSpinBox {
id: OpcacityEffectSpinBox;
objectName: "OpcacityEffectSpinBox";
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.opacity : null;
minimum: 0;
maximum: 1;
singleStep: 0.1;
baseStateFlag: isBaseState;
}
}
}
QWidget {
visible: effectComboBox.currentText == "Colorize";
layout: QVBoxLayout {
property var colorProp: properties == null ? null : properties.color
ColorWidget {
id: ColorizeColor;
text: "Color:";
minimumHeight: 20;
minimumWidth: 20;
color: (colorProp == null) ? "black" : colorProp.value;
onColorChanged: {
colorProp.value = strColor;
}// QWidget
property var properties: complexNode == null ? null : complexNode.properties
QWidget {
minimumHeight: 20;
layout: QVBoxLayout {
QWidget {
visible: effectComboBox.currentText == "Blur";
layout: QVBoxLayout {
topMargin: 12;
IntEditor {
id: blurRadius;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.blurRadius : null;
caption: "Blur Radius:"
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 20;
}
}
}
}
}
}
QWidget {
visible: effectComboBox.currentText == "Pixelize";
layout: QVBoxLayout {
topMargin: 12;
IntEditor {
id: pixelSize;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.pixelSize : null;
caption: "Pixel Size:"
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 20;
}
}
}
QWidget {
visible: effectComboBox.currentText == "DropShadow";
layout: QVBoxLayout {
topMargin: 12;
IntEditor {
id: blurRadiusShadow;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.blurRadius : null;
caption: "Blur Radius:"
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 20;
}
QWidget {
visible: effectComboBox.currentText == "Opacity";
layout: QVBoxLayout {
DoubleSpinBox {
id: OpcacityEffectSpinBox;
objectName: "OpcacityEffectSpinBox";
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.opacity : null;
minimum: 0;
maximum: 1;
singleStep: 0.1;
baseStateFlag: isBaseState;
}
}
}
QWidget {
visible: effectComboBox.currentText == "Colorize";
layout: QVBoxLayout {
property var colorProp: properties == null ? null : properties.color
ColorLabel {
text: " Color"
}
ColorGroupBox {
finished: finishedNotify
ColorWidget {
id: DropShadowColor;
maximumHeight: 40;
text: "Color:";
minimumHeight: 20;
minimumWidth: 20;
color: properties == null || properties.color == null ? "black" : properties.color.value
onColorChanged: {
if (properties != null && properties.color != null)
properties.color.value = strColor;
backendColor: properties.color
}
}
}
}
IntEditor {
id: xOffset;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.xOffset : null;
caption: "x Offset: "
baseStateFlag: isBaseState;
QWidget {
visible: effectComboBox.currentText == "Pixelize";
layout: QVBoxLayout {
topMargin: 12;
IntEditor {
id: pixelSize;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.pixelSize : null;
caption: "Pixel Size:"
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 20;
}
}
}
step: 1;
minimumValue: 0;
maximumValue: 20;
}
QWidget {
visible: effectComboBox.currentText == "DropShadow";
layout: QVBoxLayout {
topMargin: 12;
IntEditor {
id: blurRadiusShadow;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.blurRadius : null;
caption: "Blur Radius:"
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 20;
}
ColorLabel {
text: " Color"
}
IntEditor {
id: yOffset;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.yOffset : null;
caption: "y Offset: "
baseStateFlag: isBaseState;
ColorGroupBox {
step: 1;
minimumValue: 0;
maximumValue: 20;
finished: finishedNotify
backendColor: properties.color
}
IntEditor {
id: xOffset;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.xOffset : null;
caption: "x Offset: "
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 20;
}
IntEditor {
id: yOffset;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.yOffset : null;
caption: "y Offset: "
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 20;
}
}
}
}
}
}
}
}
} //QVBoxLayout
}
} //QVBoxLayout
} //GroupBox
......@@ -15,7 +15,7 @@ GroupBox {
QWidget {
id: parentWidget
minimumWidth: 180
minimumHeight: 24
minimumHeight: 26
QFontComboBox {
width: parentWidget.width
height: parentWidget.height
......
import Qt 4.6
import Bauhaus 1.0
GroupBox {
finished: finishedNotify;
caption: "Rect"
maximumHeight: 340;
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;
}
ColorWidget {
text: "Color";
color: backendValues.color === undefined ? null : backendValues.color.value;
onColorChanged: {
backendValues.color.value = strColor;
}
//modelNode: backendValues.color.modelNode;
complexGradientNode: backendValues.color === undefined ? null : backendValues.color.complexNode
//showGradientButton: true;
}
ColorWidget {
text: "Tint color";
color: backendValues.tintColor === undefined ? "black" : backendValues.tintColor.value
onColorChanged: {
backendValues.color.value = strColor;
QWidget {
layout: QVBoxLayout {
topMargin: 0
bottomMargin: 0
leftMargin: 0
rightMargin: 0
spacing: 0
RectangleColorGroupBox {
}
GroupBox {
finished: finishedNotify;
caption: "Rectangle"
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;
}
}
}
ColorWidget {
id: PenColor;
text: "Pen Color";
minimumHeight: 20;
minimumWidth: 20;
color: backendValues.border_color.value;
onColorChanged: {
backendValues.border_color.value = strColor;
}
}
QScrollArea {
}
}
}
......@@ -67,21 +67,29 @@ GroupBox {
}
}
}
ColorWidget {
text: "Color:";
color: backendValues.color.value;
onColorChanged: {
backendValues.color.value = strColor;
}
ColorLabel {
text: " Color"
}
ColorWidget {
visible: showStyleColor
text: "Style color:";
color: (backendValues.styleColor === undefined || backendValues.styleColor === null)
? "#000000" : backendValues.styleColor.value;
onColorChanged: {
backendValues.styleColor.value = strColor;
}
ColorGroupBox {
finished: finishedNotify
backendColor: backendValues.color
}
ColorLabel {
visible: showStyleColor
text: " Style Color"
}
ColorGroupBox {
visible: showStyleColor
finished: finishedNotify
backendColor: backendValues.styleColor || null
}
}
}
......@@ -7,24 +7,28 @@ GroupBox {
caption: "Text Input";
layout: VerticalLayout {
ColorWidget {
text: "Selection Color:";
color: backendValues.selectionColor.value;
onColorChanged: {
backendValues.selectionColor.value = strColor;
}
ColorLabel {
text: " Selection Color"
}
ColorWidget {
text: "Selected Text Color:";
color: backendValues.selectedTextColor.value;
onColorChanged: {
backendValues.selectedTextColor.value = strColor;
}
ColorGroupBox {
finished: finishedNotify
backendColor: backendValues.selectionColor
}
ColorLabel {
text: " Selected Text Color"
}
ColorGroupBox {
finished: finishedNotify
backendColor: backendValues.selectedTextColor
}
QWidget {
layout: HorizontalLayout {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment