diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml index 1b58801f8d967b5bfca1d06eed31caed144cc421..45659351a74d8b6e08babe834e310a84077bf2e1 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml @@ -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") }