From d9a76b01d5a50af44e576c62efc1dbbf76db6203 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 7 Nov 2026 12:00:58 +0100 Subject: sonix: drawer tile and the Device tab Co-Authored-By: Claude Sonnet 5.5 --- desktop/modules/sonix/SonixPage.qml | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 desktop/modules/sonix/SonixPage.qml (limited to 'desktop/modules/sonix/SonixPage.qml') 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. +// +// 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 {} } +} -- cgit v1.2.3