import QtQuick import "." // Selectable list row: a colored left accent bar plus a tinted background // when current, shared by CommandPalette and ClipboardManager so both // launchers read as the same design language. Rectangle { id: row property bool selected: false property color accent: Theme.colors.primary readonly property alias hovered: rowMouse.containsMouse default property alias content: contentItem.data signal clicked(var mouse) signal entered() height: 40 radius: Theme.geometry.radiusTiny color: selected ? Qt.alpha(accent, 0.16) : "transparent" Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } } Rectangle { width: 3 height: parent.height - 10 anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left radius: 2 color: row.accent opacity: row.selected ? 1 : 0 Behavior on opacity { NumberAnimation { duration: Theme.animation.durationFast } } } // Declared before contentItem so any interactive child placed in // `content` (e.g. a hover delete button) stacks on top and can // intercept clicks before they fall through to this row-wide handler. MouseArea { id: rowMouse anchors.fill: parent hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton onEntered: row.entered() onClicked: (mouse) => row.clicked(mouse) } Item { id: contentItem anchors.fill: parent anchors.leftMargin: Theme.geometry.padding + 4 anchors.rightMargin: Theme.geometry.padding } }