Horizontal media widget #16

Merged
Zacharias-Brohn merged 8 commits from horizontal-media-widget into settingsWindow 2026-02-25 21:59:57 +01:00
5 changed files with 44 additions and 64 deletions
Showing only changes of commit ed9e0d1c85 - Show all commits
+10 -9
View File
@@ -11,12 +11,11 @@ Item {
id: root id: root
property color barColor: DynamicColors.palette.m3primary property color barColor: DynamicColors.palette.m3primary
property bool expanded: false
property color textColor: DynamicColors.palette.m3onSurface property color textColor: DynamicColors.palette.m3onSurface
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.top: parent.top anchors.top: parent.top
implicitWidth: expanded ? 300 : 150 implicitWidth: 150
Behavior on implicitWidth { Behavior on implicitWidth {
NumberAnimation { NumberAnimation {
@@ -49,16 +48,18 @@ Item {
} }
RowLayout { RowLayout {
anchors { id: layout
fill: parent
leftMargin: 10 anchors.left: parent.left
rightMargin: 15 anchors.leftMargin: Appearance.padding.small
} anchors.right: parent.right
anchors.rightMargin: Appearance.padding.small * 2
anchors.verticalCenter: parent.verticalCenter
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: Audio.muted ? DynamicColors.palette.m3error : root.textColor color: Audio.muted ? DynamicColors.palette.m3error : root.textColor
font.pixelSize: 18 font.pointSize: 14
text: Audio.muted ? "volume_off" : "volume_up" text: Audio.muted ? "volume_off" : "volume_up"
} }
@@ -91,7 +92,7 @@ Item {
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.textColor color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.textColor
font.pixelSize: 18 font.pointSize: 14
text: Audio.sourceMuted ? "mic_off" : "mic" text: Audio.sourceMuted ? "mic_off" : "mic"
} }
+2 -2
View File
@@ -13,7 +13,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.top: parent.top anchors.top: parent.top
implicitWidth: 25 implicitWidth: 30
CustomRect { CustomRect {
anchors.bottomMargin: 3 anchors.bottomMargin: 3
@@ -30,7 +30,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: iconColor color: iconColor
font.family: "Material Symbols Rounded" font.family: "Material Symbols Rounded"
font.pixelSize: 20 font.pointSize: 16
text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4" text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4"
Behavior on color { Behavior on color {
+7 -8
View File
@@ -14,7 +14,7 @@ Item {
clip: true clip: true
implicitHeight: 34 implicitHeight: 34
implicitWidth: rowLayout.implicitWidth + rowLayout.anchors.leftMargin + rowLayout.anchors.rightMargin implicitWidth: rowLayout.implicitWidth + Appearance.padding.small * 2
Rectangle { Rectangle {
id: backgroundRect id: backgroundRect
@@ -37,19 +37,18 @@ Item {
RowLayout { RowLayout {
id: rowLayout id: rowLayout
anchors.fill: parent anchors.centerIn: parent
anchors.leftMargin: 5
anchors.rightMargin: 5
spacing: 6 spacing: 6
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface color: DynamicColors.palette.m3onSurface
font.pixelSize: 18 font.pointSize: 14
text: "memory_alt" text: "memory_alt"
} }
Resource { Resource {
Layout.alignment: Qt.AlignVCenter
mainColor: DynamicColors.palette.m3primary mainColor: DynamicColors.palette.m3primary
percentage: ResourceUsage.memoryUsedPercentage percentage: ResourceUsage.memoryUsedPercentage
warningThreshold: 95 warningThreshold: 95
@@ -58,7 +57,7 @@ Item {
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface color: DynamicColors.palette.m3onSurface
font.pixelSize: 18 font.pointSize: 14
text: "memory" text: "memory"
} }
@@ -71,7 +70,7 @@ Item {
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface color: DynamicColors.palette.m3onSurface
font.pixelSize: 18 font.pointSize: 14
text: "gamepad" text: "gamepad"
} }
@@ -83,7 +82,7 @@ Item {
MaterialIcon { MaterialIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: DynamicColors.palette.m3onSurface color: DynamicColors.palette.m3onSurface
font.pixelSize: 18 font.pointSize: 14
text: "developer_board" text: "developer_board"
} }
+11 -33
View File
@@ -12,62 +12,40 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.top: parent.top anchors.top: parent.top
implicitWidth: textMetrics.width + contentRow.spacing + 30 implicitWidth: contentRow.childrenRect.width + Appearance.spacing.smaller
Rectangle { CustomRect {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: 22 implicitHeight: 22
radius: height / 2 radius: height / 2
Behavior on color {
CAnim {
}
}
} }
RowLayout { RowLayout {
id: contentRow id: contentRow
spacing: 10 anchors.centerIn: parent
implicitHeight: 22
spacing: Appearance.spacing.small
anchors { MaterialIcon {
fill: parent Layout.alignment: Qt.AlignVCenter
leftMargin: 5 font.pointSize: 14
rightMargin: 5 text: "package_2"
}
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
color: root.textColor
font.family: "Material Symbols Rounded"
font.pixelSize: 18
text: "\uf569"
Behavior on color {
CAnim {
}
}
} }
TextMetrics { TextMetrics {
id: textMetrics id: textMetrics
font.pixelSize: 16
text: root.countUpdates text: root.countUpdates
} }
Text { CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
color: root.textColor color: root.textColor
font.pointSize: 12
text: textMetrics.text text: textMetrics.text
Behavior on color {
CAnim {
}
}
} }
} }
} }
+14 -12
View File
@@ -1,21 +1,23 @@
# Ideas/Features # Ideas/Features
- [x] Media showing; what song/media is playing?
- [x] Brightness control for Laptops.
- [x] Battery icon for Laptops. Broken?
- [ ] Change volume for `$BROWSER` environment variable? Most general media source apart from separate music/video players. - [ ] Change volume for `$BROWSER` environment variable? Most general media source apart from separate music/video players.
- [ ] Quick toggle for BT, WiFi (modules in the tray do this too)
- [x] Auto hide unless on mouse hover. Also implement bar changes to mute/volume to show notif or show bar for a couple seconds.
- [x] Maybe already possible; have keybinds to show certain menus. I do not want to touch my mouse to see notifications for example. Not everything in the bar needs this, but some would be good to have.
- [x] Pressing ESC or some obvious button to close nc.
- [x] Another branch for development, hold off big changes so that a working bar or if there are big config changes.
- [ ] Notification audio cue integration (with config option to disable).
- [x] Notification timeout per service. Example: If Discord pushes two notifications, the following notifications are muted for 10 minutes from Discord only. Perhaps a global mute is easier initially.
# Stupid idea's from Daivin # Stupid idea's from Daivin
- [ ] An on screen pencil to draw on your screen :). - [ ] An on screen pencil to draw on your screen :).
- [ ] Audio module + cava / audio wave ;) ( Don't make it into minecraft blocks - [ ] Audio module + cava / audio wave ;) ( Don't make it into minecraft blocks
but aan actual wave) -- Probably not planned but aan actual wave) -- Probably not planned
- [ ] Update module: When there is 1 package it still looks extremely off - [ ] Bluetooth device battery view -- Not planned ( Don't have a bluetooth
- [ ] Bluetooth device battery view -- Also not planned (I don't have bluetooth) receiver )
# Completed features
- [x] Auto hide unless on mouse hover. Also implement bar changes to mute/volume to show notif or show bar for a couple seconds.
- [x] Maybe already possible; have keybinds to show certain menus. I do not want to touch my mouse to see notifications for example. Not everything in the bar needs this, but some would be good to have.
- [x] Pressing ESC or some obvious button to close nc.
- [x] Another branch for development, hold off big changes so that a working bar or if there are big config changes.
- [x] Media showing; what song/media is playing?
- [x] Brightness control for Laptops.
- [x] Battery icon for Laptops. Broken?
- [x] Quick toggle for BT, WiFi (modules in the tray do this too)
- [x] Update module: When there is 1 package it still looks extremely off