fist comin
This commit is contained in:
134
Main.qml
134
Main.qml
@@ -9,11 +9,7 @@ ApplicationWindow {
|
||||
id: root
|
||||
width: 1280
|
||||
height: 800
|
||||
title: qsTr("QYouRadio")
|
||||
|
||||
Component.onCompleted: function() {
|
||||
console.log(Player.stations)
|
||||
}
|
||||
title: qsTr("QYouVideo")
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
@@ -30,76 +26,8 @@ ApplicationWindow {
|
||||
|
||||
Label {
|
||||
Layout.leftMargin: 5
|
||||
text: "QYouRadio"
|
||||
text: "QYouVideo"
|
||||
heading: "h1"
|
||||
// font.bold: true
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.leftMargin: 5
|
||||
width: 320
|
||||
height: 36
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
id: nowplaying_root
|
||||
// visible: Player.currentIndex != null
|
||||
visible: anchors.bottomMargin < 42
|
||||
color: Colors.primary
|
||||
radius: 5
|
||||
clip: true
|
||||
|
||||
NumberAnimation {
|
||||
running: Player.playing && tabbar.currentIndex != Player.currentIndex && nowplaying_root.anchors.bottomMargin >= 42
|
||||
target: nowplaying_root
|
||||
property: "anchors.bottomMargin"
|
||||
from: 42
|
||||
to: 0
|
||||
duration: 145
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
running: !Player.playing || (tabbar.currentIndex == Player.currentIndex && nowplaying_root.anchors.bottomMargin < 42)
|
||||
target: nowplaying_root
|
||||
property: "anchors.bottomMargin"
|
||||
from: 0
|
||||
to: 42
|
||||
duration: 145
|
||||
}
|
||||
|
||||
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 ") + qsTr(Player.currentStation.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: qsTr(Player.currentStation.songTitle)
|
||||
heading: "h3"
|
||||
|
||||
|
||||
SequentialAnimation {
|
||||
running: nowplaying_title.width > 320
|
||||
loops: Animation.Infinite
|
||||
|
||||
NumberAnimation { target: nowplaying_title; property: "anchors.leftMargin"; from: 4; to: 4; duration: 10000 }
|
||||
NumberAnimation { target: nowplaying_title; property: "anchors.leftMargin"; from: 4; to: -nowplaying_title.width + 324; duration: nowplaying_title.width * 4 }
|
||||
NumberAnimation { target: nowplaying_title; property: "anchors.leftMargin"; from: -nowplaying_title.width + 324; to: -nowplaying_title.width + 324; duration: 10000 }
|
||||
NumberAnimation { target: nowplaying_title; property: "anchors.leftMargin"; from: -nowplaying_title.width + 324; to: 4; duration: nowplaying_title.width * 4 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -113,16 +41,17 @@ ApplicationWindow {
|
||||
background: Item{}
|
||||
|
||||
TabButton {
|
||||
text: qsTr("Autoradio")
|
||||
text: qsTr("Videos")
|
||||
outlined: true
|
||||
implicitWidth: 80
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Live Mix")
|
||||
text: qsTr("About")
|
||||
outlined: true
|
||||
implicitWidth: 80
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Deep Bass")
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Settings")
|
||||
text: qsTr("Upload")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,61 +70,28 @@ ApplicationWindow {
|
||||
active: true
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
sourceComponent: ViewPlayer {
|
||||
index: 0
|
||||
}
|
||||
source: "ViewVideoList.qml"
|
||||
}
|
||||
Loader {
|
||||
// active: tabbar.currentIndex == 1
|
||||
active: true
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
sourceComponent: ViewPlayer {
|
||||
index: 1
|
||||
}
|
||||
source: "ViewAbout.qml"
|
||||
}
|
||||
Loader {
|
||||
// active: tabbar.currentIndex == 2
|
||||
active: true
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
sourceComponent: ViewPlayer {
|
||||
index: 2
|
||||
sourceComponent: Label {
|
||||
heading: "h1"
|
||||
text: "No idea if I'll ever implement this so don't worry >w<"
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: contentItem.highlightMoveDuration = 160;
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: false
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: 30
|
||||
Layout.bottomMargin: 30
|
||||
width: 220
|
||||
|
||||
Button {
|
||||
Layout.rightMargin: 5
|
||||
text: Player.loading ? "Loading" : (Player.playing ? "Pause" : "Play")
|
||||
|
||||
onClicked: function() {
|
||||
if (Player.playing) {
|
||||
Player.stopPlaying();
|
||||
} else {
|
||||
Player.startPlaying(tabbar.currentIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 5
|
||||
from: 0.1
|
||||
to: 1.1
|
||||
stepSize: 0.05
|
||||
value: Player.volume + 0.1
|
||||
onMoved: Player.volume = value - 0.1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user