initial commit
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
import QtQuick
|
||||
import qs.config
|
||||
import qs.components
|
||||
|
||||
// One row in the launcher's result list.
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
required property var entry
|
||||
property bool selected: false
|
||||
|
||||
signal activated
|
||||
signal entered
|
||||
|
||||
implicitHeight: 40
|
||||
radius: Theme.radius
|
||||
color: root.selected ? Theme.surfaceActive : "transparent"
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.animDuration
|
||||
easing.type: Theme.animEasing
|
||||
}
|
||||
}
|
||||
|
||||
AppIcon {
|
||||
id: icon
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: Theme.padding
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
icon: root.entry.icon
|
||||
fallbackLabel: root.entry.name
|
||||
size: 26
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors {
|
||||
left: icon.right
|
||||
right: parent.right
|
||||
leftMargin: Theme.padding * 2
|
||||
rightMargin: Theme.padding
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
spacing: 1
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
text: root.entry.name || root.entry.id
|
||||
color: Theme.text
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSize
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
visible: text !== ""
|
||||
text: root.entry.comment || root.entry.genericName || ""
|
||||
color: Theme.textDim
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.activated()
|
||||
onEntered: root.entered()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user