improved code by removing redundancies and done some optimizations
This commit is contained in:
@@ -34,7 +34,7 @@ Rectangle {
|
||||
|
||||
color: modelData.active
|
||||
? root.t.wsActiveBg
|
||||
: (wsHover.containsMouse ? root.t.wsHoverBg : root.t.wsInactiveBg)
|
||||
: (wsHover.hovered ? root.t.wsHoverBg : root.t.wsInactiveBg)
|
||||
|
||||
Behavior on color { ColorAnimation { duration: 200 } }
|
||||
Behavior on Layout.preferredWidth { NumberAnimation { duration: 200 } }
|
||||
@@ -46,16 +46,11 @@ Rectangle {
|
||||
font.bold: true
|
||||
color: modelData.active
|
||||
? root.t.wsActiveText
|
||||
: (wsHover.containsMouse ? root.t.wsHoverText : root.t.wsInactiveText)
|
||||
: (wsHover.hovered ? root.t.wsHoverText : root.t.wsInactiveText)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: wsHover
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: modelData.activate()
|
||||
}
|
||||
HoverHandler { id: wsHover; cursorShape: Qt.PointingHandCursor }
|
||||
TapHandler { onTapped: modelData.activate() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user