80 lines
1.9 KiB
QML
80 lines
1.9 KiB
QML
import "../services"
|
|
import qs.config
|
|
import qs.custom
|
|
import qs.services
|
|
import qs.util
|
|
import QtQuick
|
|
import Quickshell
|
|
|
|
Item {
|
|
id: root
|
|
|
|
required property Actions.Action modelData
|
|
required property PersistentProperties uiState
|
|
required property var list
|
|
|
|
implicitHeight: Config.launcher.itemHeight
|
|
|
|
anchors.left: parent?.left
|
|
anchors.right: parent?.right
|
|
|
|
StateLayer {
|
|
radius: 1000
|
|
anchors.fill: parent
|
|
|
|
function onClicked(): void {
|
|
root.uiState.launcher = false;
|
|
root.modelData?.onClicked(root.uiState);
|
|
}
|
|
}
|
|
|
|
Item {
|
|
anchors.fill: parent
|
|
anchors.leftMargin: 12
|
|
anchors.rightMargin: 12
|
|
anchors.margins: 7
|
|
|
|
MaterialIcon {
|
|
id: icon
|
|
|
|
text: root.modelData?.icon ?? ""
|
|
font.pointSize: Config.font.size.largest
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
Item {
|
|
anchors.left: icon.right
|
|
anchors.leftMargin: 12
|
|
anchors.verticalCenter: icon.verticalCenter
|
|
|
|
implicitWidth: parent.width - icon.width
|
|
implicitHeight: name.implicitHeight + desc.implicitHeight
|
|
|
|
CustomText {
|
|
id: name
|
|
|
|
text: root.modelData?.name ?? ""
|
|
font.pointSize: Config.font.size.normal
|
|
color: root.ListView.isCurrentItem ? Color.mute(Config.colors.launcherActions, 1.1) : Config.colors.primary
|
|
|
|
Behavior on color {
|
|
CAnim {}
|
|
}
|
|
}
|
|
|
|
CustomText {
|
|
id: desc
|
|
|
|
text: root.modelData?.desc ?? ""
|
|
font.pointSize: Config.font.size.small
|
|
color: Config.colors.tertiary
|
|
|
|
elide: Text.ElideRight
|
|
width: root.width - icon.width - 34
|
|
|
|
anchors.top: name.bottom
|
|
}
|
|
}
|
|
}
|
|
}
|