forked from qt-creator/qt-creator
QmlDesigner: Disable Properties unavailable in QUL
Disabling properties in: MouseArea Flickable Image Text (including Font) Change-Id: Id0a44fa73ff80bf4749c0bdc0f9eac3e2f488762 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -70,12 +70,14 @@ Column {
|
||||
|
||||
Label {
|
||||
text: qsTr("Source size")
|
||||
disabledState: !backendValues.sourceSize.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
Label {
|
||||
text: "W"
|
||||
width: 12
|
||||
disabledState: !backendValues.sourceSize_width.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -83,6 +85,7 @@ Column {
|
||||
minimumValue: 0
|
||||
maximumValue: 8192
|
||||
decimals: 0
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -93,6 +96,7 @@ Column {
|
||||
Label {
|
||||
text: "H"
|
||||
width: 12
|
||||
disabledState: !backendValues.sourceSize_height.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -100,6 +104,7 @@ Column {
|
||||
minimumValue: 0
|
||||
maximumValue: 8192
|
||||
decimals: 0
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
ExpandingSpacer {
|
||||
|
@@ -40,6 +40,7 @@ Column {
|
||||
Label {
|
||||
text: qsTr("Enabled")
|
||||
tooltip: qsTr("This property holds whether the item accepts mouse events.")
|
||||
disabledState: !backendValues.enabled.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -47,6 +48,7 @@ Column {
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.enabled
|
||||
text: backendValues.enabled.valueToString
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
ExpandingSpacer {
|
||||
@@ -56,6 +58,7 @@ Column {
|
||||
Label {
|
||||
text: qsTr("Hover enabled")
|
||||
tooltip: qsTr("This property holds whether hover events are handled.")
|
||||
disabledState: !backendValues.hoverEnabled.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -63,6 +66,7 @@ Column {
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.hoverEnabled
|
||||
text: backendValues.hoverEnabled.valueToString
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
ExpandingSpacer {
|
||||
@@ -72,6 +76,7 @@ Column {
|
||||
Label {
|
||||
text: qsTr("Accepted buttons")
|
||||
tooltip: qsTr("This property holds the mouse buttons that the mouse area reacts to.")
|
||||
disabledState: !backendValues.acceptedButtons.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -80,6 +85,7 @@ Column {
|
||||
model: ["LeftButton", "RightButton", "MiddleButton", "BackButton", "ForwardButton", "AllButtons"]
|
||||
Layout.fillWidth: true
|
||||
scope: "Qt"
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -104,6 +110,7 @@ Column {
|
||||
Label {
|
||||
text: qsTr("Scroll gesture enabled")
|
||||
tooltip: qsTr("This property controls whether this MouseArea responds to scroll gestures from non-mouse devices.")
|
||||
disabledState: !backendValues.scrollGestureEnabled.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -111,6 +118,7 @@ Column {
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.scrollGestureEnabled
|
||||
text: backendValues.scrollGestureEnabled.valueToString
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
ExpandingSpacer {
|
||||
@@ -120,6 +128,7 @@ Column {
|
||||
Label {
|
||||
text: qsTr("Cursor shape")
|
||||
tooltip: qsTr("This property holds the cursor shape for this mouse area.")
|
||||
disabledState: !backendValues.cursorShape.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -133,6 +142,7 @@ Column {
|
||||
"DragMoveCursor", "DragLinkCursor"]
|
||||
Layout.fillWidth: true
|
||||
scope: "Qt"
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -141,6 +151,7 @@ Column {
|
||||
Label {
|
||||
text: qsTr("Prevent stealing")
|
||||
tooltip: qsTr("This property controls whether the mouse events may be stolen from this MouseArea.")
|
||||
disabledState: !backendValues.preventStealing.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -148,6 +159,7 @@ Column {
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.preventStealing
|
||||
text: backendValues.preventStealing.valueToString
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
ExpandingSpacer {
|
||||
@@ -157,6 +169,7 @@ Column {
|
||||
Label {
|
||||
text: qsTr("Propagate composed events")
|
||||
tooltip: qsTr("This property controls whether composed mouse events will automatically propagate to other MouseAreas.")
|
||||
disabledState: !backendValues.propagateComposedEvents.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -164,6 +177,7 @@ Column {
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.propagateComposedEvents
|
||||
text: backendValues.propagateComposedEvents.valueToString
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
ExpandingSpacer {
|
||||
@@ -176,6 +190,7 @@ Column {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
caption: qsTr("Drag")
|
||||
visible: backendValues.drag_target.isAvailable
|
||||
|
||||
SectionLayout {
|
||||
Label {
|
||||
|
@@ -56,6 +56,7 @@ Column {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
caption: qsTr("Style Color")
|
||||
visible: backendValues.styleColor.isAvailable
|
||||
|
||||
ColorEditor {
|
||||
caption: qsTr("Style Color")
|
||||
|
@@ -42,6 +42,7 @@ Section {
|
||||
|
||||
Label {
|
||||
text: qsTr("Flick direction")
|
||||
disabledState: !backendValues.flickableDirection.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -50,6 +51,7 @@ Section {
|
||||
model: ["AutoFlickDirection", "AutoFlickIfNeeded", "HorizontalFlick", "VerticalFlick", "HorizontalAndVerticalFlick"]
|
||||
Layout.fillWidth: true
|
||||
scope: "Flickable"
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -58,6 +60,7 @@ Section {
|
||||
Label {
|
||||
text: qsTr("Behavior")
|
||||
tooltip: qsTr("Determines whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked.")
|
||||
disabledState: !backendValues.boundsBehavior.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -66,6 +69,7 @@ Section {
|
||||
model: ["StopAtBounds", "DragOverBounds", "OvershootBounds", "DragAndOvershootBounds"]
|
||||
Layout.fillWidth: true
|
||||
scope: "Flickable"
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -75,6 +79,7 @@ Section {
|
||||
Label {
|
||||
text: qsTr("Movement")
|
||||
tooltip: qsTr("Determines whether the Flickable will give a feeling that the edges of the view are soft, rather than a hard physical boundary.")
|
||||
disabledState: !backendValues.boundsMovement.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -83,6 +88,7 @@ Section {
|
||||
model: ["FollowBoundsBehavior", "StopAtBounds"]
|
||||
Layout.fillWidth: true
|
||||
scope: "Flickable"
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -122,6 +128,7 @@ Section {
|
||||
Label {
|
||||
text: qsTr("Deceleration")
|
||||
tooltip: qsTr("Flick deceleration")
|
||||
disabledState: !backendValues.flickDeceleration.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -130,6 +137,7 @@ Section {
|
||||
minimumValue: 0
|
||||
maximumValue: 8000
|
||||
decimals: 0
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -138,6 +146,7 @@ Section {
|
||||
Label {
|
||||
text: qsTr("Press delay")
|
||||
tooltip: qsTr("Holds the time to delay (ms) delivering a press to children of the Flickable.")
|
||||
disabledState: !backendValues.pressDelay.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -146,6 +155,7 @@ Section {
|
||||
minimumValue: 0
|
||||
maximumValue: 2000
|
||||
decimals: 0
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -154,6 +164,7 @@ Section {
|
||||
Label {
|
||||
text: qsTr("Pixel aligned")
|
||||
tooltip: qsTr("Sets the alignment of contentX and contentY to pixels (true) or subpixels (false).")
|
||||
disabledState: !backendValues.pixelAligned.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -161,6 +172,7 @@ Section {
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.pixelAligned
|
||||
text: backendValues.pixelAligned.valueToString
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -171,6 +183,7 @@ Section {
|
||||
tooltip: qsTr("If set to true, then when the mouse or touchpoint moves far enough to begin dragging\n"
|
||||
+ "the content, the content will jump, such that the content pixel which was under the\n"
|
||||
+ "cursor or touchpoint when pressed remains under that point.")
|
||||
disabledState: !backendValues.synchronousDrag.isAvailable
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -178,6 +191,7 @@ Section {
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.synchronousDrag
|
||||
text: backendValues.synchronousDrag.valueToString
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -265,12 +279,15 @@ Section {
|
||||
|
||||
Label {
|
||||
text: qsTr("Origin")
|
||||
disabledState: (!backendValues.originX.isAvailable
|
||||
&& !backendValues.originY.isAvailable)
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
Label {
|
||||
text: "X"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.originX.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -279,6 +296,7 @@ Section {
|
||||
maximumValue: 8000
|
||||
implicitWidth: root.spinBoxWidth
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -289,6 +307,7 @@ Section {
|
||||
Label {
|
||||
text: "Y"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.originY.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -297,6 +316,7 @@ Section {
|
||||
maximumValue: 8000
|
||||
implicitWidth: root.spinBoxWidth
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -304,6 +324,10 @@ Section {
|
||||
|
||||
Label {
|
||||
text: qsTr("Margins")
|
||||
disabledState: (!backendValues.topMargin.isAvailable
|
||||
&& !backendValues.bottomMargin.isAvailable
|
||||
&& !backendValues.leftMargin.isAvailable
|
||||
&& !backendValues.rightMargin.isAvailable)
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -312,6 +336,7 @@ Section {
|
||||
Label {
|
||||
text: "Top"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.topMargin.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -321,6 +346,7 @@ Section {
|
||||
decimals: 0
|
||||
implicitWidth: root.spinBoxWidth
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -331,6 +357,7 @@ Section {
|
||||
Label {
|
||||
text: "Bottom"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.bottomMargin.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -340,6 +367,7 @@ Section {
|
||||
decimals: 0
|
||||
implicitWidth: root.spinBoxWidth
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
@@ -355,6 +383,7 @@ Section {
|
||||
Label {
|
||||
text: "Left"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.leftMargin.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -364,6 +393,7 @@ Section {
|
||||
decimals: 0
|
||||
implicitWidth: root.spinBoxWidth
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -374,6 +404,7 @@ Section {
|
||||
Label {
|
||||
text: "Right"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.rightMargin.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -383,6 +414,7 @@ Section {
|
||||
decimals: 0
|
||||
implicitWidth: root.spinBoxWidth
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {
|
||||
}
|
||||
|
@@ -153,12 +153,13 @@ Section {
|
||||
italic: fontSection.italicStyle
|
||||
underline: fontSection.underlineStyle
|
||||
strikeout: fontSection.strikeoutStyle
|
||||
enabled: !styleComboBox.styleSet
|
||||
enabled: !styleNameComboBox.styleSet
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Font capitalization")
|
||||
toolTip: qsTr("Sets the capitalization for the text.")
|
||||
disabledState: !getBackendValue("capitalization").isAvailable
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
@@ -166,6 +167,7 @@ Section {
|
||||
backendValue: getBackendValue("capitalization")
|
||||
model: ["MixedCase", "AllUppercase", "AllLowercase", "SmallCaps", "Capitalize"]
|
||||
scope: "Font"
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
@@ -178,38 +180,45 @@ Section {
|
||||
backendValue: getBackendValue("weight")
|
||||
model: ["Normal", "Light", "ExtraLight", "Thin", "Medium", "DemiBold", "Bold", "ExtraBold", "Black"]
|
||||
scope: "Font"
|
||||
enabled: !styleComboBox.styleSet
|
||||
enabled: !styleNameComboBox.styleSet
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Style name")
|
||||
toolTip: qsTr("Sets the font's style.")
|
||||
disabledState: !styleNameComboBox.enabled
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: styleComboBox
|
||||
id: styleNameComboBox
|
||||
property bool styleSet: backendValue.isInModel
|
||||
Layout.fillWidth: true
|
||||
backendValue: getBackendValue("styleName")
|
||||
model: styleNamesForFamily(fontComboBox.familyName)
|
||||
valueType: ComboBox.String
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: showStyle
|
||||
text: qsTr("Style")
|
||||
disabledState: !styleComboBox.enabled
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: styleComboBox
|
||||
visible: showStyle
|
||||
Layout.fillWidth: true
|
||||
backendValue: (backendValues.style === undefined) ? dummyBackendValue : backendValues.style
|
||||
model: ["Normal", "Outline", "Raised", "Sunken"]
|
||||
scope: "Text"
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Spacing")
|
||||
disabledState: (!getBackendValue("wordSpacing").isAvailable &&
|
||||
!getBackendValue("letterSpacing").isAvailable)
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -222,18 +231,19 @@ Section {
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: 60
|
||||
stepSize: 0.1
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Word")
|
||||
tooltip: qsTr("Sets the word spacing for the font.")
|
||||
width: 42
|
||||
disabledState: !getBackendValue("wordSpacing").isAvailable
|
||||
}
|
||||
Item {
|
||||
width: 4
|
||||
height: 4
|
||||
}
|
||||
|
||||
|
||||
SpinBox {
|
||||
maximumValue: 500
|
||||
minimumValue: -500
|
||||
@@ -242,17 +252,21 @@ Section {
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: 60
|
||||
stepSize: 0.1
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Letter")
|
||||
tooltip: qsTr("Sets the letter spacing for the font.")
|
||||
width: 42
|
||||
disabledState: !getBackendValue("letterSpacing").isAvailable
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: minorQtQuickVersion > 9
|
||||
text: qsTr("Performance")
|
||||
disabledState: (!getBackendValue("kerning").isAvailable &&
|
||||
!getBackendValue("preferShaping").isAvailable)
|
||||
}
|
||||
|
||||
SecondColumnLayout {
|
||||
@@ -264,6 +278,7 @@ Section {
|
||||
backendValue: getBackendValue("kerning")
|
||||
tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " +
|
||||
"improve performance when creating or changing the text, at the expense of some cosmetic features. The default value is true.")
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
@@ -273,12 +288,14 @@ Section {
|
||||
tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" +
|
||||
"In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " +
|
||||
"Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.")
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Hinting preference")
|
||||
toolTip: qsTr("Sets the preferred hinting on the text.")
|
||||
disabledState: !getBackendValue("hintingPreference").isAvailable
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
@@ -286,6 +303,7 @@ Section {
|
||||
backendValue: getBackendValue("hintingPreference")
|
||||
model: ["PreferDefaultHinting", "PreferNoHinting", "PreferVerticalHinting", "PreferFullHinting"]
|
||||
scope: "Font"
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ ButtonRow {
|
||||
BoolButtonRowButton {
|
||||
buttonIcon: StudioTheme.Constants.fontStyleBold
|
||||
backendValue: bold
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
Item {
|
||||
width: 4
|
||||
@@ -45,6 +46,7 @@ ButtonRow {
|
||||
BoolButtonRowButton {
|
||||
buttonIcon: StudioTheme.Constants.fontStyleItalic
|
||||
backendValue: italic
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
Item {
|
||||
width: 4
|
||||
@@ -53,6 +55,7 @@ ButtonRow {
|
||||
BoolButtonRowButton {
|
||||
buttonIcon: StudioTheme.Constants.fontStyleUnderline
|
||||
backendValue: underline
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
Item {
|
||||
width: 4
|
||||
@@ -61,5 +64,6 @@ ButtonRow {
|
||||
BoolButtonRowButton {
|
||||
buttonIcon: StudioTheme.Constants.fontStyleStrikethrough
|
||||
backendValue: strikeout
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
}
|
||||
|
@@ -76,6 +76,7 @@ Section {
|
||||
Label {
|
||||
visible: showVerticalAlignment
|
||||
text: qsTr("Wrap mode")
|
||||
disabledState: !backendValues.wrapMode.isAvailable
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
@@ -84,11 +85,13 @@ Section {
|
||||
backendValue: backendValues.wrapMode
|
||||
scope: "Text"
|
||||
model: ["NoWrap", "WordWrap", "WrapAnywhere", "Wrap"]
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: showElide
|
||||
text: qsTr("Elide")
|
||||
disabledState: !backendValues.elide.isAvailable
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
@@ -97,12 +100,14 @@ Section {
|
||||
backendValue: backendValues.elide
|
||||
scope: "Text"
|
||||
model: ["ElideNone", "ElideLeft", "ElideMiddle", "ElideRight"]
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: showElide
|
||||
text: qsTr("Maximum line count")
|
||||
tooltip: qsTr("Limits the number of lines that the text item will show.")
|
||||
disabledState: !backendValues.maximumLineCount.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -112,6 +117,7 @@ Section {
|
||||
minimumValue: 0
|
||||
maximumValue: 10000
|
||||
decimals: 0
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
@@ -135,6 +141,7 @@ Section {
|
||||
Label {
|
||||
visible: showFormatProperty
|
||||
text: qsTr("Format")
|
||||
disabledState: !backendValues.textFormat.isAvailable
|
||||
}
|
||||
ComboBox {
|
||||
scope: "Text"
|
||||
@@ -142,23 +149,27 @@ Section {
|
||||
model: ["PlainText", "RichText", "AutoText"]
|
||||
backendValue: backendValues.textFormat
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Render type")
|
||||
toolTip: qsTr("Override the default rendering type for this item.")
|
||||
disabledState: !backendValues.renderType.isAvailable
|
||||
}
|
||||
ComboBox {
|
||||
scope: "Text"
|
||||
model: ["QtRendering", "NativeRendering"]
|
||||
backendValue: backendValues.renderType
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: showFontSizeMode
|
||||
text: qsTr("Font size mode")
|
||||
toolTip: qsTr("Specifies how the font size of the displayed text is determined.")
|
||||
disabledState: !backendValues.fontSizeMode.isAvailable
|
||||
}
|
||||
ComboBox {
|
||||
id: fontSizeMode
|
||||
@@ -167,17 +178,20 @@ Section {
|
||||
model: ["FixedSize", "HorizontalFit", "VerticalFit", "Fit"]
|
||||
backendValue: backendValues.fontSizeMode
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: showFontSizeMode
|
||||
text: qsTr("Minimum size")
|
||||
disabledState: !backendValues.minimumPixelSize.isAvailable
|
||||
&& !backendValues.minimumPointSize.isAvailable
|
||||
}
|
||||
SecondColumnLayout {
|
||||
visible: showFontSizeMode
|
||||
|
||||
SpinBox {
|
||||
enabled: fontSizeMode.currentIndex !== 0
|
||||
enabled: (fontSizeMode.currentIndex !== 0) || backendValue.isAvailable
|
||||
minimumValue: 0
|
||||
maximumValue: 500
|
||||
decimals: 0
|
||||
@@ -189,6 +203,7 @@ Section {
|
||||
text: qsTr("Pixel")
|
||||
tooltip: qsTr("Specifies the minimum font pixel size of scaled text.")
|
||||
width: 42
|
||||
disabledState: !backendValues.minimumPixelSize.isAvailable
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -197,7 +212,7 @@ Section {
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
enabled: fontSizeMode.currentIndex !== 0
|
||||
enabled: (fontSizeMode.currentIndex !== 0) || backendValue.isAvailable
|
||||
minimumValue: 0
|
||||
maximumValue: 500
|
||||
decimals: 0
|
||||
@@ -209,6 +224,7 @@ Section {
|
||||
text: qsTr("Point")
|
||||
tooltip: qsTr("Specifies the minimum font point size of scaled text.")
|
||||
width: 42
|
||||
disabledState: !backendValues.minimumPointSize.isAvailable
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,9 +232,11 @@ Section {
|
||||
visible: showLineHeight
|
||||
text: qsTr("Line height")
|
||||
tooltip: qsTr("Sets the line height for the text.")
|
||||
disabledState: !lineHeightSpinBox.enabled
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
id: lineHeightSpinBox
|
||||
visible: showLineHeight
|
||||
Layout.fillWidth: true
|
||||
backendValue: (backendValues.lineHeight === undefined) ? dummyBackendValue : backendValues.lineHeight
|
||||
@@ -226,12 +244,14 @@ Section {
|
||||
minimumValue: 0
|
||||
decimals: 2
|
||||
stepSize: 0.1
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: showLineHeight
|
||||
text: qsTr("Line height mode")
|
||||
toolTip: qsTr("Determines how the line height is specified.")
|
||||
disabledState: !backendValues.lineHeightMode.isAvailable
|
||||
}
|
||||
ComboBox {
|
||||
visible: showLineHeight
|
||||
@@ -239,6 +259,7 @@ Section {
|
||||
model: ["ProportionalHeight", "FixedHeight"]
|
||||
backendValue: backendValues.lineHeightMode
|
||||
Layout.fillWidth: true
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -271,21 +271,58 @@ static bool itemOrImage(const QmlDesigner::NodeMetaInfo &metaInfo)
|
||||
return false;
|
||||
}
|
||||
|
||||
static QList<QByteArray> prepareNonMcuProperties()
|
||||
{
|
||||
QList<QByteArray> result;
|
||||
|
||||
const QList<QByteArray> itemProperties = {"layer", "opacity", "gradient", "smooth", "antialiasing",
|
||||
"border", "baselineOffset", "focus", "activeFocusOnTab"};
|
||||
const QList<QByteArray> mouseAreaProperties = {"propagateComposedEvents", "preventStealing", "cursorShape",
|
||||
"scrollGestureEnabled", "drag", "acceptedButtons", "hoverEnabled"};
|
||||
const QList<QByteArray> flickableProperties = {"boundsBehavior", "boundsMovement",
|
||||
"flickDeceleration", "flickableDirection",
|
||||
"leftMargin", "rightMargin", "bottomMargin", "topMargin",
|
||||
"originX", "originY",
|
||||
"pixelAligned", "pressDelay", "synchronousDrag"};
|
||||
const QList<QByteArray> imageProperties = {"mirror", "mipmap", "cache", "autoTransform", "asynchronous",
|
||||
"sourceSize", "smooth"};
|
||||
const QList<QByteArray> textProperties = {"elide", "lineHeight", "lineHeightMode", "wrapMode", "style",
|
||||
"styleColor", "minimumPointSize", "minimumPixelSize", "styleColor",
|
||||
"fontSizeMode", "renderType", "textFormat", "maximumLineCount"};
|
||||
|
||||
result.append(itemProperties);
|
||||
result.append(mouseAreaProperties);
|
||||
result.append(flickableProperties);
|
||||
result.append(imageProperties);
|
||||
result.append(textProperties);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool PropertyEditorValue::isAvailable() const
|
||||
{
|
||||
const QList<QByteArray> mcuProperties = {"layer", "opacity", "gradient", "smooth", "antialiasing"};
|
||||
const QList<QByteArray> nonMcuProperties = prepareNonMcuProperties();
|
||||
|
||||
const QByteArray fontPrefix = {"font"};
|
||||
const QList<QByteArray> nonMcuFontProperties = {"wordSpacing", "letterSpacing", "hintingPreference",
|
||||
"kerning", "preferShaping", "capitalization",
|
||||
"strikeout", "underline", "styleName"};
|
||||
|
||||
const QList<QByteArray> mcuTransformProperties = {"rotation", "scale", "transformOrigin"};
|
||||
|
||||
const QList<QByteArray> list = name().split('.');
|
||||
const QByteArray pureName = list.first();
|
||||
const QByteArray pureName = list.constFirst();
|
||||
|
||||
QmlDesigner::DesignDocument *designDocument = QmlDesigner::QmlDesignerPlugin::instance()
|
||||
->documentManager()
|
||||
.currentDesignDocument();
|
||||
|
||||
if (designDocument && designDocument->isQtForMCUsProject()) {
|
||||
if (mcuProperties.contains(pureName))
|
||||
if (pureName == fontPrefix) {
|
||||
if (nonMcuFontProperties.contains(list.constLast()))
|
||||
return false;
|
||||
}
|
||||
if (nonMcuProperties.contains(pureName))
|
||||
return false;
|
||||
if (mcuTransformProperties.contains(pureName) && !itemOrImage(m_modelNode.metaInfo()))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user