Recomputing scale and opacity for list items to look more like wheel

This commit is contained in:
Eric Kotato 2019-06-30 17:29:28 +03:00
parent 10103295e5
commit dd74f2de31
2 changed files with 7 additions and 5 deletions

View file

@ -5,10 +5,11 @@ import SddmComponents 2.0
Item Item
{ {
id: itemRoot id: itemRoot
opacity: distance opacity: computedDistance
scale: distance scale: computedDistance
property real distance: 1.0 property real distance: 1.0
readonly property real computedDistance: Math.sin(Math.PI / 2 * distance)
property string sessionName: "" property string sessionName: ""
property bool hover: false property bool hover: false

View file

@ -5,7 +5,7 @@ import SddmComponents 2.0
Item Item
{ {
id: itemRoot id: itemRoot
opacity: distance opacity: computedDistance
width: parent.width width: parent.width
height: userName == "" ? userLoginText.height + 14 : userNameText.height + userLoginText.height - 4 height: userName == "" ? userLoginText.height + 14 : userNameText.height + userLoginText.height - 4
@ -15,11 +15,12 @@ Item
transform: Scale transform: Scale
{ {
origin.x: itemRoot.height + 12 origin.x: itemRoot.height + 12
xScale: distance xScale: computedDistance
yScale: distance yScale: computedDistance
} }
property real distance: 1.0 property real distance: 1.0
readonly property real computedDistance: Math.sin(Math.PI / 2 * distance)
property string userName: "" property string userName: ""
property string userLogin: "" property string userLogin: ""
property string userAvatar: "icons/no_avatar.svg" property string userAvatar: "icons/no_avatar.svg"