on xenial help sign in
Hide "actions" from the outside users
commited7c300d6f90be509b563df1a36e05614617a3af authorAlbert Astals <albert.astals@canonical.com> dateThu 6 Feb 2014, 16:20 (13 years ago) parent9fc5766
1 file changed+9−8
qml/Dash/Previews/PreviewActions.qml+9−8
qml/Dash/Previews/PreviewActions.qml+9−8
@@ -27,21 +27,22 @@ PreviewWidget {
2727 height: childrenRect.height
2828 width: childrenRect.width
2929
30− readonly property var actions: root.widgetData ? root.widgetData["actions"] : null
31−
3230 Row {
31+ id: row
32+ readonly property var actions: root.widgetData ? root.widgetData["actions"] : null
33+
3334 spacing: units.gu(1)
3435
3536 Loader {
3637 id: loader
37− readonly property bool button: actions && actions.length == 2
38− readonly property bool combo: actions && actions.length > 2
38+ readonly property bool button: row.actions && row.actions.length == 2
39+ readonly property bool combo: row.actions && row.actions.length > 2
3940 source: button ? "PreviewActionButton.qml" : (combo ? "PreviewActionCombo.qml" : "")
4041 onLoaded: {
4142 if (button) {
42− item.data = actions[1];
43+ item.data = row.actions[1];
4344 } else if (combo) {
44− item.model = actions.slice(1);
45+ item.model = row.actions.slice(1);
4546 }
4647 }
4748 Connections {
@@ -53,8 +54,8 @@ PreviewWidget {
5354 }
5455
5556 PreviewActionButton {
56− data: visible ? actions[0] : null
57− visible: actions && actions.length > 0
57+ data: visible ? row.actions[0] : null
58+ visible: row.actions && row.actions.length > 0
5859 onTriggeredAction: root.triggered(root.widgetId, id, null);
5960 }
6061 }