- removed redundant files

- improved the look of switches in dark mode
- added 'What is this for?' button to the BaseStation settings
This commit is contained in:
dorian 2019-09-22 16:07:41 +02:00
parent 5340398f80
commit c990791306
9 changed files with 173 additions and 75 deletions

View file

@ -229,7 +229,7 @@ Popup {
height: options_stack.delegateHeight height: options_stack.delegateHeight
text: qsTr("start sequence") text: qsTr("Start sequence")
onClicked: { onClicked: {
options_stack.push(autostart) options_stack.push(autostart)
@ -239,7 +239,7 @@ Popup {
/*----Style Settings----*/ /*----Style Settings----*/
SmoothSwitchDelegate { SmoothSwitchDelegate {
id: styleDel id: styleDel
text: qsTr("dark mode") text: qsTr("Dark mode")
width: parent.width width: parent.width
height: options_stack.delegateHeight height: options_stack.delegateHeight
@ -278,7 +278,7 @@ Popup {
width: parent.width width: parent.width
height: options_stack.delegateHeight height: options_stack.delegateHeight
text: qsTr("say 'ready'") text: qsTr("Say 'ready'")
checked: parent.loadSetting("ready_en", ready_del) === "true" checked: parent.loadSetting("ready_en", ready_del) === "true"
@ -295,7 +295,7 @@ Popup {
enabled: ready_del.checked enabled: ready_del.checked
text: qsTr("delay (ms)") text: qsTr("Delay (ms)")
inputHint: qsTr("time") inputHint: qsTr("time")
inputMethodHints: Qt.ImhFormattedNumbersOnly inputMethodHints: Qt.ImhFormattedNumbersOnly
@ -312,7 +312,7 @@ Popup {
width: parent.width width: parent.width
height: options_stack.delegateHeight height: options_stack.delegateHeight
text: qsTr("say 'at your marks'") text: qsTr("Say 'at your marks'")
checked: autostart_col.loadSetting("at_marks_en", ready_del) === "true" checked: autostart_col.loadSetting("at_marks_en", ready_del) === "true"
@ -327,7 +327,7 @@ Popup {
width: parent.width width: parent.width
height: options_stack.delegateHeight height: options_stack.delegateHeight
text: qsTr("delay (ms)") text: qsTr("Delay (ms)")
inputHint: qsTr("time") inputHint: qsTr("time")
inputMethodHints: Qt.ImhFormattedNumbersOnly inputMethodHints: Qt.ImhFormattedNumbersOnly
@ -355,7 +355,7 @@ Popup {
ConnectionDelegate { ConnectionDelegate {
id: connectToBaseDel id: connectToBaseDel
text: status.status === "connected" ? qsTr("disconnect"): status.status === "disconnected" ? qsTr("connect"):qsTr("connecting...") text: status.status === "connected" ? qsTr("Disconnect"): status.status === "disconnected" ? qsTr("Connect"):qsTr("Connecting...")
status: { "status": speedBackend.baseStationState, "progress": 100 } status: { "status": speedBackend.baseStationState, "progress": 100 }
connect: speedBackend.connectBaseStation connect: speedBackend.connectBaseStation
@ -364,14 +364,88 @@ Popup {
width: parent.width width: parent.width
height: options_stack.delegateHeight height: options_stack.delegateHeight
font.pixelSize: height * 0.6
} }
Loader {
id: baseStationOptionsLd
property alias parentComp: connectCol
property alias baseConnected: connectCol.baseConnected
onBaseConnectedChanged: {
disappearAnim.start()
}
Component.onCompleted: {
baseStationOptionsLd.sourceComponent = connectCol.baseConnected ? baseStationConnectedOptionsComp : baseStationDisconnectedOptionsComp
item.opacity = 1
item.scale = 1
}
sourceComponent: null
ParallelAnimation {
id: disappearAnim
NumberAnimation {
property: "opacity"
to: 0
duration: 100
target: baseStationOptionsLd.item
}
NumberAnimation {
property: "scale"
to: 0.95
duration: 100
target: baseStationOptionsLd.item
}
onRunningChanged: {
if(!running) {
baseStationOptionsLd.sourceComponent = connectCol.baseConnected ? baseStationConnectedOptionsComp : baseStationDisconnectedOptionsComp
appearAnim.start()
}
}
}
ParallelAnimation {
id: appearAnim
NumberAnimation {
property: "opacity"
from: 0
to: 1
duration: 100
target: baseStationOptionsLd.item
}
NumberAnimation {
property: "scale"
from: 0.95
to: 1
duration: 100
target: baseStationOptionsLd.item
}
}
}
Component {
id: baseStationDisconnectedOptionsComp
Column {
id: baseStationDisconnectedOptions
width: parentComp.width
opacity: 0 // opacity and scale are adjusted by baseStationOptionsLd
scale: 0.95
InputDelegate { InputDelegate {
id: baseStationIpDel id: baseStationIpDel
text: qsTr("IP-Adress") text: qsTr("IP")
inputHint: "IP" inputHint: "IP"
inputText: speedBackend.readSetting("baseStationIpAdress") inputText: speedBackend.readSetting("baseStationIpAdress")
@ -383,7 +457,7 @@ Popup {
} }
width: parent.width width: parent.width
height: !connectCol.baseConnected ? options_stack.delegateHeight:0 height: options_stack.delegateHeight
visible: height > 5 visible: height > 5
@ -395,16 +469,40 @@ Popup {
} }
} }
SmoothSliderDelegate { SmoothItemDelegate {
id: baseStationVolumeDel id: baseStationHelpDel
text: qsTr("volume")
property bool active: connectCol.baseConnected
width: parent.width width: parent.width
height: active ? options_stack.delegateHeight:0 height: options_stack.delegateHeight
visible: height > 5 text: qsTr("What is this for?")
onClicked: {
Qt.openUrlExternally("https://itsblue.de/index.php/speed-climbing?ref=ScStwApp")
}
}
}
}
Component {
id: baseStationConnectedOptionsComp
Column {
id: baseStationConnectedOptions
width: parentComp.width
opacity: 0 // opacity and scale are adjusted by baseStationOptionsLd
scale: 0.95
SmoothSliderDelegate {
id: baseStationVolumeDel
text: qsTr("Volume")
width: parent.width
height: options_stack.delegateHeight
sliderValue: 0 sliderValue: 0
@ -412,16 +510,13 @@ Popup {
speedBackend.writeSetting("soundVolume", sliderValue) speedBackend.writeSetting("soundVolume", sliderValue)
} }
onActiveChanged: { Component.onCompleted: {
if(active){
var val = speedBackend.readSetting("soundVolume") var val = speedBackend.readSetting("soundVolume")
console.log(val) console.log(val)
if(val !== "false"){ if(val !== "false"){
sliderValue = parseFloat(val) sliderValue = parseFloat(val)
} }
} }
}
Behavior on height { Behavior on height {
NumberAnimation { NumberAnimation {
@ -433,10 +528,10 @@ Popup {
NextPageDelegate { NextPageDelegate {
id: baseStationConnectionsDel id: baseStationConnectionsDel
text: qsTr("connected extensions") text: qsTr("Connected extensions")
width: parent.width width: parent.width
height: connectCol.baseConnected ? options_stack.delegateHeight:0 height: options_stack.delegateHeight
visible: height > 5 visible: height > 5
@ -451,6 +546,9 @@ Popup {
} }
} }
} }
}
}
} }
} }

View file

@ -7,6 +7,8 @@ ItemDelegate {
property color textColor: appTheme.style.textColor property color textColor: appTheme.style.textColor
property alias backgroundRect: backgroundRect property alias backgroundRect: backgroundRect
font.pixelSize: height * 0.4
opacity: enabled ? 1 : 0.2 opacity: enabled ? 1 : 0.2
contentItem: Text { contentItem: Text {
@ -31,7 +33,7 @@ ItemDelegate {
fontSizeMode: Text.Fit fontSizeMode: Text.Fit
font.pixelSize: control.height * 0.4 font.pixelSize: control.font.pixelSize
minimumPixelSize: 1 minimumPixelSize: 1
} }

View file

@ -60,7 +60,7 @@ SwitchDelegate {
width: parent.height width: parent.height
height: parent.height height: parent.height
radius: height * 0.5 radius: height * 0.5
color: parent.down ? "#cccccc" : "#ffffff" color: parent.down ? appTheme.style.buttonPressedColor:appTheme.style.backgroundColor
border.color: parent.checked ? (parent.down ? "#17a81a" : "#21be2b") : "#999999" border.color: parent.checked ? (parent.down ? "#17a81a" : "#21be2b") : "#999999"
Behavior on x{ Behavior on x{
NumberAnimation { NumberAnimation {

View file

@ -188,8 +188,8 @@ Window {
height: parent.height height: parent.height
elide: "ElideRight" elide: "ElideRight"
color: speedBackend.timers[index]["state"] === "WON" ? appTheme.style.successColor : color: ["WON"].includes(speedBackend.timers[index]["state"]) ? appTheme.style.successColor :
speedBackend.timers[index]["state"] === "LOST" ? appTheme.style.errorColor: ["LOST", "FAILED"].includes(speedBackend.timers[index]["state"]) ? appTheme.style.errorColor:
appTheme.style.textColor appTheme.style.textColor
enabled: speedBackend.timers[index]["state"] !== "DISABLED" enabled: speedBackend.timers[index]["state"] !== "DISABLED"
@ -205,12 +205,12 @@ Window {
minimumPixelSize: 1 minimumPixelSize: 1
Behavior on text { /*Behavior on text {
enabled: app.state !== "RUNNING" && app.state !== "STOPPED" enabled: !["RUNNING", "STOPPED", "WON", "LOST", "FAILED", "CANCELLED"].includes(app.state)
FadeAnimation { FadeAnimation {
target: timerTextLa target: timerTextLa
} }
} }*/
} }
Label { Label {

View file

@ -24,8 +24,6 @@
<file>graphics/icons/startpad.png</file> <file>graphics/icons/startpad.png</file>
<file>graphics/icons/user_black.png</file> <file>graphics/icons/user_black.png</file>
<file>graphics/icons/ok.png</file> <file>graphics/icons/ok.png</file>
<file>sounds/IFSC_STARTSIGNAL_SAWTOOTH.wav</file>
<file>sounds/IFSC_STARTSIGNAL_SINE.wav</file> <file>sounds/IFSC_STARTSIGNAL_SINE.wav</file>
<file>sounds/IFSC_STARTSIGNAL_SQUARE.wav</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -7,7 +7,7 @@ AppTheme::AppTheme(QObject *parent) : QObject(parent)
{"backgroundColor", "#2d3037"}, {"backgroundColor", "#2d3037"},
{"buttonColor", "#202227"}, {"buttonColor", "#202227"},
{"buttonPressedColor", "#6ccaf2"}, {"buttonPressedColor", "#41454f"},
{"buttonBorderColor", "grey"}, {"buttonBorderColor", "grey"},
{"disabledButtonColor", "#555555"}, {"disabledButtonColor", "#555555"},