aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/sonix/SonixPage.qml
diff options
context:
space:
mode:
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 {} }
+}