Files
qyouvideo/Main.qml

90 lines
2.3 KiB
QML
Raw Permalink Normal View History

2025-10-11 02:30:58 +02:00
import QtQuick 6.8
import QtQuick.Controls 6.8
import QtQuick.Controls.Basic 6.8
2025-10-11 02:30:58 +02:00
import QtQuick.Layouts 6.8
2025-10-11 02:30:58 +02:00
import QYRComponents 1.0
ApplicationWindow {
id: root
2025-10-11 17:55:56 +02:00
width: 1280
height: 800
2025-10-18 21:40:02 +02:00
title: qsTr("QYouVideo")
2025-10-19 22:35:30 +02:00
flags: Qt.Dialog
modality: Qt.ApplicationModal
header: Rectangle {
Layout.fillWidth: true
height: 43
color: Colors.surface0
2025-10-11 17:55:56 +02:00
2025-10-19 22:35:30 +02:00
RowLayout {
anchors.fill: parent
anchors.margins: 3
Button {
2025-10-20 02:53:30 +02:00
// visible: stack.depth > 1
2025-10-19 22:35:30 +02:00
text: "Back"
onClicked: stack.popCurrentItem()
}
Label {
2025-10-20 02:53:30 +02:00
id: logo
// visible: stack.currentItem.StackView.index == 0
Layout.leftMargin: 5
text: "QYouVideo"
heading: "h1"
clip: true
2025-10-11 17:55:56 +02:00
}
2025-10-19 22:35:30 +02:00
Item {
Layout.fillWidth: true
}
2025-10-19 22:35:30 +02:00
Button {
text: qsTr("Videos")
outlined: true
implicitWidth: 80
2025-10-20 02:53:30 +02:00
onClicked: if (!(stack.currentItem instanceof ViewVideoList)) stack.push(ComponentCache.viewVideoList.createObject(stack))
}
2025-10-19 22:35:30 +02:00
Button {
text: qsTr("About")
outlined: true
implicitWidth: 80
2025-10-20 02:53:30 +02:00
onClicked: if (!(stack.currentItem instanceof ViewAbout)) stack.push(ComponentCache.viewAbout.createObject(stack))
}
2025-10-19 22:35:30 +02:00
Button {
text: qsTr("Upload")
}
2025-10-19 22:35:30 +02:00
}
}
StackView {
id: stack
2025-10-20 02:53:30 +02:00
// __wheelAreaScrollSpeed: 50
2025-10-19 22:35:30 +02:00
anchors.fill: parent
anchors.margins: 20
2025-10-20 02:53:30 +02:00
initialItem: ViewVideoList {}
2025-10-19 22:35:30 +02:00
function openVideo(id) {
// if (stack.find((item, index) => {
// // If found player instance
// if (item.id == id) {
// // stack.pop(index, StackView.Immediate);
// stack.push(item)
// return true;
// }
// return false;
// }) == null) {
// If didn't find player instance
2025-10-20 02:53:30 +02:00
stack.push(ComponentCache.videoPlayer.createObject(stack, {id: id}));
2025-10-19 22:35:30 +02:00
// }
2025-10-11 02:30:58 +02:00
}
}
}