nova-shell/shell/applets/HoverableListItem.qml

30 lines
543 B
QML

import QtQuick
import "../services" as S
Item {
id: root
readonly property bool hovered: _hover.hovered
signal tapped
width: parent?.width ?? 0
height: 32
Rectangle {
anchors.fill: parent
anchors.leftMargin: 4
anchors.rightMargin: 4
color: root.hovered ? S.Theme.base02 : "transparent"
radius: S.Theme.radius
z: -1
}
HoverHandler {
id: _hover
cursorShape: Qt.PointingHandCursor
}
TapHandler {
onTapped: root.tapped()
}
}