- 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
text: qsTr("start sequence")
text: qsTr("Start sequence")
onClicked: {
options_stack.push(autostart)
@ -239,7 +239,7 @@ Popup {
/*----Style Settings----*/
SmoothSwitchDelegate {
id: styleDel
text: qsTr("dark mode")
text: qsTr("Dark mode")
width: parent.width
height: options_stack.delegateHeight
@ -278,7 +278,7 @@ Popup {
width: parent.width
height: options_stack.delegateHeight
text: qsTr("say 'ready'")
text: qsTr("Say 'ready'")
checked: parent.loadSetting("ready_en", ready_del) === "true"
@ -295,7 +295,7 @@ Popup {
enabled: ready_del.checked
text: qsTr("delay (ms)")
text: qsTr("Delay (ms)")
inputHint: qsTr("time")
inputMethodHints: Qt.ImhFormattedNumbersOnly
@ -312,7 +312,7 @@ Popup {
width: parent.width
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"
@ -327,7 +327,7 @@ Popup {
width: parent.width
height: options_stack.delegateHeight
text: qsTr("delay (ms)")
text: qsTr("Delay (ms)")
inputHint: qsTr("time")
inputMethodHints: Qt.ImhFormattedNumbersOnly
@ -355,7 +355,7 @@ Popup {
ConnectionDelegate {
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 }
connect: speedBackend.connectBaseStation
@ -364,91 +364,189 @@ Popup {
width: parent.width
height: options_stack.delegateHeight
font.pixelSize: height * 0.6
}
InputDelegate {
id: baseStationIpDel
Loader {
id: baseStationOptionsLd
text: qsTr("IP-Adress")
property alias parentComp: connectCol
property alias baseConnected: connectCol.baseConnected
inputHint: "IP"
inputText: speedBackend.readSetting("baseStationIpAdress")
inputTextFieldWidth: width * 0.7
onInputTextChanged: {
speedBackend.writeSetting("baseStationIpAdress", inputText)
speedBackend.reloadBaseStationIpAdress()
onBaseConnectedChanged: {
disappearAnim.start()
}
width: parent.width
height: !connectCol.baseConnected ? options_stack.delegateHeight:0
Component.onCompleted: {
baseStationOptionsLd.sourceComponent = connectCol.baseConnected ? baseStationConnectedOptionsComp : baseStationDisconnectedOptionsComp
item.opacity = 1
item.scale = 1
}
visible: height > 5
sourceComponent: null
ParallelAnimation {
id: disappearAnim
Behavior on height {
NumberAnimation {
duration: 400
easing.type: Easing.Linear
property: "opacity"
to: 0
duration: 100
target: baseStationOptionsLd.item
}
}
}
SmoothSliderDelegate {
id: baseStationVolumeDel
text: qsTr("volume")
NumberAnimation {
property: "scale"
to: 0.95
duration: 100
target: baseStationOptionsLd.item
}
property bool active: connectCol.baseConnected
width: parent.width
height: active ? options_stack.delegateHeight:0
visible: height > 5
sliderValue: 0
onSliderFinished: {
speedBackend.writeSetting("soundVolume", sliderValue)
}
onActiveChanged: {
if(active){
var val = speedBackend.readSetting("soundVolume")
console.log(val)
if(val !== "false"){
sliderValue = parseFloat(val)
onRunningChanged: {
if(!running) {
baseStationOptionsLd.sourceComponent = connectCol.baseConnected ? baseStationConnectedOptionsComp : baseStationDisconnectedOptionsComp
appearAnim.start()
}
}
}
Behavior on height {
ParallelAnimation {
id: appearAnim
NumberAnimation {
duration: 400
easing.type: Easing.Linear
property: "opacity"
from: 0
to: 1
duration: 100
target: baseStationOptionsLd.item
}
NumberAnimation {
property: "scale"
from: 0.95
to: 1
duration: 100
target: baseStationOptionsLd.item
}
}
}
NextPageDelegate {
id: baseStationConnectionsDel
text: qsTr("connected extensions")
Component {
id: baseStationDisconnectedOptionsComp
width: parent.width
height: connectCol.baseConnected ? options_stack.delegateHeight:0
Column {
id: baseStationDisconnectedOptions
visible: height > 5
width: parentComp.width
opacity: 0 // opacity and scale are adjusted by baseStationOptionsLd
scale: 0.95
InputDelegate {
id: baseStationIpDel
text: qsTr("IP")
inputHint: "IP"
inputText: speedBackend.readSetting("baseStationIpAdress")
inputTextFieldWidth: width * 0.7
onInputTextChanged: {
speedBackend.writeSetting("baseStationIpAdress", inputText)
speedBackend.reloadBaseStationIpAdress()
}
width: parent.width
height: options_stack.delegateHeight
visible: height > 5
Behavior on height {
NumberAnimation {
duration: 400
easing.type: Easing.Linear
}
}
}
SmoothItemDelegate {
id: baseStationHelpDel
width: parent.width
height: options_stack.delegateHeight
text: qsTr("What is this for?")
onClicked: {
Qt.openUrlExternally("https://itsblue.de/index.php/speed-climbing?ref=ScStwApp")
}
}
onClicked: {
options_stack.push(baseStationConnections)
}
Behavior on height {
NumberAnimation {
duration: 400
easing.type: Easing.Linear
}
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
onSliderFinished: {
speedBackend.writeSetting("soundVolume", sliderValue)
}
Component.onCompleted: {
var val = speedBackend.readSetting("soundVolume")
console.log(val)
if(val !== "false"){
sliderValue = parseFloat(val)
}
}
Behavior on height {
NumberAnimation {
duration: 400
easing.type: Easing.Linear
}
}
}
NextPageDelegate {
id: baseStationConnectionsDel
text: qsTr("Connected extensions")
width: parent.width
height: options_stack.delegateHeight
visible: height > 5
onClicked: {
options_stack.push(baseStationConnections)
}
Behavior on height {
NumberAnimation {
duration: 400
easing.type: Easing.Linear
}
}
}
}
}
}

View file

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

View file

@ -60,7 +60,7 @@ SwitchDelegate {
width: parent.height
height: parent.height
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"
Behavior on x{
NumberAnimation {

View file

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

View file

@ -24,8 +24,6 @@
<file>graphics/icons/startpad.png</file>
<file>graphics/icons/user_black.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_SQUARE.wav</file>
</qresource>
</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"},
{"buttonColor", "#202227"},
{"buttonPressedColor", "#6ccaf2"},
{"buttonPressedColor", "#41454f"},
{"buttonBorderColor", "grey"},
{"disabledButtonColor", "#555555"},