forked from qt-creator/qt-creator
QmlDesigner: Compact option for label deactivation
Change-Id: Ie163f4c021212837b703d2615cbf78b953e056ec Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -77,7 +77,7 @@ Column {
|
||||
Label {
|
||||
text: "W"
|
||||
width: 12
|
||||
disabledState: !backendValues.sourceSize_width.isAvailable
|
||||
disabledStateSoft: !backendValues.sourceSize_width.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -96,7 +96,7 @@ Column {
|
||||
Label {
|
||||
text: "H"
|
||||
width: 12
|
||||
disabledState: !backendValues.sourceSize_height.isAvailable
|
||||
disabledStateSoft: !backendValues.sourceSize_height.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
|
@@ -287,7 +287,7 @@ Section {
|
||||
Label {
|
||||
text: "X"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.originX.isAvailable
|
||||
disabledStateSoft: !backendValues.originX.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -307,7 +307,7 @@ Section {
|
||||
Label {
|
||||
text: "Y"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.originY.isAvailable
|
||||
disabledStateSoft: !backendValues.originY.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -336,7 +336,7 @@ Section {
|
||||
Label {
|
||||
text: "Top"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.topMargin.isAvailable
|
||||
disabledStateSoft: !backendValues.topMargin.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -357,7 +357,7 @@ Section {
|
||||
Label {
|
||||
text: "Bottom"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.bottomMargin.isAvailable
|
||||
disabledStateSoft: !backendValues.bottomMargin.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -383,7 +383,7 @@ Section {
|
||||
Label {
|
||||
text: "Left"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.leftMargin.isAvailable
|
||||
disabledStateSoft: !backendValues.leftMargin.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -404,7 +404,7 @@ Section {
|
||||
Label {
|
||||
text: "Right"
|
||||
width: root.labelWidth
|
||||
disabledState: !backendValues.rightMargin.isAvailable
|
||||
disabledStateSoft: !backendValues.rightMargin.isAvailable
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
|
@@ -237,7 +237,7 @@ Section {
|
||||
text: qsTr("Word")
|
||||
tooltip: qsTr("Sets the word spacing for the font.")
|
||||
width: 42
|
||||
disabledState: !getBackendValue("wordSpacing").isAvailable
|
||||
disabledStateSoft: !getBackendValue("wordSpacing").isAvailable
|
||||
}
|
||||
Item {
|
||||
width: 4
|
||||
@@ -258,7 +258,7 @@ Section {
|
||||
text: qsTr("Letter")
|
||||
tooltip: qsTr("Sets the letter spacing for the font.")
|
||||
width: 42
|
||||
disabledState: !getBackendValue("letterSpacing").isAvailable
|
||||
disabledStateSoft: !getBackendValue("letterSpacing").isAvailable
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -37,7 +37,9 @@ Label {
|
||||
property alias toolTip: toolTipArea.tooltip
|
||||
|
||||
width: Math.max(Math.min(240, parent.width - 280), 50)
|
||||
color: label.disabledState ? StudioTheme.Values.themeDisabledTextColor : StudioTheme.Values.themeTextColor
|
||||
color: ((label.disabledState || label.disabledStateSoft)
|
||||
? StudioTheme.Values.themeDisabledTextColor
|
||||
: StudioTheme.Values.themeTextColor)
|
||||
|
||||
elide: Text.ElideRight
|
||||
|
||||
@@ -50,7 +52,9 @@ Label {
|
||||
leftPadding: label.disabledState ? 10 : 0
|
||||
rightPadding: label.disabledState ? 10 : 0
|
||||
|
||||
//Label can be disabled fully (with [] and padding), or in a soft way: only with tooltip and color change.
|
||||
property bool disabledState: false
|
||||
property bool disabledStateSoft: false
|
||||
|
||||
Text {
|
||||
text: "["
|
||||
@@ -68,6 +72,8 @@ Label {
|
||||
ToolTipArea {
|
||||
id: toolTipArea
|
||||
anchors.fill: parent
|
||||
tooltip: label.disabledState ? qsTr("This property is not available in this configuration.") : label.text
|
||||
tooltip: ((label.disabledState || label.disabledStateSoft)
|
||||
? qsTr("This property is not available in this configuration.")
|
||||
: label.text)
|
||||
}
|
||||
}
|
||||
|
@@ -203,7 +203,7 @@ Section {
|
||||
text: qsTr("Pixel")
|
||||
tooltip: qsTr("Specifies the minimum font pixel size of scaled text.")
|
||||
width: 42
|
||||
disabledState: !backendValues.minimumPixelSize.isAvailable
|
||||
disabledStateSoft: !backendValues.minimumPixelSize.isAvailable
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -224,7 +224,7 @@ Section {
|
||||
text: qsTr("Point")
|
||||
tooltip: qsTr("Specifies the minimum font point size of scaled text.")
|
||||
width: 42
|
||||
disabledState: !backendValues.minimumPointSize.isAvailable
|
||||
disabledStateSoft: !backendValues.minimumPointSize.isAvailable
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user