on xenial help sign in
Use enabled property
2673784Ying-Chun Liu
plugins/Dash/CardCreator.js+2−1
@@ -318,7 +318,8 @@ function cardString(template, components) {
318 readonly property string title: cardData && cardData["title"] || ""; \n\
318 readonly property string title: cardData && cardData["title"] || ""; \n\
319 property bool asynchronous: true; \n\
319 property bool asynchronous: true; \n\
320 property bool showHeader: true; \n\
320 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';
322
323
323 var hasArt = components["art"] && components["art"]["field"] || false;
324 var hasArt = components["art"] && components["art"]["field"] || false;
324 var hasSummary = components["summary"] || false;
325 var hasSummary = components["summary"] || false;
qml/Dash/GenericScopeView.qml+4−10
@@ -65,10 +65,7 @@ FocusScope {
65 subPageLoader.closeSubPage()
65 subPageLoader.closeSubPage()
66 }
66 }
67
67
68− function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount, cardTool) {
68+ function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount) {
69− if (cardTool.template && cardTool.template["non-interactive"]) {
70− return;
71− }
72 if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope") {
69 if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope") {
73 // TODO Technically it is possible that calling activate() will make the scope emit
70 // TODO Technically it is possible that calling activate() will make the scope emit
74 // previewRequested so that we show a preview but there's no scope that does that yet
71 // previewRequested so that we show a preview but there's no scope that does that yet
@@ -81,10 +78,7 @@ FocusScope {
81 }
78 }
82 }
79 }
83
80
84− function itemPressedAndHeld(index, result, itemModel, resultsModel, limitedCategoryItemCount, cardTool) {
81+ function itemPressedAndHeld(index, result, itemModel, resultsModel, limitedCategoryItemCount) {
85− if (cardTool.template && cardTool.template["non-interactive"]) {
86− return;
87− }
88 if (itemModel.uri.indexOf("scope://") !== 0) {
82 if (itemModel.uri.indexOf("scope://") !== 0) {
89 if (scope.preview(result)) {
83 if (scope.preview(result)) {
90 openPreview(index, resultsModel, limitedCategoryItemCount);
84 openPreview(index, resultsModel, limitedCategoryItemCount);
@@ -339,11 +333,11 @@ FocusScope {
339 Connections {
333 Connections {
340 target: rendererLoader.item
334 target: rendererLoader.item
341 onClicked: {
335 onClicked: {
342− scopeView.itemClicked(index, result, item, itemModel, target.model, categoryItemCount(), rendererLoader.item.cardTool);
336+ scopeView.itemClicked(index, result, item, itemModel, target.model, categoryItemCount());
343 }
337 }
344
338
345 onPressAndHold: {
339 onPressAndHold: {
346− scopeView.itemPressedAndHeld(index, result, itemModel, target.model, categoryItemCount(), rendererLoader.item.cardTool);
340+ scopeView.itemPressedAndHeld(index, result, itemModel, target.model, categoryItemCount());
347 }
341 }
348
342
349 function categoryItemCount() {
343 function categoryItemCount() {