Files
z-bar-qt/Modules/Launcher/Items/VariantItem.qml
T
zach 7d6f3cc275
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 20s
JS/TS / lint (pull_request) Successful in 22s
Python / static (pull_request) Successful in 57s
Rust / fmt (pull_request) Successful in 1m2s
C++ / build (pull_request) Successful in 2m10s
Rust / build (pull_request) Successful in 1m50s
Rust / clippy (pull_request) Successful in 1m25s
Python / verify (pull_request) Successful in 2m58s
C++ / clang-tidy (pull_request) Successful in 7m8s
initial commit for media widget update + anim tokens restructure
2026-08-18 16:14:41 +02:00

76 lines
1.7 KiB
QML

import QtQuick
import qs.Components
import qs.Modules.Launcher.Services
import ZShell.Config
import qs.Services
Item {
id: root
required property var list
required property SchemeVariants.Variant modelData
anchors.left: parent?.left
anchors.right: parent?.right
implicitHeight: Config.launcher.sizes.itemHeight
StateLayer {
radius: Tokens.rounding.small
onClicked: {
root.modelData?.onClicked(root.list);
}
}
Item {
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
anchors.margins: Tokens.padding.small
anchors.rightMargin: Tokens.padding.small
MaterialIcon {
id: icon
anchors.verticalCenter: parent.verticalCenter
font.pointSize: Tokens.font.size.extraLarge
text: root.modelData?.icon ?? ""
}
Column {
anchors.left: icon.right
anchors.leftMargin: Tokens.spacing.large
anchors.verticalCenter: icon.verticalCenter
spacing: 0
width: parent.width - icon.width - anchors.leftMargin - (current.active ? current.width + Tokens.spacing.medium : 0)
CustomText {
font.pointSize: Tokens.font.size.normal
text: root.modelData?.name ?? ""
}
CustomText {
anchors.left: parent.left
anchors.right: parent.right
color: Colors.palette.m3outline
elide: Text.ElideRight
font.pointSize: Tokens.font.size.small
text: root.modelData?.description ?? ""
}
}
Loader {
id: current
active: root.modelData?.variant === Config.colors.schemeType
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
sourceComponent: MaterialIcon {
color: Colors.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.large
text: "check"
}
}
}
}