cava + nix

This commit is contained in:
Zacharias-Brohn
2026-02-26 16:27:05 +01:00
parent 09a93d9420
commit afb736102d
11 changed files with 311 additions and 237 deletions
+50 -76
View File
@@ -24,101 +24,75 @@ Item {
}
}
Rectangle {
CustomRect {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.tPalette.m3surfaceContainer
height: 22
radius: height / 2
}
Behavior on color {
CAnim {
}
RowLayout {
id: layout
anchors.fill: parent
anchors.leftMargin: Appearance.padding.small
anchors.rightMargin: Appearance.padding.small * 2
anchors.verticalCenter: parent.verticalCenter
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: Audio.muted ? DynamicColors.palette.m3error : root.textColor
font.pointSize: 14
text: Audio.muted ? "volume_off" : "volume_up"
}
Rectangle {
anchors.centerIn: parent
border.color: "#30ffffff"
border.width: 0
color: "transparent"
height: parent.height
radius: width / 2
width: parent.width
}
CustomRect {
Layout.fillWidth: true
color: "#50ffffff"
implicitHeight: 4
radius: 20
RowLayout {
id: layout
CustomRect {
id: sinkVolumeBar
anchors.left: parent.left
anchors.leftMargin: Appearance.padding.small
anchors.right: parent.right
anchors.rightMargin: Appearance.padding.small * 2
anchors.verticalCenter: parent.verticalCenter
color: Audio.muted ? DynamicColors.palette.m3error : root.barColor
implicitWidth: parent.width * (Audio.volume ?? 0)
radius: parent.radius
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: Audio.muted ? DynamicColors.palette.m3error : root.textColor
font.pointSize: 14
text: Audio.muted ? "volume_off" : "volume_up"
}
Rectangle {
Layout.fillWidth: true
color: "#50ffffff"
implicitHeight: 4
radius: 20
Rectangle {
id: sinkVolumeBar
color: Audio.muted ? DynamicColors.palette.m3error : root.barColor
implicitWidth: parent.width * (Audio.volume ?? 0)
radius: parent.radius
Behavior on color {
CAnim {
}
}
anchors {
bottom: parent.bottom
left: parent.left
top: parent.top
}
anchors {
bottom: parent.bottom
left: parent.left
top: parent.top
}
}
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.textColor
font.pointSize: 14
text: Audio.sourceMuted ? "mic_off" : "mic"
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.textColor
font.pointSize: 14
text: Audio.sourceMuted ? "mic_off" : "mic"
}
Rectangle {
Layout.fillWidth: true
color: "#50ffffff"
implicitHeight: 4
radius: 20
CustomRect {
Layout.fillWidth: true
color: "#50ffffff"
implicitHeight: 4
radius: 20
Rectangle {
id: sourceVolumeBar
CustomRect {
id: sourceVolumeBar
color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.barColor
implicitWidth: parent.width * (Audio.sourceVolume ?? 0)
radius: parent.radius
color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.barColor
implicitWidth: parent.width * (Audio.sourceVolume ?? 0)
radius: parent.radius
Behavior on color {
CAnim {
}
}
anchors {
bottom: parent.bottom
left: parent.left
top: parent.top
}
anchors {
bottom: parent.bottom
left: parent.left
top: parent.top
}
}
}
+9 -8
View File
@@ -206,14 +206,15 @@ RowLayout {
}
}
}
// DelegateChoice {
// roleValue: "dash"
// delegate: WrappedLoader {
// sourceComponent: DashWidget {
// visibilities: root.visibilities
// }
// }
// }
DelegateChoice {
roleValue: "media"
delegate: WrappedLoader {
sourceComponent: MediaWidget {
}
}
}
}
}
+32 -3
View File
@@ -217,7 +217,7 @@ Item {
width: parent.width - Appearance.padding.large * 4
}
Row {
RowLayout {
id: controls
anchors.horizontalCenter: parent.horizontalCenter
@@ -260,20 +260,48 @@ Item {
required property bool canUse
required property string icon
property int level: 1
property string set_color: "Secondary"
function onClicked(): void {
}
Layout.preferredWidth: implicitWidth + (controlState.pressed ? Appearance.padding.normal * 2 : 0)
color: canUse ? DynamicColors.palette[`m3${set_color.toLowerCase()}`] : DynamicColors.palette[`m3${set_color.toLowerCase()}Container`]
implicitHeight: implicitWidth
implicitWidth: Math.max(icon.implicitHeight, icon.implicitHeight) + Appearance.padding.small
radius: Appearance.rounding.full
Behavior on Layout.preferredWidth {
Anim {
duration: Appearance.anim.durations.expressiveFastSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial
}
}
Behavior on radius {
Anim {
duration: Appearance.anim.durations.expressiveFastSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial
}
}
Elevation {
anchors.fill: parent
level: controlState.containsMouse && !controlState.pressed ? control.level + 1 : control.level
radius: parent.radius
z: -1
}
StateLayer {
id: controlState
function onClicked(): void {
control.onClicked();
}
color: control.canUse ? DynamicColors.palette[`m3on${control.set_color}`] : DynamicColors.palette[`m3on${control.set_color}Container`]
disabled: !control.canUse
radius: Appearance.rounding.full
// radius: Appearance.rounding.full
}
MaterialIcon {
@@ -282,7 +310,8 @@ Item {
anchors.centerIn: parent
anchors.verticalCenterOffset: font.pointSize * 0.05
animate: true
color: control.canUse ? DynamicColors.palette.m3onSurface : DynamicColors.palette.m3outline
color: control.canUse ? DynamicColors.palette[`m3on${control.set_color}`] : DynamicColors.palette[`m3on${control.set_color}Container`]
fill: control.canUse ? 1 : 0
font.pointSize: Appearance.font.size.large
text: control.icon
}
+3 -3
View File
@@ -121,9 +121,9 @@ Item {
active: Players.active?.isPlaying ?? false
animate: true
colour: "Primary"
icon: active ? "pause" : "play_arrow"
level: active ? 2 : 1
set_color: "Primary"
}
PlayerControl {
@@ -142,15 +142,15 @@ Item {
property bool active
property alias animate: controlIcon.animate
property string colour: "Secondary"
property alias icon: controlIcon.text
property int level: 1
property string set_color: "Secondary"
function onClicked(): void {
}
Layout.preferredWidth: implicitWidth + (controlState.pressed ? Appearance.padding.normal * 2 : active ? Appearance.padding.small * 2 : 0)
color: active ? DynamicColors.palette[`m3${colour.toLowerCase()}`] : DynamicColors.palette[`m3${colour.toLowerCase()}Container`]
color: active ? DynamicColors.palette[`m3${set_color.toLowerCase()}`] : DynamicColors.palette[`m3${set_color.toLowerCase()}Container`]
implicitHeight: controlIcon.implicitHeight + Appearance.padding.normal * 2
implicitWidth: controlIcon.implicitWidth + Appearance.padding.large * 2
radius: active || controlState.pressed ? Appearance.rounding.small : Appearance.rounding.normal
+73
View File
@@ -0,0 +1,73 @@
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Daemons
import qs.Config
import qs.Helpers
Item {
id: root
readonly property string currentMedia: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
readonly property int textWidth: Math.min(metrics.width, 200)
anchors.bottom: parent.bottom
anchors.top: parent.top
implicitWidth: layout.implicitWidth + Appearance.padding.normal * 2
Behavior on implicitWidth {
Anim {
}
}
CustomRect {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: 22
radius: Appearance.rounding.full
}
TextMetrics {
id: metrics
font: mediatext.font
text: mediatext.text
}
RowLayout {
id: layout
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.left: parent.left
anchors.leftMargin: Appearance.padding.normal
anchors.top: parent.top
Behavior on implicitWidth {
Anim {
}
}
MaterialIcon {
animate: true
color: Players.active?.isPlaying ? DynamicColors.palette.m3primary : DynamicColors.palette.m3onSurface
font.pointSize: 14
text: Players.active?.isPlaying ? "music_note" : "music_off"
}
MarqueeText {
id: mediatext
Layout.preferredWidth: root.textWidth
animate: true
color: Players.active?.isPlaying ? DynamicColors.palette.m3primary : DynamicColors.palette.m3onSurface
font.pointSize: Appearance.font.size.normal
horizontalAlignment: Text.AlignHCenter
pauseMs: 4000
text: root.currentMedia
width: root.textWidth
}
}
}
+48 -53
View File
@@ -16,80 +16,75 @@ Item {
implicitHeight: 34
implicitWidth: rowLayout.implicitWidth + Appearance.padding.small * 2
Rectangle {
CustomRect {
id: backgroundRect
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: 22
radius: height / 2
Behavior on color {
CAnim {
}
}
anchors {
left: parent.left
right: parent.right
verticalCenter: parent.verticalCenter
}
}
RowLayout {
id: rowLayout
RowLayout {
id: rowLayout
anchors.centerIn: parent
spacing: 6
anchors.centerIn: parent
spacing: 6
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
text: "memory_alt"
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
text: "memory_alt"
}
Resource {
Layout.alignment: Qt.AlignVCenter
mainColor: DynamicColors.palette.m3primary
percentage: ResourceUsage.memoryUsedPercentage
warningThreshold: 95
}
Resource {
Layout.alignment: Qt.AlignVCenter
mainColor: DynamicColors.palette.m3primary
percentage: ResourceUsage.memoryUsedPercentage
warningThreshold: 95
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
text: "memory"
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
text: "memory"
}
Resource {
mainColor: DynamicColors.palette.m3secondary
percentage: ResourceUsage.cpuUsage
warningThreshold: 80
}
Resource {
mainColor: DynamicColors.palette.m3secondary
percentage: ResourceUsage.cpuUsage
warningThreshold: 80
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
text: "gamepad"
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
text: "gamepad"
}
Resource {
mainColor: DynamicColors.palette.m3tertiary
percentage: ResourceUsage.gpuUsage
}
Resource {
mainColor: DynamicColors.palette.m3tertiary
percentage: ResourceUsage.gpuUsage
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
text: "developer_board"
}
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface
font.pointSize: 14
text: "developer_board"
}
Resource {
mainColor: DynamicColors.palette.m3primary
percentage: ResourceUsage.gpuMemUsage
}
Resource {
mainColor: DynamicColors.palette.m3primary
percentage: ResourceUsage.gpuMemUsage
}
}
}
+1 -9
View File
@@ -27,25 +27,17 @@ Item {
id: contentRow
anchors.centerIn: parent
implicitHeight: 22
spacing: Appearance.spacing.small
MaterialIcon {
Layout.alignment: Qt.AlignVCenter
font.pointSize: 14
text: "package_2"
}
TextMetrics {
id: textMetrics
text: root.countUpdates
}
CustomText {
color: root.textColor
font.pointSize: 12
text: textMetrics.text
text: root.countUpdates
}
}
}