extract HoverableListItem component from list delegates
This commit is contained in:
parent
85e32dcd8c
commit
e712842424
5 changed files with 29 additions and 47 deletions
|
|
@ -9,22 +9,11 @@ Column {
|
|||
Repeater {
|
||||
model: S.NetworkService.networks
|
||||
|
||||
delegate: Item {
|
||||
delegate: HoverableListItem {
|
||||
id: entry
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
width: root.width
|
||||
height: 32
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 4
|
||||
anchors.rightMargin: 4
|
||||
color: entryHover.hovered ? S.Theme.base02 : "transparent"
|
||||
radius: S.Theme.radius
|
||||
}
|
||||
|
||||
Text {
|
||||
id: netIcon
|
||||
anchors.left: parent.left
|
||||
|
|
@ -62,10 +51,6 @@ Column {
|
|||
width: entry.modelData.signal >= 0 ? implicitWidth : 0
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
id: entryHover
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
TapHandler {
|
||||
onTapped: {
|
||||
if (entry.modelData.active)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue