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 {
|
Label {
|
||||||
text: "W"
|
text: "W"
|
||||||
width: 12
|
width: 12
|
||||||
disabledState: !backendValues.sourceSize_width.isAvailable
|
disabledStateSoft: !backendValues.sourceSize_width.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
@@ -96,7 +96,7 @@ Column {
|
|||||||
Label {
|
Label {
|
||||||
text: "H"
|
text: "H"
|
||||||
width: 12
|
width: 12
|
||||||
disabledState: !backendValues.sourceSize_height.isAvailable
|
disabledStateSoft: !backendValues.sourceSize_height.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
|
@@ -287,7 +287,7 @@ Section {
|
|||||||
Label {
|
Label {
|
||||||
text: "X"
|
text: "X"
|
||||||
width: root.labelWidth
|
width: root.labelWidth
|
||||||
disabledState: !backendValues.originX.isAvailable
|
disabledStateSoft: !backendValues.originX.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
@@ -307,7 +307,7 @@ Section {
|
|||||||
Label {
|
Label {
|
||||||
text: "Y"
|
text: "Y"
|
||||||
width: root.labelWidth
|
width: root.labelWidth
|
||||||
disabledState: !backendValues.originY.isAvailable
|
disabledStateSoft: !backendValues.originY.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
@@ -336,7 +336,7 @@ Section {
|
|||||||
Label {
|
Label {
|
||||||
text: "Top"
|
text: "Top"
|
||||||
width: root.labelWidth
|
width: root.labelWidth
|
||||||
disabledState: !backendValues.topMargin.isAvailable
|
disabledStateSoft: !backendValues.topMargin.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
@@ -357,7 +357,7 @@ Section {
|
|||||||
Label {
|
Label {
|
||||||
text: "Bottom"
|
text: "Bottom"
|
||||||
width: root.labelWidth
|
width: root.labelWidth
|
||||||
disabledState: !backendValues.bottomMargin.isAvailable
|
disabledStateSoft: !backendValues.bottomMargin.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
@@ -383,7 +383,7 @@ Section {
|
|||||||
Label {
|
Label {
|
||||||
text: "Left"
|
text: "Left"
|
||||||
width: root.labelWidth
|
width: root.labelWidth
|
||||||
disabledState: !backendValues.leftMargin.isAvailable
|
disabledStateSoft: !backendValues.leftMargin.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
@@ -404,7 +404,7 @@ Section {
|
|||||||
Label {
|
Label {
|
||||||
text: "Right"
|
text: "Right"
|
||||||
width: root.labelWidth
|
width: root.labelWidth
|
||||||
disabledState: !backendValues.rightMargin.isAvailable
|
disabledStateSoft: !backendValues.rightMargin.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
|
@@ -237,7 +237,7 @@ Section {
|
|||||||
text: qsTr("Word")
|
text: qsTr("Word")
|
||||||
tooltip: qsTr("Sets the word spacing for the font.")
|
tooltip: qsTr("Sets the word spacing for the font.")
|
||||||
width: 42
|
width: 42
|
||||||
disabledState: !getBackendValue("wordSpacing").isAvailable
|
disabledStateSoft: !getBackendValue("wordSpacing").isAvailable
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
width: 4
|
width: 4
|
||||||
@@ -258,7 +258,7 @@ Section {
|
|||||||
text: qsTr("Letter")
|
text: qsTr("Letter")
|
||||||
tooltip: qsTr("Sets the letter spacing for the font.")
|
tooltip: qsTr("Sets the letter spacing for the font.")
|
||||||
width: 42
|
width: 42
|
||||||
disabledState: !getBackendValue("letterSpacing").isAvailable
|
disabledStateSoft: !getBackendValue("letterSpacing").isAvailable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,7 +37,9 @@ Label {
|
|||||||
property alias toolTip: toolTipArea.tooltip
|
property alias toolTip: toolTipArea.tooltip
|
||||||
|
|
||||||
width: Math.max(Math.min(240, parent.width - 280), 50)
|
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
|
elide: Text.ElideRight
|
||||||
|
|
||||||
@@ -50,7 +52,9 @@ Label {
|
|||||||
leftPadding: label.disabledState ? 10 : 0
|
leftPadding: label.disabledState ? 10 : 0
|
||||||
rightPadding: 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 disabledState: false
|
||||||
|
property bool disabledStateSoft: false
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "["
|
text: "["
|
||||||
@@ -68,6 +72,8 @@ Label {
|
|||||||
ToolTipArea {
|
ToolTipArea {
|
||||||
id: toolTipArea
|
id: toolTipArea
|
||||||
anchors.fill: parent
|
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")
|
text: qsTr("Pixel")
|
||||||
tooltip: qsTr("Specifies the minimum font pixel size of scaled text.")
|
tooltip: qsTr("Specifies the minimum font pixel size of scaled text.")
|
||||||
width: 42
|
width: 42
|
||||||
disabledState: !backendValues.minimumPixelSize.isAvailable
|
disabledStateSoft: !backendValues.minimumPixelSize.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -224,7 +224,7 @@ Section {
|
|||||||
text: qsTr("Point")
|
text: qsTr("Point")
|
||||||
tooltip: qsTr("Specifies the minimum font point size of scaled text.")
|
tooltip: qsTr("Specifies the minimum font point size of scaled text.")
|
||||||
width: 42
|
width: 42
|
||||||
disabledState: !backendValues.minimumPointSize.isAvailable
|
disabledStateSoft: !backendValues.minimumPointSize.isAvailable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user