2018-12-22 14:07:44 +00:00
|
|
|
import QtQuick 2.0
|
2018-12-22 14:13:53 +00:00
|
|
|
import QtQuick.Controls 2.3
|
2018-10-13 15:38:31 +01:00
|
|
|
import QtQuick.Dialogs 1.3
|
2018-12-22 14:26:34 +00:00
|
|
|
import QtQuick.Layouts 1.2
|
2018-12-22 14:21:42 +00:00
|
|
|
import QtQuick.Window 2.2
|
2018-10-24 17:41:41 +01:00
|
|
|
import Qt.labs.settings 1.0
|
2018-11-04 15:11:50 +00:00
|
|
|
import Qt.labs.platform 1.0 as LabsPlatform
|
2018-10-13 15:38:31 +01:00
|
|
|
import player 1.0
|
|
|
|
|
|
|
|
import "codes.js" as LanguageCodes
|
|
|
|
|
2018-11-24 15:43:48 +00:00
|
|
|
Window {
|
2018-10-13 15:38:31 +01:00
|
|
|
id: mainWindow
|
2020-04-23 15:10:48 +01:00
|
|
|
title: "KittehPlayer"
|
2018-10-13 15:38:31 +01:00
|
|
|
visible: true
|
|
|
|
width: 720
|
|
|
|
height: 480
|
2018-11-30 16:42:19 +00:00
|
|
|
property int virtualHeight: Screen.height * appearance.scaleFactor
|
|
|
|
property int virtualWidth: Screen.width * appearance.scaleFactor
|
2018-11-26 16:50:25 +00:00
|
|
|
property bool onTop: false
|
2018-11-29 08:25:54 +00:00
|
|
|
|
2018-12-20 14:37:29 +00:00
|
|
|
QMLDebugger {
|
|
|
|
id: qmlDebugger
|
|
|
|
}
|
2018-12-23 14:52:31 +00:00
|
|
|
|
2020-04-23 15:10:48 +01:00
|
|
|
Item {
|
|
|
|
id: globalConnections
|
2020-04-23 17:04:37 +01:00
|
|
|
signal showUI
|
|
|
|
signal hideUI
|
2020-04-23 15:10:48 +01:00
|
|
|
}
|
|
|
|
|
2018-12-01 12:10:52 +00:00
|
|
|
function getAppearanceValueForTheme(themeName, name) {
|
|
|
|
if (themeName == "YouTube") {
|
|
|
|
return youTubeAppearance[name]
|
|
|
|
} else if (themeName == "Niconico") {
|
|
|
|
return nicoNicoAppearance[name]
|
2018-12-03 08:17:57 +00:00
|
|
|
} else if (themeName == "RoosterTeeth") {
|
|
|
|
return roosterTeethAppearance[name]
|
2020-04-11 14:07:32 +01:00
|
|
|
} else {
|
|
|
|
appearance.themeName = "YouTube"
|
|
|
|
return youTubeAppearance[name]
|
2018-12-01 12:10:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-01 18:51:55 +00:00
|
|
|
Translator {
|
|
|
|
id: translate
|
2018-10-24 19:49:05 +01:00
|
|
|
}
|
2018-12-23 14:52:31 +00:00
|
|
|
|
2018-12-12 08:28:53 +00:00
|
|
|
Settings {
|
|
|
|
id: loggingSettings
|
|
|
|
category: "Logging"
|
|
|
|
property string logFile: "/tmp/KittehPlayer.log"
|
|
|
|
property bool logBackend: true
|
|
|
|
}
|
2018-10-29 16:12:19 +00:00
|
|
|
|
2018-11-24 21:00:04 +00:00
|
|
|
Settings {
|
|
|
|
id: backendSettings
|
|
|
|
category: "Backend"
|
|
|
|
property string backend: "mpv"
|
2020-04-17 12:32:23 +01:00
|
|
|
property bool fbo: true
|
|
|
|
property bool direct: false
|
2018-11-24 21:00:04 +00:00
|
|
|
}
|
|
|
|
|
2018-11-23 08:19:28 +00:00
|
|
|
Settings {
|
|
|
|
id: appearance
|
|
|
|
category: "Appearance"
|
|
|
|
property bool titleOnlyOnFullscreen: true
|
2020-04-23 17:09:52 +01:00
|
|
|
property bool clickToPause: false
|
2018-11-23 08:19:28 +00:00
|
|
|
property bool useMpvSubs: false
|
2018-11-28 18:41:54 +00:00
|
|
|
property string themeName: "YouTube"
|
2018-11-23 08:19:28 +00:00
|
|
|
property string fontName: "Roboto"
|
2018-12-01 12:10:52 +00:00
|
|
|
property double scaleFactor: 1.0
|
2020-04-23 17:09:52 +01:00
|
|
|
property int subtitlesFontSize: 24
|
2020-04-16 18:35:53 +01:00
|
|
|
property int uiFadeTimer: 1000
|
2020-04-23 17:09:52 +01:00
|
|
|
property bool doubleTapToSeek: true
|
2020-04-22 14:31:13 +01:00
|
|
|
property double doubleTapToSeekBy: 5
|
2020-04-24 11:15:49 +01:00
|
|
|
property bool swipeToResize: true
|
2020-04-23 17:09:52 +01:00
|
|
|
// Can fix some screen tearing on some devices.
|
2020-04-20 13:14:09 +01:00
|
|
|
property bool maximizeInsteadOfFullscreen: false
|
2018-12-01 12:10:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Settings {
|
|
|
|
id: youTubeAppearance
|
2018-12-01 13:03:22 +00:00
|
|
|
category: "YouTubeAppearance"
|
2018-12-05 17:18:35 +00:00
|
|
|
property string mainBackground: "#9C000000"
|
|
|
|
property string progressBackgroundColor: "#33FFFFFF"
|
|
|
|
property string progressCachedColor: "#66FFFFFF"
|
|
|
|
property string buttonColor: "white"
|
|
|
|
property string buttonHoverColor: "white"
|
|
|
|
property string progressSliderColor: "red"
|
|
|
|
property string chapterMarkerColor: "#fc0"
|
|
|
|
property string volumeSliderBackground: "white"
|
2018-12-01 12:10:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Settings {
|
|
|
|
id: nicoNicoAppearance
|
2018-12-01 13:03:22 +00:00
|
|
|
category: "NicoNicoAppearance"
|
2018-12-01 12:10:52 +00:00
|
|
|
property string mainBackground: "#9C000000"
|
|
|
|
property string progressBackgroundColor: "#444"
|
2018-12-05 12:05:18 +00:00
|
|
|
property string progressCachedColor: "#66FFFFFF"
|
2018-12-01 12:10:52 +00:00
|
|
|
property string buttonColor: "white"
|
2018-12-03 08:17:57 +00:00
|
|
|
property string buttonHoverColor: "white"
|
2018-12-01 12:10:52 +00:00
|
|
|
property string progressSliderColor: "#007cff"
|
|
|
|
property string chapterMarkerColor: "#fc0"
|
2018-12-01 12:12:30 +00:00
|
|
|
property string volumeSliderBackground: "#007cff"
|
2018-11-23 08:19:28 +00:00
|
|
|
}
|
2018-11-29 08:25:54 +00:00
|
|
|
|
2018-12-03 08:17:57 +00:00
|
|
|
Settings {
|
|
|
|
id: roosterTeethAppearance
|
|
|
|
category: "RoosterTeethAppearance"
|
|
|
|
property string mainBackground: "#CC2B333F"
|
|
|
|
property string progressBackgroundColor: "#444"
|
|
|
|
property string progressCachedColor: "white"
|
|
|
|
property string buttonColor: "white"
|
|
|
|
property string buttonHoverColor: "#c9373f"
|
|
|
|
property string progressSliderColor: "#c9373f"
|
|
|
|
property string chapterMarkerColor: "#fc0"
|
|
|
|
property string volumeSliderBackground: "#c9373f"
|
|
|
|
}
|
|
|
|
|
2018-11-23 08:19:28 +00:00
|
|
|
Settings {
|
|
|
|
id: i18n
|
|
|
|
category: "I18N"
|
|
|
|
property string language: "english"
|
|
|
|
}
|
2018-11-18 19:23:31 +00:00
|
|
|
|
2018-11-23 08:19:28 +00:00
|
|
|
Settings {
|
|
|
|
id: fun
|
|
|
|
category: "Fun"
|
|
|
|
property bool nyanCat: false
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings {
|
|
|
|
id: keybinds
|
|
|
|
category: "Keybinds"
|
|
|
|
property string playPause: "K"
|
|
|
|
property string forward10: "L"
|
|
|
|
property string rewind10: "J"
|
|
|
|
property string forward5: "Right"
|
|
|
|
property string rewind5: "Left"
|
|
|
|
property string openFile: "Ctrl+O"
|
|
|
|
property string openURI: "Ctrl+Shift+O"
|
|
|
|
property string quit: "Ctrl+Q"
|
|
|
|
property string fullscreen: "F"
|
|
|
|
property string tracks: "Ctrl+T"
|
|
|
|
property string statsForNerds: "I"
|
|
|
|
property string forwardFrame: "."
|
|
|
|
property string backwardFrame: ","
|
|
|
|
property string cycleSub: "Alt+S"
|
|
|
|
property string cycleSubBackwards: "Alt+Shift+S"
|
|
|
|
property string cycleAudio: "A"
|
|
|
|
property string cycleVideo: "V"
|
|
|
|
property string cycleVideoAspect: "Shift+A"
|
|
|
|
property string screenshot: "S"
|
|
|
|
property string screenshotWithoutSubtitles: "Shift+S"
|
|
|
|
property string fullScreenshot: "Ctrl+S"
|
|
|
|
property string nyanCat: "Ctrl+N"
|
|
|
|
property string decreaseSpeedByPointOne: "["
|
|
|
|
property string increaseSpeedByPointOne: "]"
|
|
|
|
property string halveSpeed: "{"
|
|
|
|
property string doubleSpeed: "}"
|
|
|
|
property string increaseVolume: "*"
|
|
|
|
property string decreaseVolume: "/"
|
|
|
|
property string mute: "m"
|
2018-11-30 16:57:29 +00:00
|
|
|
property string increaseScale: "Ctrl+Shift+="
|
2018-12-01 12:10:52 +00:00
|
|
|
property string resetScale: "Ctrl+Shift+0"
|
2018-11-30 16:57:29 +00:00
|
|
|
property string decreaseScale: "Ctrl+Shift+-"
|
2018-11-23 08:19:28 +00:00
|
|
|
property string customKeybind0: ""
|
|
|
|
property string customKeybind0Command: ""
|
|
|
|
property string customKeybind1: ""
|
|
|
|
property string customKeybind1Command: ""
|
|
|
|
property string customKeybind2: ""
|
|
|
|
property string customKeybind2Command: ""
|
|
|
|
property string customKeybind3: ""
|
|
|
|
property string customKeybind3Command: ""
|
|
|
|
property string customKeybind4: ""
|
|
|
|
property string customKeybind4Command: ""
|
|
|
|
property string customKeybind5: ""
|
|
|
|
property string customKeybind5Command: ""
|
|
|
|
property string customKeybind6: ""
|
|
|
|
property string customKeybind6Command: ""
|
|
|
|
property string customKeybind7: ""
|
|
|
|
property string customKeybind7Command: ""
|
|
|
|
property string customKeybind8: ""
|
|
|
|
property string customKeybind8Command: ""
|
|
|
|
property string customKeybind9: ""
|
|
|
|
property string customKeybind9Command: ""
|
|
|
|
}
|
2018-11-18 19:23:31 +00:00
|
|
|
|
|
|
|
property int lastScreenVisibility
|
|
|
|
|
|
|
|
function toggleFullscreen() {
|
2020-04-20 13:14:09 +01:00
|
|
|
var fs = Window.FullScreen
|
|
|
|
if (appearance.maximizeInsteadOfFullscreen) {
|
|
|
|
fs = Window.Maximized
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mainWindow.visibility != fs) {
|
2018-11-18 19:23:31 +00:00
|
|
|
lastScreenVisibility = mainWindow.visibility
|
2020-04-20 13:14:09 +01:00
|
|
|
mainWindow.visibility = fs
|
2018-11-18 19:23:31 +00:00
|
|
|
} else {
|
|
|
|
mainWindow.visibility = lastScreenVisibility
|
|
|
|
}
|
|
|
|
}
|
2018-11-29 08:25:54 +00:00
|
|
|
|
2018-11-26 16:50:25 +00:00
|
|
|
Utils {
|
|
|
|
id: utils
|
|
|
|
}
|
2018-11-29 08:25:54 +00:00
|
|
|
|
2018-11-18 19:23:31 +00:00
|
|
|
PlayerBackend {
|
|
|
|
id: player
|
|
|
|
anchors.fill: parent
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2018-12-12 08:28:53 +00:00
|
|
|
logging: loggingSettings.logBackend
|
2020-04-24 17:06:14 +01:00
|
|
|
z: 1
|
2018-12-12 08:28:53 +00:00
|
|
|
|
2018-12-01 12:10:52 +00:00
|
|
|
Action {
|
|
|
|
onTriggered: {
|
|
|
|
appearance.scaleFactor += 0.1
|
|
|
|
}
|
|
|
|
shortcut: keybinds.increaseScale
|
|
|
|
}
|
|
|
|
Action {
|
|
|
|
onTriggered: {
|
|
|
|
appearance.scaleFactor = 1
|
|
|
|
}
|
|
|
|
shortcut: keybinds.resetScale
|
|
|
|
}
|
|
|
|
Action {
|
|
|
|
onTriggered: {
|
|
|
|
appearance.scaleFactor -= 0.1
|
|
|
|
}
|
|
|
|
shortcut: keybinds.decreaseScale
|
|
|
|
}
|
|
|
|
|
2018-10-18 11:07:09 +01:00
|
|
|
function startPlayer() {
|
2020-04-22 12:53:42 +01:00
|
|
|
//console.info(qmlDebugger.properties(player))
|
2018-12-09 02:35:08 +00:00
|
|
|
console.info("OwO!")
|
|
|
|
|
2018-10-13 15:38:31 +01:00
|
|
|
var args = Qt.application.arguments
|
|
|
|
var len = Qt.application.arguments.length
|
2018-10-20 19:07:15 +01:00
|
|
|
var argNo = 0
|
2018-10-29 16:12:19 +00:00
|
|
|
|
|
|
|
if (!appearance.useMpvSubs) {
|
|
|
|
player.setOption("sub-ass-override", "force")
|
|
|
|
player.setOption("sub-ass", "off")
|
|
|
|
player.setOption("sub-border-size", "0")
|
|
|
|
player.setOption("sub-color", "0.0/0.0/0.0/0.0")
|
|
|
|
player.setOption("sub-border-color", "0.0/0.0/0.0/0.0")
|
|
|
|
player.setOption("sub-back-color", "0.0/0.0/0.0/0.0")
|
|
|
|
}
|
|
|
|
|
2018-10-13 15:38:31 +01:00
|
|
|
if (len > 1) {
|
2018-10-15 16:11:11 +01:00
|
|
|
for (argNo = 1; argNo < len; argNo++) {
|
2018-10-13 15:38:31 +01:00
|
|
|
var argument = args[argNo]
|
2018-10-24 19:49:05 +01:00
|
|
|
if (argument.indexOf("KittehPlayer") !== -1) {
|
|
|
|
continue
|
|
|
|
}
|
2018-10-21 13:00:25 +01:00
|
|
|
if (argument.startsWith("--")) {
|
2018-10-13 15:38:31 +01:00
|
|
|
argument = argument.substr(2)
|
|
|
|
if (argument.length > 0) {
|
|
|
|
var splitArg = argument.split(/=(.+)/)
|
2018-11-23 08:19:28 +00:00
|
|
|
if (splitArg[0] == "screen"
|
|
|
|
|| splitArg[0] == "fs-screen") {
|
2018-11-10 23:10:57 +00:00
|
|
|
for (var i = 0, len = Qt.application.screens.length; i < len; i++) {
|
2018-11-23 08:19:28 +00:00
|
|
|
var screen = Qt.application.screens[i]
|
|
|
|
console.log("Screen Name: " + screen["name"]
|
|
|
|
+ " Screen Number: " + String(
|
|
|
|
i))
|
|
|
|
if (screen["name"] == splitArg[1] || String(
|
|
|
|
i) == splitArg[1]) {
|
2018-11-11 13:31:33 +00:00
|
|
|
console.log("Switching to screen: " + screen["name"])
|
2018-11-10 23:10:57 +00:00
|
|
|
mainWindow.screen = screen
|
2018-11-11 13:31:33 +00:00
|
|
|
mainWindow.width = mainWindow.screen.width / 2
|
|
|
|
mainWindow.height = mainWindow.screen.height / 2
|
2018-11-23 08:19:28 +00:00
|
|
|
mainWindow.x = mainWindow.screen.virtualX
|
|
|
|
+ mainWindow.width / 2
|
|
|
|
mainWindow.y = mainWindow.screen.virtualY
|
|
|
|
+ mainWindow.height / 2
|
|
|
|
if (splitArg[0] == "fs-screen") {
|
2018-11-11 13:31:33 +00:00
|
|
|
toggleFullscreen()
|
|
|
|
}
|
2018-11-10 23:10:57 +00:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
continue
|
|
|
|
}
|
2018-10-14 17:58:36 +01:00
|
|
|
if (splitArg[0] == "fullscreen") {
|
|
|
|
toggleFullscreen()
|
2018-11-23 08:19:28 +00:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
if (splitArg[1] == undefined
|
|
|
|
|| splitArg[1].length == 0) {
|
2018-11-11 13:50:42 +00:00
|
|
|
splitArg[1] = "yes"
|
2018-10-14 17:58:36 +01:00
|
|
|
}
|
2018-11-10 23:10:57 +00:00
|
|
|
player.setOption(splitArg[0], splitArg[1])
|
2018-10-13 19:57:17 +01:00
|
|
|
}
|
2018-10-24 19:49:05 +01:00
|
|
|
} else {
|
2018-11-23 08:19:28 +00:00
|
|
|
player.playerCommand(Enums.Commands.AppendFile,
|
|
|
|
argument)
|
2018-10-21 13:00:25 +01:00
|
|
|
}
|
2018-10-13 15:38:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-26 16:50:25 +00:00
|
|
|
}
|
2018-11-29 08:25:54 +00:00
|
|
|
|
2020-04-23 16:25:40 +01:00
|
|
|
MouseArea {
|
2020-04-24 17:06:14 +01:00
|
|
|
anchors {
|
|
|
|
fill: parent
|
|
|
|
bottomMargin: controlsBar.combinedHeight
|
|
|
|
}
|
2020-04-23 17:04:37 +01:00
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2020-04-24 11:15:49 +01:00
|
|
|
enabled: appearance.swipeToResize
|
2020-04-23 17:04:37 +01:00
|
|
|
property real velocity: 0.0
|
|
|
|
property int xStart: 0
|
|
|
|
property int xPrev: 0
|
|
|
|
hoverEnabled: false
|
|
|
|
propagateComposedEvents: true
|
|
|
|
z: 1010
|
|
|
|
onPressed: {
|
|
|
|
xStart = mouse.x
|
|
|
|
xPrev = mouse.x
|
|
|
|
velocity = 0
|
|
|
|
}
|
|
|
|
onPositionChanged: {
|
|
|
|
var currVel = (mouse.x - xPrev)
|
|
|
|
velocity = (velocity + currVel) / 2.0
|
|
|
|
xPrev = mouse.x
|
|
|
|
}
|
|
|
|
onReleased: {
|
|
|
|
if (velocity > 2 && mouse.x > parent.width * 0.2) {
|
|
|
|
appearance.scaleFactor += 0.2
|
|
|
|
} else if (velocity < -2 && mouse.x > parent.width * 0.2) {
|
|
|
|
appearance.scaleFactor -= 0.2
|
2020-04-23 16:25:40 +01:00
|
|
|
}
|
2020-04-23 17:04:37 +01:00
|
|
|
}
|
2020-04-23 16:25:40 +01:00
|
|
|
}
|
|
|
|
|
2018-11-26 16:50:25 +00:00
|
|
|
Item {
|
|
|
|
id: controlsOverlay
|
|
|
|
anchors.centerIn: player
|
|
|
|
height: player.height
|
|
|
|
width: player.width
|
|
|
|
property bool controlsShowing: true
|
|
|
|
z: 2
|
2018-10-13 15:38:31 +01:00
|
|
|
|
2020-04-23 17:04:37 +01:00
|
|
|
Connections {
|
|
|
|
target: globalConnections
|
|
|
|
onHideUI: function () {
|
|
|
|
mouseAreaPlayer.cursorShape = Qt.BlankCursor
|
|
|
|
}
|
|
|
|
onShowUI: {
|
|
|
|
mouseAreaPlayer.cursorShape = Qt.ArrowCursor
|
|
|
|
}
|
2018-10-13 15:38:31 +01:00
|
|
|
}
|
2018-11-29 08:25:54 +00:00
|
|
|
|
2018-10-13 19:57:17 +01:00
|
|
|
MouseArea {
|
|
|
|
id: mouseAreaBar
|
2018-10-13 15:38:31 +01:00
|
|
|
width: parent.width
|
2020-04-24 17:06:14 +01:00
|
|
|
height: controlsBar.combinedHeight * 1.5
|
2018-10-13 19:57:17 +01:00
|
|
|
hoverEnabled: true
|
2020-04-24 17:06:14 +01:00
|
|
|
anchors {
|
|
|
|
bottom: parent.bottom
|
|
|
|
bottomMargin: 0
|
|
|
|
}
|
2018-10-13 19:57:17 +01:00
|
|
|
onEntered: {
|
|
|
|
mouseAreaPlayerTimer.stop()
|
|
|
|
}
|
2018-10-13 15:38:31 +01:00
|
|
|
}
|
|
|
|
|
2018-10-13 19:57:17 +01:00
|
|
|
MouseArea {
|
|
|
|
id: mouseAreaPlayer
|
2020-04-24 11:15:49 +01:00
|
|
|
z: 10
|
2018-10-29 16:12:19 +00:00
|
|
|
focus: true
|
2018-10-13 19:57:17 +01:00
|
|
|
width: parent.width
|
|
|
|
hoverEnabled: true
|
2020-04-23 15:10:48 +01:00
|
|
|
propagateComposedEvents: true
|
2020-04-24 17:06:14 +01:00
|
|
|
anchors {
|
|
|
|
bottom: mouseAreaBar.top
|
|
|
|
bottomMargin: 10
|
|
|
|
right: parent.right
|
|
|
|
rightMargin: 0
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: 0
|
|
|
|
top: topBar.bottom
|
|
|
|
topMargin: 0
|
|
|
|
}
|
2020-04-23 15:10:48 +01:00
|
|
|
|
2020-04-23 17:04:37 +01:00
|
|
|
Timer {
|
2020-04-22 14:31:13 +01:00
|
|
|
id: mouseTapTimer
|
|
|
|
interval: 200
|
|
|
|
onTriggered: {
|
|
|
|
if (appearance.clickToPause) {
|
|
|
|
player.playerCommand(Enums.Commands.TogglePlayPause)
|
2020-04-23 17:04:37 +01:00
|
|
|
}
|
2020-04-22 14:31:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function doubleMouseClick(mouse) {
|
|
|
|
if (appearance.doubleTapToSeek) {
|
|
|
|
if (mouse.x > (mouseAreaPlayer.width / 2)) {
|
2020-04-23 17:04:37 +01:00
|
|
|
player.playerCommand(Enums.Commands.Seek, String(
|
|
|
|
appearance.doubleTapToSeekBy))
|
2020-04-22 14:31:13 +01:00
|
|
|
} else {
|
2020-04-23 17:04:37 +01:00
|
|
|
player.playerCommand(Enums.Commands.Seek, "-" + String(
|
|
|
|
appearance.doubleTapToSeekBy))
|
2020-04-22 14:31:13 +01:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
toggleFullscreen()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-23 17:04:37 +01:00
|
|
|
onClicked: function (mouse) {
|
|
|
|
if (mouseTapTimer.running) {
|
2020-04-22 14:31:13 +01:00
|
|
|
doubleMouseClick(mouse)
|
|
|
|
mouseTapTimer.stop()
|
|
|
|
} else {
|
|
|
|
mouseTapTimer.restart()
|
|
|
|
}
|
2018-11-17 20:28:07 +00:00
|
|
|
}
|
|
|
|
Action {
|
|
|
|
onTriggered: {
|
2020-04-20 13:14:09 +01:00
|
|
|
toggleFullscreen()
|
2018-11-17 20:28:07 +00:00
|
|
|
}
|
|
|
|
shortcut: "Esc"
|
|
|
|
}
|
2020-04-22 14:31:13 +01:00
|
|
|
|
2018-10-13 19:57:17 +01:00
|
|
|
Timer {
|
|
|
|
id: mouseAreaPlayerTimer
|
2020-04-16 18:35:53 +01:00
|
|
|
interval: appearance.uiFadeTimer
|
2018-10-29 16:12:19 +00:00
|
|
|
running: true
|
2018-11-01 18:51:55 +00:00
|
|
|
repeat: false
|
2018-10-13 19:57:17 +01:00
|
|
|
onTriggered: {
|
2020-04-23 15:10:48 +01:00
|
|
|
globalConnections.hideUI()
|
2018-10-13 19:57:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
onPositionChanged: {
|
2020-04-23 15:10:48 +01:00
|
|
|
globalConnections.showUI()
|
2018-10-13 19:57:17 +01:00
|
|
|
mouseAreaPlayerTimer.restart()
|
|
|
|
}
|
|
|
|
}
|
2018-12-23 14:52:31 +00:00
|
|
|
|
2018-12-22 19:32:30 +00:00
|
|
|
Timer {
|
|
|
|
id: statsUpdater
|
|
|
|
interval: 1000
|
2020-04-23 15:10:48 +01:00
|
|
|
running: statsForNerdsText.visible
|
2018-12-22 19:32:30 +00:00
|
|
|
repeat: true
|
|
|
|
onTriggered: {
|
2020-04-23 15:10:48 +01:00
|
|
|
statsForNerdsText.text = player.getStats()
|
2018-12-22 19:32:30 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-23 14:52:31 +00:00
|
|
|
|
2018-12-22 19:32:30 +00:00
|
|
|
Text {
|
|
|
|
id: statsForNerdsText
|
|
|
|
text: ""
|
|
|
|
color: "white"
|
|
|
|
visible: false
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width
|
|
|
|
textFormat: Text.RichText
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignTop
|
|
|
|
renderType: Text.NativeRendering
|
|
|
|
lineHeight: 1
|
2020-04-24 17:06:14 +01:00
|
|
|
font {
|
|
|
|
family: appearance.fontName
|
|
|
|
pixelSize: mainWindow.virtualHeight / 50
|
|
|
|
}
|
|
|
|
anchors {
|
|
|
|
fill: parent
|
|
|
|
topMargin: mainWindow.virtualHeight / 20
|
|
|
|
leftMargin: mainWindow.virtualHeight / 20
|
|
|
|
}
|
2018-12-22 19:32:30 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
console.error(statsForNerdsText.lineHeight, font.pixelSize)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-23 15:10:48 +01:00
|
|
|
MenuTitleBar {
|
|
|
|
id: topBar
|
2018-10-13 15:38:31 +01:00
|
|
|
}
|
|
|
|
|
2018-11-10 19:55:59 +00:00
|
|
|
ControlsBar {
|
2018-10-13 19:57:17 +01:00
|
|
|
id: controlsBar
|
|
|
|
}
|
2018-10-13 15:38:31 +01:00
|
|
|
}
|
|
|
|
}
|