Fix Warnings and implements Systray
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.Pipewire
|
||||
import Quickshell.Widgets
|
||||
import qs.Common
|
||||
|
||||
Rectangle {
|
||||
@@ -10,7 +8,8 @@ Rectangle {
|
||||
|
||||
property string monitor: ""
|
||||
property string icon: " "
|
||||
property int volume: Math.round(Pipewire.defaultAudioSink.audio.volume * 100)
|
||||
property bool audioPipewireActive: Pipewire.defaultAudioSink? true:false
|
||||
property int volume: audioPipewireActive? Math.round(Pipewire.defaultAudioSink.audio.volume * 100): 30
|
||||
|
||||
implicitWidth: audioText.implicitWidth * 1.6
|
||||
implicitHeight: Theme.heightGaps
|
||||
@@ -55,17 +54,19 @@ Rectangle {
|
||||
audioWidget.volume = Math.round(Pipewire.defaultAudioSink.audio.volume * 100);
|
||||
}
|
||||
|
||||
target: Pipewire.defaultAudioSink.audio
|
||||
target: audioWidget.audioPipewireActive? Pipewire.defaultAudioSink.audio: null
|
||||
}
|
||||
|
||||
Text {
|
||||
id: audioText
|
||||
|
||||
property string audioTextText: audioWidget.audioPipewireActive? audioWidget.icon + " " + Math.round(Pipewire.defaultAudioSink.audio.volume * 100).toString() + "%" : ""
|
||||
|
||||
anchors.centerIn: parent
|
||||
text: audioWidget.icon + " " + Math.round(Pipewire.defaultAudioSink.audio.volume * 100).toString() + "%"
|
||||
text: audioTextText
|
||||
font.bold: true
|
||||
font.pixelSize: 14
|
||||
font.family: root.fontFamily
|
||||
font.family: Theme.fontFamily
|
||||
color: Theme.textColor
|
||||
}
|
||||
|
||||
@@ -76,61 +77,8 @@ Rectangle {
|
||||
command: ["pavucontrol"]
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: audioTimer
|
||||
|
||||
interval: 1000
|
||||
onTriggered: {
|
||||
audioPopUp.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
PopupWindow {
|
||||
id: audioPopUp
|
||||
|
||||
anchor.window: root
|
||||
anchor.rect.x: barArea.x
|
||||
anchor.rect.y: root.implicitHeight
|
||||
implicitWidth: 500
|
||||
implicitHeight: 500
|
||||
color: "transparent"
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "teal"
|
||||
radius: 25
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "opa"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onExited: {
|
||||
audioPopUp.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Behavior on visible {
|
||||
NumberAnimation {
|
||||
duration: 1000 // Matches your original duration
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
audioWidgetProcess.startDetached();
|
||||
}
|
||||
@@ -147,13 +95,6 @@ Rectangle {
|
||||
Pipewire.defaultAudioSink.audio.volume = (audioWidget.volume - 5) / 100;
|
||||
}
|
||||
}
|
||||
onEntered: {
|
||||
audioTimer.start();
|
||||
}
|
||||
onExited: {
|
||||
audioPopUp.visible = false;
|
||||
audioTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user