Proper if-else {} style

This commit is contained in:
Martin Klapetek 2014-05-12 19:19:24 +02:00
parent 9b644ccdde
commit 247e829332

View File

@ -36,9 +36,13 @@ Item {
width: parent.width - (borderWidth) width: parent.width - (borderWidth)
height: parent.height - (borderWidth) height: parent.height - (borderWidth)
opacity: { opacity: {
if (calendarDays.selectedItem == dayStyle && today) 0.6 if (calendarDays.selectedItem == dayStyle && today) {
else if (today) 0.4 0.6
else 0 } else if (today) {
0.4
} else {
0
}
} }
Behavior on opacity { NumberAnimation { duration: units.shortDuration*2 } } Behavior on opacity { NumberAnimation { duration: units.shortDuration*2 } }
color: theme.textColor color: theme.textColor
@ -50,9 +54,13 @@ Item {
fill: todayRect fill: todayRect
} }
opacity: { opacity: {
if (calendarDays.selectedItem == dayStyle) 0.6 if (calendarDays.selectedItem == dayStyle) {
else if (dateMouse.containsMouse) 0.4 0.6
else 0 } else if (dateMouse.containsMouse) {
0.4
} else {
0
}
} }
visible: !today visible: !today
Behavior on opacity { NumberAnimation { duration: units.shortDuration*2 } } Behavior on opacity { NumberAnimation { duration: units.shortDuration*2 } }