Use signal instead of implicit inheritance to refresh CredentialItem

This commit is contained in:
Emil Lundberg 2017-11-21 15:55:51 +01:00
parent b01180827e
commit c41e104dc7
No known key found for this signature in database
GPG Key ID: 5B9688125FF0B636
2 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@ Rectangle {
signal singleClick(var mouse, var entry)
signal doubleClick(var mouse, var entry)
signal refresh(bool force)
color: getCredentialColor(index, model)
Layout.minimumHeight: {
@ -66,7 +67,7 @@ Rectangle {
var timeLeft = model.code.valid_to - (Date.now() / 1000)
if (timeLeft <= 0
&& customTimeLeftBar.value > 0) {
refreshDependingOnMode(true)
refresh(true)
}
customTimeLeftBar.value = timeLeft
}

View File

@ -290,6 +290,8 @@ ApplicationWindow {
generateOrCopy()
}
onRefresh: refreshDependingOnMode(force)
onSingleClick: {
arrowKeys.forceActiveFocus()