From b11bfd56526c133300cf466560ecd28883a9466d Mon Sep 17 00:00:00 2001 From: Aleksei German Date: Wed, 2 Sep 2020 18:34:22 +0200 Subject: QmlDesigner: Disable more properties for QUL Disabling more items in ItemLibrary and properties Change-Id: Ib019c1cbe356e0f7e3889d3500c080b0f5756c34 Reviewed-by: Thomas Hartmann --- .../QtQuick/ListViewSpecifics.qml | 24 ++++++++++++++++++++++ .../QtQuick/RowSpecifics.qml | 2 ++ .../imports/HelperWidgets/PaddingSection.qml | 12 +++++++++++ 3 files changed, 38 insertions(+) (limited to 'share') diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml index d9df5e09b4..f132cc4b59 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml @@ -46,6 +46,7 @@ Column { Label { text: qsTr("Cache") tooltip: qsTr("Cache buffer") + disabledState: !backendValues.cacheBuffer.isAvailable } SectionLayout { @@ -54,6 +55,7 @@ Column { minimumValue: 0 maximumValue: 1000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { @@ -63,6 +65,7 @@ Column { Label { text: qsTr("Navigation wraps") tooltip: qsTr("Determines whether the grid wraps key navigation.") + disabledState: !backendValues.keyNavigationWraps.isAvailable } SectionLayout { @@ -70,6 +73,7 @@ Column { Layout.fillWidth: true backendValue: backendValues.keyNavigationWraps text: backendValues.keyNavigationWraps.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -93,6 +97,7 @@ Column { Label { text: qsTr("Layout Direction") + disabledState: !backendValues.layoutDirection.isAvailable } SecondColumnLayout { @@ -101,6 +106,7 @@ Column { model: ["LeftToRight", "RightToLeft"] backendValue: backendValues.layoutDirection Layout.fillWidth: true + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -109,6 +115,7 @@ Column { Label { text: qsTr("Snap mode") tooltip: qsTr("Determines how the view scrolling will settle following a drag or flick.") + disabledState: !backendValues.snapMode.isAvailable } SecondColumnLayout { @@ -117,6 +124,7 @@ Column { model: ["NoSnap", "SnapToItem", "SnapOneItem"] backendValue: backendValues.snapMode Layout.fillWidth: true + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -151,6 +159,7 @@ Column { Label { text: qsTr("Range") tooltip: qsTr("Highlight range") + disabledState: !backendValues.highlightRangeMode.isAvailable } SecondColumnLayout { @@ -159,6 +168,7 @@ Column { model: ["NoHighlightRange", "ApplyRange", "StrictlyEnforceRange"] backendValue: backendValues.highlightRangeMode Layout.fillWidth: true + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -168,6 +178,7 @@ Column { Label { text: qsTr("Move duration") tooltip: qsTr("Move animation duration of the highlight delegate.") + disabledState: !backendValues.highlightMoveDuration.isAvailable } SectionLayout { @@ -176,6 +187,7 @@ Column { minimumValue: -1 maximumValue: 1000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -184,6 +196,7 @@ Column { Label { text: qsTr("Move velocity") tooltip: qsTr("Move animation velocity of the highlight delegate.") + disabledState: !backendValues.highlightMoveVelocity.isAvailable } SectionLayout { @@ -192,6 +205,7 @@ Column { minimumValue: -1 maximumValue: 1000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -200,6 +214,7 @@ Column { Label { text: qsTr("Resize duration") tooltip: qsTr("Resize animation duration of the highlight delegate.") + disabledState: !backendValues.highlightResizeDuration.isAvailable } SectionLayout { @@ -208,6 +223,7 @@ Column { minimumValue: -1 maximumValue: 1000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -216,6 +232,7 @@ Column { Label { text: qsTr("Resize velocity") tooltip: qsTr("Resize animation velocity of the highlight delegate.") + disabledState: !backendValues.highlightResizeVelocity.isAvailable } SectionLayout { @@ -224,6 +241,7 @@ Column { minimumValue: -1 maximumValue: 1000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -232,6 +250,7 @@ Column { Label { text: qsTr("Preferred begin") tooltip: qsTr("Preferred highlight begin - must be smaller than Preferred end.") + disabledState: !backendValues.preferredHighlightBegin.isAvailable } SectionLayout { @@ -240,6 +259,7 @@ Column { minimumValue: 0 maximumValue: 1000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -248,6 +268,7 @@ Column { Label { text: qsTr("Preferred end") tooltip: qsTr("Preferred highlight end - must be larger than Preferred begin.") + disabledState: !backendValues.preferredHighlightEnd.isAvailable } SectionLayout { @@ -256,6 +277,7 @@ Column { minimumValue: 0 maximumValue: 1000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -264,6 +286,7 @@ Column { Label { text: qsTr("Follows current") tooltip: qsTr("Determines whether the highlight is managed by the view.") + disabledState: !backendValues.highlightFollowsCurrentItem.isAvailable } SectionLayout { @@ -271,6 +294,7 @@ Column { Layout.fillWidth: true backendValue: backendValues.highlightFollowsCurrentItem text: backendValues.highlightFollowsCurrentItem.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml index b6b3dfae2a..93e9fdbee9 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml @@ -39,6 +39,7 @@ Column { SectionLayout { Label { text: qsTr("Layout Direction") + disabledState: !backendValues.layoutDirection.isAvailable } SecondColumnLayout { @@ -47,6 +48,7 @@ Column { backendValue: backendValues.layoutDirection Layout.fillWidth: true scope: "Qt" + enabled: backendValue.isAvailable } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml index 83aceb8644..98fb5def41 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml @@ -36,12 +36,14 @@ Section { SectionLayout { Label { text: qsTr("Vertical") + disabledState: (!backendValues.topPadding.isAvailable && !backendValues.bottomPadding.isAvailable) } SecondColumnLayout { Label { text: qsTr("Top") tooltip: qsTr("Padding between the content and the top edge of the item.") width: 42 + disabledStateSoft: !backendValues.topPadding.isAvailable } SpinBox { maximumValue: 10000 @@ -50,6 +52,7 @@ Section { decimals: 0 backendValue: backendValues.topPadding Layout.fillWidth: true + enabled: backendValue.isAvailable } Item { width: 4 @@ -60,6 +63,7 @@ Section { text: qsTr("Bottom") tooltip: qsTr("Padding between the content and the bottom edge of the item.") width: 42 + disabledStateSoft: !backendValues.bottomPadding.isAvailable } SpinBox { maximumValue: 10000 @@ -68,17 +72,20 @@ Section { decimals: 0 backendValue: backendValues.bottomPadding Layout.fillWidth: true + enabled: backendValue.isAvailable } } Label { text: qsTr("Horizontal") + disabledState: (!backendValues.leftPadding.isAvailable && !backendValues.rightPadding.isAvailable) } SecondColumnLayout { Label { text: qsTr("Left") tooltip: qsTr("Padding between the content and the left edge of the item.") width: 42 + disabledStateSoft: !backendValues.leftPadding.isAvailable } SpinBox { maximumValue: 10000 @@ -87,6 +94,7 @@ Section { decimals: 0 backendValue: backendValues.leftPadding Layout.fillWidth: true + enabled: backendValue.isAvailable } Item { width: 4 @@ -97,6 +105,7 @@ Section { text: qsTr("Right") tooltip: qsTr("Padding between the content and the right edge of the item.") width: 42 + disabledStateSoft: !backendValues.rightPadding.isAvailable } SpinBox { maximumValue: 10000 @@ -105,12 +114,14 @@ Section { decimals: 0 backendValue: backendValues.rightPadding Layout.fillWidth: true + enabled: backendValue.isAvailable } } Label { text: qsTr("Padding") tooltip: qsTr("Padding between the content and the edges of the items.") + disabledState: !backendValues.padding.isAvailable } SecondColumnLayout { SpinBox { @@ -120,6 +131,7 @@ Section { decimals: 0 backendValue: backendValues.padding Layout.fillWidth: true + enabled: backendValue.isAvailable } } } -- cgit v1.2.3