on xenial help sign in
Use enabled property
commit26737841007bee56a53b57a12a12a5180d8e0300 authorYing-Chun Liu <paul.liu@canonical.com> dateWed 15 Oct 2014, 00:18 (12 years ago) parent403f8e1
2 files changed+6−11
plugins/Dash/CardCreator.js+2−1 qml/Dash/GenericScopeView.qml+4−10
plugins/Dash/CardCreator.js+2−1
@@ -318,7 +318,8 @@ function cardString(template, components) {
318318 readonly property string title: cardData && cardData["title"] || ""; \n\
319319 property bool asynchronous: true; \n\
320320 property bool showHeader: true; \n\
321− implicitWidth: childrenRect.width; \n';
321+ implicitWidth: childrenRect.width; \n\
322+ enabled: template == null || (template["non-interactive"] !== undefined ? !template["non-interactive"] : true); \n';
322323
323324 var hasArt = components["art"] && components["art"]["field"] || false;
324325 var hasSummary = components["summary"] || false;
qml/Dash/GenericScopeView.qml+4−10
@@ -65,10 +65,7 @@ FocusScope {
6565 subPageLoader.closeSubPage()
6666 }
6767
68− function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount, cardTool) {
69− if (cardTool.template && cardTool.template["non-interactive"]) {
70− return;
71− }
68+ function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount) {
7269 if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope") {
7370 // TODO Technically it is possible that calling activate() will make the scope emit
7471 // previewRequested so that we show a preview but there's no scope that does that yet
@@ -81,10 +78,7 @@ FocusScope {
8178 }
8279 }
8380
84− function itemPressedAndHeld(index, result, itemModel, resultsModel, limitedCategoryItemCount, cardTool) {
85− if (cardTool.template && cardTool.template["non-interactive"]) {
86− return;
87− }
81+ function itemPressedAndHeld(index, result, itemModel, resultsModel, limitedCategoryItemCount) {
8882 if (itemModel.uri.indexOf("scope://") !== 0) {
8983 if (scope.preview(result)) {
9084 openPreview(index, resultsModel, limitedCategoryItemCount);
@@ -339,11 +333,11 @@ FocusScope {
339333 Connections {
340334 target: rendererLoader.item
341335 onClicked: {
342− scopeView.itemClicked(index, result, item, itemModel, target.model, categoryItemCount(), rendererLoader.item.cardTool);
336+ scopeView.itemClicked(index, result, item, itemModel, target.model, categoryItemCount());
343337 }
344338
345339 onPressAndHold: {
346− scopeView.itemPressedAndHeld(index, result, itemModel, target.model, categoryItemCount(), rendererLoader.item.cardTool);
340+ scopeView.itemPressedAndHeld(index, result, itemModel, target.model, categoryItemCount());
347341 }
348342
349343 function categoryItemCount() {