From 84280f0410294c514d189e8c5c71015c89e2e6ee Mon Sep 17 00:00:00 2001 From: Aleksei German Date: Tue, 1 Sep 2020 17:18:44 +0200 Subject: QmlDesigner: Compact option for label deactivation Change-Id: Ie163f4c021212837b703d2615cbf78b953e056ec Reviewed-by: Thomas Hartmann --- .../propertyEditorQmlSources/QtQuick/ImageSpecifics.qml | 4 ++-- .../imports/HelperWidgets/FlickableSection.qml | 12 ++++++------ .../imports/HelperWidgets/FontSection.qml | 4 ++-- .../propertyEditorQmlSources/imports/HelperWidgets/Label.qml | 10 ++++++++-- .../imports/HelperWidgets/StandardTextSection.qml | 4 ++-- 5 files changed, 20 insertions(+), 14 deletions(-) (limited to 'share') diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml index 864dd51ceb4..1db91045c4c 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 5501a14cda3..a6e218861b6 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 70bb8561233..712958c8486 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 6a14e7f68cc..c642280d1a2 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 f7cf3be4abd..b4c07db2652 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 } } -- cgit v1.2.3