Commit 1387ee81 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: support for pixelSize

parent 659b9b5c
......@@ -9,7 +9,6 @@ GroupBox {
QWidget {
layout: HorizontalLayout {
rightMargin: 12
Label {
text: qsTr("Font")
}
......@@ -20,15 +19,56 @@ GroupBox {
}
}
}
IntEditor {
maximumWidth: 200
caption: qsTr("Size")
slider: false
backendValue: backendValues.font_pointSize
baseStateFlag: isBaseState;
QWidget {
id: sizeWidget
property bool selectionFlag: selectionChanged
property bool pixelSize: sizeType.currentText == "pixels"
property bool isSetup;
onSelectionFlagChanged: {
isSetup = true;
sizeType.currentText = "points";
if (backendValues.font_pixelSize.isInModel)
sizeType.currentText = "pixels";
isSetup = false;
}
layout: HorizontalLayout {
Label {
text: qsTr("Size")
}
SpinBox {
visible: !sizeWidget.pixelSize
backendValue: backendValues.font_pointSize
baseStateFlag: isBaseState;
}
SpinBox {
visible: sizeWidget.pixelSize
backendValue: backendValues.font_pixelSize
baseStateFlag: isBaseState;
}
QComboBox {
id: sizeType
maximumWidth: 60
items : { ["pixels", "points"] }
onCurrentTextChanged: {
if (sizeWidget.isSetup)
return;
if (currentText == "pixels") {
backendValues.font_pointSize.resetValue();
backendValues.font_pixelSize.value = 8;
} else {
backendValues.font_pixelSize.resetValue();
}
}
}
}
}
QWidget {
layout: HorizontalLayout {
Label {
......@@ -42,8 +82,7 @@ GroupBox {
QWidget {
visible: showStyle
layout: HorizontalLayout {
rightMargin: 12
layout: HorizontalLayout {
Label {
text: qsTr("Style")
}
......
Supports Markdown
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