diff --git a/ScStwMonitorSrc/resources/qml/main.qml b/ScStwMonitorSrc/resources/qml/main.qml index 4fb1072..c3d1487 100755 --- a/ScStwMonitorSrc/resources/qml/main.qml +++ b/ScStwMonitorSrc/resources/qml/main.qml @@ -58,7 +58,7 @@ Window { id: appTheme Component.onCompleted: { - appTheme.setTheme("Light") + appTheme.setTheme(darkMode ? "Dark":"Light") } } @@ -95,10 +95,43 @@ Window { Component { id: displayComp + Column { + + Rectangle { + id: topBanner + width: parent.width + height: !showControls && showBanners ? backend.race.state === ScStwRace.IDLE ? parent.height * 0.1:parent.height * 0.05 : 0 + color: "black" + + Text { + + anchors.fill: parent + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + font.pixelSize: height * 0.5 + + visible: height > 0 + + color: "white" + + text: qsTr("Speed Climbing Stopwatch") + } + + Behavior on height { + NumberAnimation { + duration: 200 + easing.type: Easing.Linear + } + } + } + Item { id: displayItm - anchors.fill: parent + width: parent.width + height: parent.height - bottomBanner.height - topBanner.height Image { id: bannerImg @@ -123,12 +156,22 @@ Window { TimerColumn { anchors.fill: parent - timers: backend.race.timers + timers: removeDisabledTimers(backend.race.timers) + colors: appTheme.theme.colors fontName: appTheme.theme.fonts.timers opacity: !showControls || [ScStwRace.IDLE,ScStwRace.STARTING].indexOf(backend.race.state) < 0 ? 1:0 + function removeDisabledTimers(timers) { + var ret = [] + for(var i = 0; i < timers.length; i++) { + if(timers[i]["state"] !== ScStwTimer.DISABLED) + ret.push(timers[i]) + } + return ret + } + Behavior on opacity { NumberAnimation { duration: 200 @@ -405,6 +448,40 @@ Window { } } + + Rectangle { + id: bottomBanner + width: parent.width + height: !showControls && showBanners ? backend.race.state === ScStwRace.IDLE ? parent.height * 0.1:parent.height * 0.05 : 0 + color: "black" + + + Text { + + anchors.fill: parent + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + font.pixelSize: height * 0.5 + + visible: height > 0 + + color: "white" + + text: qsTr("www.itsblue.de/scstw") + } + + Behavior on height { + NumberAnimation { + duration: 200 + easing.type: Easing.Linear + } + } + } + + } + } Component { @@ -425,6 +502,13 @@ Window { image: appTheme.theme.images.SpeedHold } + MouseArea { + id: textFieldEnableMa + hoverEnabled: true + anchors.fill: parent + anchors.leftMargin: parent.width * 0.9 + } + TextField { id: ipAddrInputTf @@ -433,6 +517,8 @@ Window { horizontalCenter: parent.horizontalCenter } + visible: !textFieldEnableMa.containsMouse + opacity: backend.scStwClient.state === ScStwClient.CONNECTED ? 0:1 text: appSettings.baseStationIp diff --git a/ScStwMonitorSrc/sources/main.cpp b/ScStwMonitorSrc/sources/main.cpp index ad5fdd3..a961688 100755 --- a/ScStwMonitorSrc/sources/main.cpp +++ b/ScStwMonitorSrc/sources/main.cpp @@ -51,11 +51,27 @@ int main(int argc, char *argv[]) engine.rootContext()->setContextProperty("XscreenHeight", size.height()); engine.rootContext()->setContextProperty("XscreenWidth", size.width()); - if(argc > 1 && QString(argv[1]) == "--noControls") + QStringList args; + + for(int i = 0; i <= argc; i++) { + args.append(argv[i]); + } + + if(args.contains("--noControls")) engine.rootContext()->setContextProperty("showControls", false); else engine.rootContext()->setContextProperty("showControls", true); + if(args.contains("--noBanners")) + engine.rootContext()->setContextProperty("showBanners", false); + else + engine.rootContext()->setContextProperty("showBanners", true); + + if(args.contains("--darkMode")) + engine.rootContext()->setContextProperty("darkMode", true); + else + engine.rootContext()->setContextProperty("darkMode", false); + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) return -1; diff --git a/release/ScStwMonitor.deb b/release/ScStwMonitor.deb index a82c781..6d96e06 100644 Binary files a/release/ScStwMonitor.deb and b/release/ScStwMonitor.deb differ diff --git a/release/debian/etc/systemd/system/scstwmonitor.service b/release/debian/etc/systemd/system/scstwmonitor.service index 8a6f12e..e656016 100644 --- a/release/debian/etc/systemd/system/scstwmonitor.service +++ b/release/debian/etc/systemd/system/scstwmonitor.service @@ -6,7 +6,7 @@ After=network.target [Service] #ExecStartPre=/usr/sbin/sshd -t -ExecStart=xinit /usr/bin/ScStwMonitor --noControls -- +ExecStart=xinit /usr/bin/ScStwMonitor --noControls --darkMode -- WorkingDirectory=/ User=root StandardOutput=inherit diff --git a/release/debian/usr/share/ScStwMonitor/ScStwMonitor b/release/debian/usr/share/ScStwMonitor/ScStwMonitor index 1ea3d6d..c3108f2 100755 Binary files a/release/debian/usr/share/ScStwMonitor/ScStwMonitor and b/release/debian/usr/share/ScStwMonitor/ScStwMonitor differ diff --git a/shared-libraries b/shared-libraries index ac0d1a4..eb13286 160000 --- a/shared-libraries +++ b/shared-libraries @@ -1 +1 @@ -Subproject commit ac0d1a46168ee8563caed54e54548893c6c9066d +Subproject commit eb1328642db8fb194659e1ff4b53d45c1dcbc56d