mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 10:30:44 +02:00
fixed a lot of quickshell problems
This commit is contained in:
@@ -91,7 +91,7 @@ PanelWindow {
|
||||
|
||||
spacing: 12
|
||||
|
||||
Launcher {}
|
||||
//Launcher {}
|
||||
|
||||
Workspaces {
|
||||
bar: root
|
||||
@@ -154,7 +154,7 @@ PanelWindow {
|
||||
bar: root
|
||||
}
|
||||
|
||||
Theme {}
|
||||
//Theme {}
|
||||
|
||||
Power {
|
||||
id: power
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
/*import QtQuick
|
||||
|
||||
BarButton {
|
||||
id: root
|
||||
@@ -17,4 +17,39 @@ BarButton {
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
import QtQuick
|
||||
|
||||
BarButton {
|
||||
id: root
|
||||
|
||||
// NEW property: stores the intended image path
|
||||
property string iconSource: ""
|
||||
|
||||
// optional: alias for external access
|
||||
property alias mirror: img.mirror
|
||||
|
||||
implicitWidth: 24
|
||||
implicitHeight: 24
|
||||
|
||||
Image {
|
||||
id: img
|
||||
anchors.fill: parent
|
||||
smooth: false
|
||||
|
||||
// Use the property, fallback if empty
|
||||
//source: root.iconSource ? root.iconSource : "../assets/noaudio.png"
|
||||
Component.onCompleted: {
|
||||
source: typeof root.iconSource === "string" && root.iconSource.length > 0
|
||||
? root.iconSource
|
||||
: "../assets/noaudio.png"
|
||||
}
|
||||
onSourceChanged: {
|
||||
console.log("ClickableIcon: iconSource =", root.iconSource, " -> Image.source =", img.source);
|
||||
}
|
||||
scale: root.containsMouse ? 0.9 : 1
|
||||
Behavior on scale {
|
||||
NumberAnimation { duration: 70 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ Text {
|
||||
|
||||
Process {
|
||||
id: dateProc
|
||||
command: ["date", "+%H⯁%M"]
|
||||
command: ["date", "+%H:%M"]
|
||||
running: true
|
||||
stdout: SplitParser {
|
||||
onRead: data => timetxt.text = data
|
||||
|
||||
@@ -30,7 +30,8 @@ MouseArea {
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: `../assets/${root.node.audio.muted ? "noaudio" : "audio"}.png`
|
||||
//source: `../assets/${root.node.audio.muted ? "noaudio" : "audio"}.png`
|
||||
source: root.node ? `../assets/${root.node.audio.muted ? "noaudio" : "audio"}.png` : "../assets/noaudio.png"
|
||||
smooth: false
|
||||
|
||||
scale: popupLoader.active ? 0.9 : 1
|
||||
|
||||
@@ -10,7 +10,7 @@ MouseArea {
|
||||
|
||||
required property var bar
|
||||
property int wsBaseIndex: 1
|
||||
property int wsCount: 7
|
||||
property int wsCount: 9
|
||||
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen)
|
||||
property int currentIndex: 0
|
||||
property int existsCount: 0
|
||||
|
||||
@@ -52,7 +52,8 @@ MouseArea {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
image: "../../assets/fastforward.png"
|
||||
//image: "../../assets/fastforward.png"
|
||||
iconSource:"../../assets/fastforward.png"
|
||||
mirror: true
|
||||
hoverEnabled: true
|
||||
enabled: MprisController.canGoPrevious
|
||||
@@ -71,7 +72,8 @@ MouseArea {
|
||||
implicitHeight: 26
|
||||
Layout.leftMargin: -4
|
||||
Layout.rightMargin: -4
|
||||
image: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png`
|
||||
//image: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png`
|
||||
iconSource:`../../assets/${MprisController.isPlaying ? "pause" : "play"}.png`
|
||||
hoverEnabled: true
|
||||
enabled: MprisController.canTogglePlaying
|
||||
onClicked: MprisController.togglePlaying()
|
||||
@@ -81,7 +83,8 @@ MouseArea {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
image: "../../assets/fastforward.png"
|
||||
//image: "../../assets/fastforward.png"
|
||||
iconSource:"../../assets/fastforward.png"
|
||||
hoverEnabled: true
|
||||
enabled: MprisController.canGoNext
|
||||
onClicked: MprisController.next()
|
||||
|
||||
@@ -355,7 +355,8 @@ PopupWindow {
|
||||
implicitWidth: 24
|
||||
implicitHeight: 24
|
||||
enabled: MprisController.loopSupported
|
||||
image: {
|
||||
//image: {
|
||||
/*iconSource {
|
||||
switch (MprisController.loopState) {
|
||||
case MprisLoopState.None:
|
||||
return "../../assets/repeat-off.png";
|
||||
@@ -364,7 +365,17 @@ PopupWindow {
|
||||
case MprisLoopState.Track:
|
||||
return "../../assets/repeat-once.png";
|
||||
}
|
||||
}*/
|
||||
function getLoopIcon() {
|
||||
switch (MprisController.loopState) {
|
||||
case MprisLoopState.None: return "../../assets/repeat-off.png";
|
||||
case MprisLoopState.Playlist: return "../../assets/repeat.png";
|
||||
case MprisLoopState.Track: return "../../assets/repeat-once.png";
|
||||
}
|
||||
return "../../assets/repeat-off.png"; // fallback
|
||||
}
|
||||
|
||||
iconSource: getLoopIcon()
|
||||
onClicked: {
|
||||
let target = MprisLoopState.None;
|
||||
switch (MprisController.loopState) {
|
||||
@@ -388,7 +399,8 @@ PopupWindow {
|
||||
implicitWidth: 32
|
||||
implicitHeight: 32
|
||||
enabled: MprisController.canGoPrevious
|
||||
image: "../../assets/fastforward.png"
|
||||
//image: "../../assets/fastforward.png"
|
||||
iconSource: "../../assets/fastforward.png"
|
||||
mirror: true
|
||||
onClicked: MprisController.previous()
|
||||
}
|
||||
@@ -397,7 +409,8 @@ PopupWindow {
|
||||
implicitWidth: 42
|
||||
implicitHeight: 42
|
||||
enabled: MprisController.canTogglePlaying
|
||||
image: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png`
|
||||
//image: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png`
|
||||
iconSource: `../../assets/${MprisController.isPlaying ? "pause" : "play"}.png`
|
||||
onClicked: MprisController.togglePlaying()
|
||||
}
|
||||
|
||||
@@ -407,7 +420,8 @@ PopupWindow {
|
||||
implicitWidth: 32
|
||||
implicitHeight: 32
|
||||
enabled: MprisController.canGoNext
|
||||
image: "../../assets/fastforward.png"
|
||||
//image: "../../assets/fastforward.png"
|
||||
iconSource: "../../assets/fastforward.png"
|
||||
onClicked: MprisController.next()
|
||||
}
|
||||
|
||||
@@ -417,7 +431,8 @@ PopupWindow {
|
||||
implicitWidth: 24
|
||||
implicitHeight: 24
|
||||
enabled: MprisController.shuffleSupported
|
||||
image: `../../assets/${MprisController.hasShuffle ? "shuffle" : "noshuffle"}.png`
|
||||
//image: `../../assets/${MprisController.hasShuffle ? "shuffle" : "noshuffle"}.png`
|
||||
iconSource: `../../assets/${MprisController.hasShuffle ? "shuffle" : "noshuffle"}.png`
|
||||
onClicked: MprisController.setShuffle(!MprisController.hasShuffle)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user