improved code by removing redundancies and done some optimizations

This commit is contained in:
SomeElse
2026-05-05 03:58:40 +00:00
parent 8f25ee5caf
commit 046a36fbec
13 changed files with 441 additions and 663 deletions

View File

@@ -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() }
}
}
}