Skip to content
Snippets Groups Projects
Commit 1387ee81 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: support for pixelSize

parent 659b9b5c
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,6 @@ GroupBox { ...@@ -9,7 +9,6 @@ GroupBox {
QWidget { QWidget {
layout: HorizontalLayout { layout: HorizontalLayout {
rightMargin: 12
Label { Label {
text: qsTr("Font") text: qsTr("Font")
} }
...@@ -20,15 +19,56 @@ GroupBox { ...@@ -20,15 +19,56 @@ GroupBox {
} }
} }
} }
IntEditor { QWidget {
maximumWidth: 200 id: sizeWidget
caption: qsTr("Size") property bool selectionFlag: selectionChanged
slider: false
backendValue: backendValues.font_pointSize property bool pixelSize: sizeType.currentText == "pixels"
baseStateFlag: isBaseState; 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 { QWidget {
layout: HorizontalLayout { layout: HorizontalLayout {
Label { Label {
...@@ -42,8 +82,7 @@ GroupBox { ...@@ -42,8 +82,7 @@ GroupBox {
QWidget { QWidget {
visible: showStyle visible: showStyle
layout: HorizontalLayout { layout: HorizontalLayout {
rightMargin: 12
Label { Label {
text: qsTr("Style") text: qsTr("Style")
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment