From a70cf65c5d589734f2b2b651577a25264302cd64 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 9 Dec 2018 15:47:27 +0100 Subject: Manage highlighting in applications categories list Add launch button --- qml/mw-ui.qml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml index 9985b41..bbbdf5e 100644 --- a/qml/mw-ui.qml +++ b/qml/mw-ui.qml @@ -455,10 +455,10 @@ It is highly recommended that you update your system regularly. An Update icon w Component { //The hightlight id: catHighlight Rectangle { - width: 200 + width: 190 height: 25 anchors.horizontalCenter: parent.horizontalCenter - color: "#8f9193" + color: "#2397D4" y: categoriesList.currentItem.y; } } @@ -466,9 +466,9 @@ It is highly recommended that you update your system regularly. An Update icon w ListView { id:categoriesList anchors {left: parent.left;margins: 5} - width: 200 - //highlight: catHighlight - //highlightFollowsCurrentItem: false + width: 190 + highlight: catHighlight + highlightFollowsCurrentItem: false focus: true model: [{'name': qsTr("Featured"), 'group': "featured"}, {'name': qsTr("Games"),'group': "games"}, @@ -484,12 +484,14 @@ It is highly recommended that you update your system regularly. An Update icon w width: parent.width height: 25 color:"transparent" - Label {text: modelData.name ;} + Label {id: catLabel;text: modelData.name ; + color: categoriesList.currentIndex === index ? "white" : "black"} MouseArea { anchors.centerIn: parent width: parent.width height: 25 onClicked: { + categoriesList.currentIndex = index appListDM.items.remove(0,appListDM.count ); var rowCount = appList.count; for( var i = 0;i < rowCount;i++ ) @@ -587,8 +589,22 @@ It is highly recommended that you update your system regularly. An Update icon w } } } - Component { id: dummy; Label {text: " "}} - sourceComponent: (installable === "True") ? button : dummy + Component { id: launcher; + Button { + objectName: "launch" + onClicked: { + launch.command([command,])} + style: ButtonStyle { + label: Label { + text: qsTr("Launch"); + } + } + } + } + Component { id: dummy;Label {text: " "; + } + } + sourceComponent: (installable === "True") ? button : (command === "" ? dummy : launcher) } } } -- cgit v1.2.1