aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksei German <aleksei.german@qt.io>2020-09-01 17:18:44 +0200
committerAleksei German <aleksei.german@qt.io>2020-09-01 18:22:34 +0000
commit84280f0410294c514d189e8c5c71015c89e2e6ee (patch)
tree0fb8c244e20526104356536ef5921bf9f18476d9
parentca88afbe315fb6e6a105d19c2cce93f9269595be (diff)
QmlDesigner: Compact option for label deactivation
Change-Id: Ie163f4c021212837b703d2615cbf78b953e056ec Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml4
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml12
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml4
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml10
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml4
5 files changed, 20 insertions, 14 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml
index 864dd51ceb..1db91045c4 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml
@@ -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 {
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml
index 5501a14cda..a6e218861b 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml
@@ -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 {
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml
index 70bb856123..712958c848 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml
@@ -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
}
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml
index 6a14e7f68c..c642280d1a 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml
@@ -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)
}
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
index f7cf3be4ab..b4c07db265 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
@@ -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
}
}