Refactor UI to add Mpv player widget with overlay
This commit is contained in:
+12
-32
@@ -1,4 +1,5 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.Imagine 2.12
|
||||
@@ -9,45 +10,24 @@ import Ikinuki.Client 1.0
|
||||
import "./components"
|
||||
|
||||
ApplicationWindow {
|
||||
width: 1920
|
||||
height: 1080
|
||||
id: window
|
||||
visible: true
|
||||
Database {
|
||||
id: database
|
||||
}
|
||||
Row {
|
||||
StackLayout {
|
||||
id: mainTabView
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
property int selectedView: 0
|
||||
Sidebar {
|
||||
id: sidebar
|
||||
maximized: parent.selectedView == 0
|
||||
providers: database.Providers
|
||||
currentIndex: 0
|
||||
BrowserView {
|
||||
id: browserView
|
||||
focus: true
|
||||
}
|
||||
ContentView {
|
||||
id: view
|
||||
providers: database.Providers
|
||||
}
|
||||
function mod(n, m) {
|
||||
return ((n % m) + m) % m;
|
||||
}
|
||||
Keys.onPressed: (event)=> {
|
||||
if (selectedView == 0) {
|
||||
if (event.key == Qt.Key_Right) {
|
||||
selectedView = 1;
|
||||
view.viewSelected = true
|
||||
}
|
||||
sidebar.Keys.pressed(event);
|
||||
|
||||
if (event.key == Qt.Key_Down) {
|
||||
view.currentIndex = mod(view.currentIndex + 1, view.providers.length)
|
||||
} else if (event.key == Qt.Key_Up) {
|
||||
view.currentIndex = mod(view.currentIndex - 1, view.providers.length)
|
||||
}
|
||||
event.accepted = true;
|
||||
} else {
|
||||
view.Keys.pressed(event);
|
||||
}
|
||||
event.accepted = true;
|
||||
PlayerView {
|
||||
id: playerView
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user