remove dead OsdState/Osd code, update README

This commit is contained in:
Damocles 2026-04-12 19:03:10 +02:00
parent 69ee00004a
commit 367520df6a
5 changed files with 11 additions and 186 deletions

View file

@ -1,146 +0,0 @@
import QtQuick
import Quickshell
import Quickshell.Wayland
import "." as M
// OSD overlay slides out from the bar, centered on screen.
PanelWindow {
id: root
required property var screen
visible: _winVisible
color: "transparent"
property bool _winVisible: false
property bool _shown: M.OsdState.visible && M.OsdState.screen === root.screen
on_ShownChanged: {
if (_shown) {
_winVisible = true;
hideAnim.stop();
showAnim.start();
} else {
showAnim.stop();
hideAnim.start();
}
}
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.exclusiveZone: 0
WlrLayershell.namespace: "nova-osd"
mask: Region {}
anchors.top: true
anchors.left: true
margins.top: 0
margins.left: Math.max(0, Math.min(Math.round(M.OsdState.itemX - implicitWidth / 2), screen.width - implicitWidth))
implicitWidth: 200
implicitHeight: 48
ParallelAnimation {
id: showAnim
NumberAnimation {
target: content
property: "opacity"
to: 1
duration: 150
easing.type: Easing.OutCubic
}
NumberAnimation {
target: content
property: "y"
to: 0
duration: 200
easing.type: Easing.OutCubic
}
}
ParallelAnimation {
id: hideAnim
NumberAnimation {
target: content
property: "opacity"
to: 0
duration: 250
easing.type: Easing.InCubic
}
NumberAnimation {
target: content
property: "y"
to: -content.height
duration: 250
easing.type: Easing.InCubic
}
onFinished: root._winVisible = false
}
Item {
id: content
anchors.left: parent.left
anchors.right: parent.right
height: root.implicitHeight
opacity: 0
y: -height
Rectangle {
anchors.fill: parent
color: M.Theme.base00
opacity: Math.max(M.Theme.barOpacity, 0.85)
topLeftRadius: 0
topRightRadius: 0
bottomLeftRadius: M.Theme.radius
bottomRightRadius: M.Theme.radius
}
Row {
anchors.centerIn: parent
spacing: 10
Text {
text: M.OsdState.icon
color: M.Theme.base0D
font.pixelSize: M.Theme.fontSize + 6
font.family: M.Theme.iconFontFamily
anchors.verticalCenter: parent.verticalCenter
}
Item {
width: 120
height: 6
anchors.verticalCenter: parent.verticalCenter
Rectangle {
anchors.fill: parent
color: M.Theme.base02
radius: 3
}
Rectangle {
width: parent.width * Math.min(1, Math.max(0, M.OsdState.value))
height: parent.height
color: M.Theme.base0D
radius: 3
Behavior on width {
NumberAnimation {
duration: 120
easing.type: Easing.OutCubic
}
}
}
}
Text {
text: Math.round(M.OsdState.value * 100) + "%"
color: M.Theme.base05
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
anchors.verticalCenter: parent.verticalCenter
width: 32
}
}
}
}

View file

@ -1,24 +0,0 @@
pragma Singleton
import QtQuick
QtObject {
property bool visible: false
property real value: 0 // 0.01.0
property string icon: ""
property real itemX: 0
property var screen: null
property Timer _timer: Timer {
interval: 1500
onTriggered: visible = false
}
function show(val, ico, x, scr) {
value = val;
icon = ico;
itemX = x;
screen = scr;
visible = true;
_timer.restart();
}
}

View file

@ -1,7 +1,6 @@
module modules
singleton Theme 1.0 Theme.qml
singleton FlyoutState 1.0 FlyoutState.qml
singleton OsdState 1.0 OsdState.qml
singleton Modules 1.0 Modules.qml
Bar 1.0 Bar.qml
BarGroup 1.0 BarGroup.qml
@ -16,7 +15,6 @@ TrayMenu 1.0 TrayMenu.qml
PopupPanel 1.0 PopupPanel.qml
PowerMenu 1.0 PowerMenu.qml
ScreenCorners 1.0 ScreenCorners.qml
Osd 1.0 Osd.qml
ThemedIcon 1.0 ThemedIcon.qml
Battery 1.0 Battery.qml
Mpris 1.0 Mpris.qml