Files
qyouradio/Main.qml
Dark Steveneq 18ad69ba5d
Some checks failed
Build / build-linux (push) Failing after 17s
Build / build-windows (push) Has been cancelled
Begin implementing UI design, implement metadata fetching
2025-10-14 21:02:58 +02:00

150 lines
4.5 KiB
QML
Executable File

import QtQuick 6.8
import QtQuick.Controls 6.8
import QtQuick.Controls.Basic 6.8
import QtQuick.Layouts 6.8
import QYRComponents 1.0
ApplicationWindow {
id: root
width: 1280
height: 800
title: qsTr("QYouRadio")
ColumnLayout {
anchors.fill: parent
Rectangle {
Layout.fillWidth: true
height: 43
color: Colors.surface0
RowLayout {
anchors.fill: parent
anchors.margins: 3
Label {
Layout.leftMargin: 5
text: "QYouRadio"
heading: "h1"
// font.bold: true
}
Rectangle {
Layout.leftMargin: 5
visible: Player.currentIndex != null
color: Colors.primary
radius: 5
clip: true
width: 320
height: 36
Label {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 1
anchors.leftMargin: 4
anchors.rightMargin: 4
text: (Player.loading ? "Loading " : "Playing ") + (Player.currentIndex != null ? qsTr(Player.currentStream.name) : "")
heading: "h5"
}
Label {
id: nowplaying_title
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottomMargin: 1
anchors.leftMargin: 4
anchors.rightMargin: 4
text: (Player.currentIndex != null ? qsTr(Player.currentStream.title) : "")
heading: "h3"
SequentialAnimation {
running: true
loops: Animation.Infinite
NumberAnimation { target: nowplaying_title; property: "anchors.rightMargin"; from: 0; to: 320; duration: 5000 }
NumberAnimation { target: nowplaying_title; property: "anchors.leftMargin"; from: 0; to: 320; duration: 5000 }
}
}
}
Item {
Layout.fillWidth: true
}
TabBar {
id: tabbar
spacing: 10
background: Item{}
TabButton {
text: qsTr("Autoradio")
}
TabButton {
text: qsTr("Live Mix")
}
TabButton {
text: qsTr("Deep Bass")
}
TabButton {
text: qsTr("Settings")
}
}
// Button {
// text: "S"
// onClicked: function() {
// var component = Qt.createComponent("ViewSettings.qml")
// var window = component.createObject(root)
// window.show()
// }
// }
}
}
SwipeView {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: 20
interactive: false
currentIndex: tabbar.currentIndex
Loader {
active: tabbar.currentIndex == 0
asynchronous: true
visible: status == Loader.Ready
sourceComponent: ViewPlayer {
index: 0
}
}
Loader {
active: tabbar.currentIndex == 1
asynchronous: true
visible: status == Loader.Ready
sourceComponent: ViewPlayer {
index: 1
}
}
Loader {
active: tabbar.currentIndex == 2
asynchronous: true
visible: status == Loader.Ready
sourceComponent: ViewPlayer {
index: 2
}
}
}
YouAds {
Layout.fillWidth: false
Layout.alignment: Qt.AlignHCenter
}
}
}