Allow Actions in the Global Drawer to be disabled
Dirk Hohndel
dirk at hohndel.org
Thu Feb 11 02:10:25 UTC 2016
This clearly was intentionally not supported - but I'm not sure I
understand why - and I'd argue that this is a mistake. An application can
have different states where some of the menu items should be disabled (for
example, before an account is fully set up).
This simple patch allows that to work (and attempts to visualize the
disabled state by reducing the opacity in that case).
/D
>From d7f7ef25c54c2024ad87e23b7b7353c4655936c5 Mon Sep 17 00:00:00 2001
From: Dirk Hohndel <dirk at hohndel.org>
Date: Wed, 10 Feb 2016 18:06:36 -0800
Subject: [PATCH] Allow Actions in the GlobalDrawer to be disabled
And paint them very faintly to indicate when they are disabled.
Signed-off-by: Dirk Hohndel <dirk at hohndel.org>
---
components/mobilecomponents/qml/GlobalDrawer.qml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/components/mobilecomponents/qml/GlobalDrawer.qml b/components/mobilecomponents/qml/GlobalDrawer.qml
index afe304166032..35e961dc0511 100644
--- a/components/mobilecomponents/qml/GlobalDrawer.qml
+++ b/components/mobilecomponents/qml/GlobalDrawer.qml
@@ -150,10 +150,11 @@ OverlayDrawer {
onClicked: pageRow.pop()
}
delegate: BasicListItem {
- enabled: true
+ enabled: modelData.enabled
checked: modelData.checked
icon: modelData.iconName
label: modelData.text
+ opacity: enabled ? 1.0 : 0.3
Icon {
anchors {
--
2.7.0
More information about the Plasma-devel
mailing list