aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/sonix/SonixPage.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-07 12:00:58 +0100
committerDanilo M. <danix@danix.xyz>2026-11-07 12:00:58 +0100
commitd9a76b01d5a50af44e576c62efc1dbbf76db6203 (patch)
tree921d6dbbf17f87a64aa8379807fdceab69fa02fb /desktop/modules/sonix/SonixPage.qml
parent0811ff78e1716a7984aaa315bac0b2b4a8de248d (diff)
downloadquickshell-d9a76b01d5a50af44e576c62efc1dbbf76db6203.tar.gz
quickshell-d9a76b01d5a50af44e576c62efc1dbbf76db6203.zip
sonix: drawer tile and the Device tab
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/sonix/SonixPage.qml')
-rw-r--r--desktop/modules/sonix/SonixPage.qml56
1 files changed, 56 insertions, 0 deletions
diff --git a/desktop/modules/sonix/SonixPage.qml b/desktop/modules/sonix/SonixPage.qml
new file mode 100644
index 0000000..1ee89a6
--- /dev/null
+++ b/desktop/modules/sonix/SonixPage.qml
@@ -0,0 +1,56 @@
+// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+import QtQuick
+import "../.."
+
+Column {
+ id: page
+ required property var mod
+ signal go(string name)
+ property string tab: "device"
+ spacing: 14
+
+ Component.onCompleted: Sonix.hold()
+ Component.onDestruction: Sonix.release()
+
+ Text {
+ visible: !Sonix.present
+ text: "The player is not on the network."
+ font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2 }
+ color: Theme.subtext
+ }
+
+ Row {
+ visible: Sonix.present
+ spacing: 6
+ Repeater {
+ model: [["device", "Device"], ["playlists", "Playlists"], ["folders", "Folders"]]
+ delegate: Button {
+ required property var modelData
+ text: modelData[1]
+ border.color: page.tab === modelData[0] ? Theme.accent : Qt.alpha(Theme.text, 0.2)
+ onClicked: page.tab = modelData[0]
+ }
+ }
+ }
+
+ Loader {
+ width: page.width
+ active: Sonix.present
+ sourceComponent: page.tab === "device" ? deviceTab
+ : page.tab === "playlists" ? playlistsTab : foldersTab
+ }
+
+ Component { id: deviceTab; SonixDevice { onGo: name => page.go(name) } }
+ Component { id: playlistsTab; Item {} }
+ Component { id: foldersTab; Item {} }
+}