forked from qt-creator/qt-creator
QmlDesigner: Add fontStyle support
Task-number: QDS-1884 Change-Id: Ifb3ec8cf92668adb2e4e5f01e0e0b2403eb4cbac Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -68,9 +68,12 @@ Section {
|
|||||||
text: qsTr("Font")
|
text: qsTr("Font")
|
||||||
}
|
}
|
||||||
FontComboBox {
|
FontComboBox {
|
||||||
|
id: fontComboBox
|
||||||
backendValue: fontSection.fontFamily
|
backendValue: fontSection.fontFamily
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
width: 160
|
width: 160
|
||||||
|
property string familyName: backendValue.value
|
||||||
|
onFamilyNameChanged: print(styleNamesForFamily(familyName))
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@@ -151,6 +154,7 @@ Section {
|
|||||||
italic: fontSection.italicStyle
|
italic: fontSection.italicStyle
|
||||||
underline: fontSection.underlineStyle
|
underline: fontSection.underlineStyle
|
||||||
strikeout: fontSection.strikeoutStyle
|
strikeout: fontSection.strikeoutStyle
|
||||||
|
enabled: !styleComboBox.styleSet
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@@ -175,6 +179,21 @@ Section {
|
|||||||
backendValue: getBackendValue("weight")
|
backendValue: getBackendValue("weight")
|
||||||
model: ["Normal", "Light", "ExtraLight", "Thin", "Medium", "DemiBold", "Bold", "ExtraBold", "Black"]
|
model: ["Normal", "Light", "ExtraLight", "Thin", "Medium", "DemiBold", "Bold", "ExtraBold", "Black"]
|
||||||
scope: "Font"
|
scope: "Font"
|
||||||
|
enabled: !styleComboBox.styleSet
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Style name")
|
||||||
|
toolTip: qsTr("Sets the font's style.")
|
||||||
|
}
|
||||||
|
|
||||||
|
ComboBox {
|
||||||
|
id: styleComboBox
|
||||||
|
property bool styleSet: backendValue.isInModel
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: getBackendValue("styleName")
|
||||||
|
model: styleNamesForFamily(fontComboBox.familyName)
|
||||||
|
useString: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
Reference in New Issue
Block a user