diff --git a/quickshell/Audio.qml b/quickshell/Audio.qml index 14783fe..6bba82d 100644 --- a/quickshell/Audio.qml +++ b/quickshell/Audio.qml @@ -22,7 +22,7 @@ Item { IconImage { // anchors.centerIn: parent implicitSize: 27 - source: "root:Speaker.svg" + source: "root:/assets/bar/Speaker.svg" } @@ -35,7 +35,7 @@ Item { IconImage { implicitSize: 26 - source: "root:Mic.svg" + source: "root:/assets/bar/Mic.svg" } Text { diff --git a/quickshell/Bar.qml b/quickshell/Bar.qml index 5adbdfd..747a272 100644 --- a/quickshell/Bar.qml +++ b/quickshell/Bar.qml @@ -39,8 +39,6 @@ import Quickshell.Widgets sourceComponent: Audio {} } RowLayout { - id: aaaaa - // If player disapear the seprator disapears with it visible: Player.activePlayer.isPlaying() VerticalSeprator {} PlayerText { @@ -54,6 +52,7 @@ import Quickshell.Widgets font.pointSize: 10.75 } } + SystemTray {} // VerticalSeprator {} } } diff --git a/quickshell/FullwidthMouseArea.qml b/quickshell/FullwidthMouseArea.qml deleted file mode 100644 index bb41790..0000000 --- a/quickshell/FullwidthMouseArea.qml +++ /dev/null @@ -1,53 +0,0 @@ -import QtQuick - -Item { - id: root - - property bool fillWindowWidth: false; - property real extraVerticalMargin: 0; - - property alias mouseArea: mouseArea; - property alias hoverEnabled: mouseArea.hoverEnabled; - property alias acceptedButtons: mouseArea.acceptedButtons; - property alias pressedButtons: mouseArea.pressedButtons; - property alias containsMouse: mouseArea.containsMouse; - property alias isPressed: mouseArea.pressed; - - signal clicked(event: MouseEvent); - signal entered(); - signal exited(); - signal pressed(event: MouseEvent); - signal released(event: MouseEvent); - signal wheel(event: WheelEvent); - - MouseArea { - id: mouseArea - - anchors { - fill: parent - // not much point in finding exact values - leftMargin: root.fillWindowWidth ? -50 : 0 - rightMargin: root.fillWindowWidth ? -50 : 0 - topMargin: -root.extraVerticalMargin - bottomMargin: -root.extraVerticalMargin - } - - Component.onCompleted: { - this.clicked.connect(root.clicked); - //this.entered.connect(root.entered); - //this.exited.connect(root.exited); - //this.pressed.connect(root.pressed); - this.released.connect(root.released); - //this.wheel.connect(root.wheel); - } - - // for some reason MouseArea.pressed is both a prop and signal so connect doesn't work - onPressed: event => root.pressed(event); - - // connecting to onwheel seems to implicitly accept it. undo that. - onWheel: event => { - event.accepted = false; - root.wheel(event); - } - } -} diff --git a/quickshell/PlayerPopup.qml b/quickshell/PlayerPopup.qml index 4de9e5c..debb629 100644 --- a/quickshell/PlayerPopup.qml +++ b/quickshell/PlayerPopup.qml @@ -4,9 +4,7 @@ import Quickshell import QtQuick.Layouts PopupWindow { - property PlayerControllerV2 playerController: null; - - + property PlayerControllerV2 player: PlayerControllerV2; id: audioPopup anchor { @@ -27,19 +25,19 @@ PopupWindow { Image { id: coverImg anchors.fill: parent - source: Player.activePlayer.trackArtUrl; + source: player.activePlayer.trackArtUrl; width: 275 height: 275 fillMode: Image.PreserveAspectCrop } } Text { - text: Player.activePlayer.trackTitle + text: player.activePlayer.trackTitle color: "white" font.pointSize: 10.75 } Text { - text: Player.activePlayer.trackArtist + text: player.activePlayer.trackArtist color: "white" font.pointSize: 10.75 } diff --git a/quickshell/PlayerText.qml b/quickshell/PlayerText.qml index a782abf..a4953e8 100644 --- a/quickshell/PlayerText.qml +++ b/quickshell/PlayerText.qml @@ -43,7 +43,7 @@ Item { implicitWidth: 30; IconImage { implicitSize: 30; - source: "root:skip_next"; + source: "root:assets/media_player/skip_next.svg"; scale: -1 } MouseArea { @@ -58,7 +58,7 @@ Item { implicitWidth: 30; IconImage { implicitSize: 30; - source: !Player.activePlayer.isPlaying ? "root:playbutton.svg" : "root:pausebutton.svg"; + source: !Player.activePlayer.isPlaying ? "root:/assets/media_player/playbutton.svg" : "root:/assets/media_player/pausebutton.svg"; } MouseArea { anchors.fill: parent @@ -76,7 +76,7 @@ Item { implicitWidth: 30; IconImage { implicitSize: 30; - source: "root:skip_next"; + source: "root:assets/media_player/skip_next.svg"; } MouseArea { anchors.fill: parent @@ -86,44 +86,7 @@ Item { } } } - PopupWindow { + PlayerPopup { id: audioPopup - color: "transparent" - anchor { - item: root - } - anchor.rect.x: root.width / 2 - width / 2 - anchor.rect.y: root.height * 1.2 - height: 350 - width: 300 - Rectangle { - anchors.fill: parent - color: "#919191" - ColumnLayout { - anchors.centerIn: parent - Item { - width: coverImg.width - height: coverImg.height - Image { - id: coverImg - anchors.fill: parent - source: Player.activePlayer.trackArtUrl; - width: 275 - height: 275 - fillMode: Image.PreserveAspectCrop - } - } - Text { - text: Player.activePlayer.trackTitle - color: "white" - font.pointSize: 10.75 - } - Text { - text: Player.activePlayer.trackArtist - color: "white" - font.pointSize: 10.75 - } - } - } } } diff --git a/quickshell/SystemTray.qml b/quickshell/SystemTray.qml new file mode 100644 index 0000000..a8ec1ba --- /dev/null +++ b/quickshell/SystemTray.qml @@ -0,0 +1,25 @@ +import Quickshell +import Quickshell.Io +import QtQuick +import QtQuick.Layouts +import Quickshell.Widgets +import QtQuick.Effects + +import Quickshell.Services.SystemTray + +Item { + width: layout.width + height: layout.height + RowLayout { + id: layout + Repeater { + // id: repeater + model: SystemTray.items + required property int index + Text { + text: SystemTray.items.values[parent.index] + font.pointSize: 10 + } + } + } +} diff --git a/quickshell/Mic.svg b/quickshell/assets/bar/Mic.svg similarity index 100% rename from quickshell/Mic.svg rename to quickshell/assets/bar/Mic.svg diff --git a/quickshell/Speaker.svg b/quickshell/assets/bar/Speaker.svg similarity index 100% rename from quickshell/Speaker.svg rename to quickshell/assets/bar/Speaker.svg diff --git a/quickshell/pausebutton.svg b/quickshell/assets/media_player/pausebutton.svg similarity index 100% rename from quickshell/pausebutton.svg rename to quickshell/assets/media_player/pausebutton.svg diff --git a/quickshell/playbutton.svg b/quickshell/assets/media_player/playbutton.svg similarity index 100% rename from quickshell/playbutton.svg rename to quickshell/assets/media_player/playbutton.svg diff --git a/quickshell/skip_next.svg b/quickshell/assets/media_player/skip_next.svg similarity index 100% rename from quickshell/skip_next.svg rename to quickshell/assets/media_player/skip_next.svg