Commit 2be4c0aa authored by Aleksei German's avatar Aleksei German

Watch Demo Application List Entry ui.qml rework

parent 9564b1fa
......@@ -54,7 +54,7 @@ Item {
imgBig: "images/list/tools-big.png"
name: "Tools"
otherOp: root.othersOp
isSelected: root.index === 0
state: (root.index === 0) ? "selected" : "default"
}
ApplicationListEntry {
......@@ -63,7 +63,7 @@ Item {
imgBig: "images/list/compass-big.png"
name: "Compass"
otherOp: root.othersOp
isSelected: root.index === -1
state: (root.index === -1) ? "selected" : "default"
}
ApplicationListEntry {
......@@ -72,7 +72,7 @@ Item {
imgBig: "images/list/sport-app-big.png"
name: "Sport App"
otherOp: root.othersOp
isSelected: root.index === -2
state: (root.index === -2) ? "selected" : "default"
}
ApplicationListEntry {
......@@ -81,7 +81,7 @@ Item {
imgBig: "images/list/your-health-big.png"
name: "Your Health"
otherOp: root.othersOp
isSelected: root.index === -3
state: (root.index === -3) ? "selected" : "default"
}
ApplicationListEntry {
......@@ -90,7 +90,7 @@ Item {
imgBig: "images/list/settings-big.png"
name: "Settings"
otherOp: root.othersOp
isSelected: root.index === -4
state: (root.index === -4) ? "selected" : "default"
}
}
......
......@@ -22,7 +22,6 @@
import QtQuick 2.12
Item {
property bool isSelected: false
property string img: "images/list/compass.png"
property string imgBig: "images/list/compass-big.png"
property string name: "Compass"
......@@ -34,22 +33,19 @@ Item {
width: 90
height: 90
opacity: root.isSelected ? 1.0 : otherOp
state: "default"
Image {
property int margin: isSelected ? 8 : 18
id: image
id: entryImage
anchors.left: parent.left
anchors.leftMargin: margin
anchors.verticalCenter: parent.verticalCenter
source: root.isSelected ? root.imgBig : root.img
}
Text {
property int alpha: root.isSelected ? root.maxTextAlpha : root.minTextAlpha
id: entryText
property int alpha: 0
anchors.left: image.right
anchors.left: entryImage.right
anchors.leftMargin: 25
anchors.verticalCenter: parent.verticalCenter
text: root.name
......@@ -57,4 +53,40 @@ Item {
font.family: Theme.fontFamily
color: Qt.rgba(255, 255, 255, alpha/maxTextAlpha);
}
states: [
State {
name: "default"
PropertyChanges {
target: entryText
alpha: root.minTextAlpha
}
PropertyChanges {
target: entryImage
source: root.img
anchors.leftMargin: 18
}
PropertyChanges {
target: root
opacity: otherOp
}
},
State {
name: "selected"
PropertyChanges {
target: entryText
alpha: root.maxTextAlpha
}
PropertyChanges {
target: entryImage
source: root.imgBig
anchors.leftMargin: 8
}
PropertyChanges {
target: root
opacity: 1.0
}
}
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment