mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-29 04:14:52 +03:00
Move out timer bar
This commit is contained in:
parent
0a9df2be40
commit
f9dd88eb3c
32
qml/Main.qml
32
qml/Main.qml
@ -16,7 +16,7 @@ ApplicationWindow {
|
||||
property var device: yk
|
||||
property var credentials: device.credentials
|
||||
property bool hasDevice: device.hasDevice
|
||||
property bool canShowCredentials: device.hasDevice && modeAndKeyMatch
|
||||
property bool canShowCredentials: device.hasDevice && modeAndKeyMatch && device.validated
|
||||
property bool modeAndKeyMatch: slotModeMatch || ccidModeMatch
|
||||
property bool slotModeMatch: (settings.slotMode && device.hasOTP)
|
||||
property bool ccidModeMatch: (!settings.slotMode && device.hasCCID)
|
||||
@ -161,32 +161,12 @@ ApplicationWindow {
|
||||
credRepeater: repeater
|
||||
}
|
||||
|
||||
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
ProgressBar {
|
||||
id: progressBar
|
||||
visible: canShowCredentials
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||
Layout.maximumHeight: 10
|
||||
Layout.minimumHeight: 10
|
||||
Layout.minimumWidth: 300
|
||||
Layout.fillWidth: true
|
||||
maximumValue: 30
|
||||
minimumValue: 0
|
||||
|
||||
style: ProgressBarStyle {
|
||||
progress: Rectangle {
|
||||
color: "#9aca3c"
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: palette.alternateBase
|
||||
}
|
||||
}
|
||||
TimeLeftBar {
|
||||
id: timeLeftBar
|
||||
shouldBeVisible: canShowCredentials
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
@ -307,10 +287,10 @@ ApplicationWindow {
|
||||
triggeredOnStart: true
|
||||
onTriggered: {
|
||||
var timeLeft = device.expiration - (Date.now() / 1000)
|
||||
if (timeLeft <= 0 && progressBar.value > 0) {
|
||||
if (timeLeft <= 0 && timeLeftBar.value > 0) {
|
||||
refreshDependingOnMode(true)
|
||||
}
|
||||
progressBar.value = timeLeft
|
||||
timeLeftBar.value = timeLeft
|
||||
}
|
||||
}
|
||||
|
||||
|
28
qml/TimeLeftBar.qml
Normal file
28
qml/TimeLeftBar.qml
Normal file
@ -0,0 +1,28 @@
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
ProgressBar {
|
||||
|
||||
property bool shouldBeVisible
|
||||
|
||||
visible: shouldBeVisible
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||
Layout.maximumHeight: 10
|
||||
Layout.minimumHeight: 10
|
||||
Layout.minimumWidth: 300
|
||||
Layout.fillWidth: true
|
||||
maximumValue: 30
|
||||
minimumValue: 0
|
||||
|
||||
style: ProgressBarStyle {
|
||||
progress: Rectangle {
|
||||
color: "#9aca3c"
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: palette.alternateBase
|
||||
}
|
||||
}
|
||||
}
|
@ -50,6 +50,7 @@ Python {
|
||||
onHasDeviceChanged: {
|
||||
device.passwordKey = null
|
||||
device.validated = false
|
||||
device.expiration = 0
|
||||
}
|
||||
|
||||
onError: {
|
||||
|
Loading…
Reference in New Issue
Block a user