Fix changes requested (#101)
- Fix code formatting issues. - Document `Presence`. - Improve `Presence.__lt__()` performance by defining a dict outside the method. - Make presence ball radius relative to uiScale and configurable from theme.
This commit is contained in:
@@ -43,26 +43,9 @@ HTile {
|
||||
}
|
||||
|
||||
TitleRightInfoLabel {
|
||||
id: lastActiveAt
|
||||
tile: member
|
||||
visible: presenceTimer.running
|
||||
|
||||
Timer {
|
||||
id: presenceTimer
|
||||
running:
|
||||
! model.currently_active &&
|
||||
model.last_active_at > new Date(1)
|
||||
repeat: true
|
||||
interval:
|
||||
new Date() - model.last_active_at < 60000 ?
|
||||
10000 :
|
||||
60000
|
||||
triggeredOnStart: true
|
||||
onTriggered: parent.text = Qt.binding(() =>
|
||||
utils.formatRelativeTime(
|
||||
new Date() - model.last_active_at
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +67,20 @@ HTile {
|
||||
""
|
||||
)
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: presenceTimer
|
||||
running:
|
||||
! model.currently_active &&
|
||||
model.last_active_at > new Date(1)
|
||||
repeat: true
|
||||
interval:
|
||||
new Date() - model.last_active_at < 60000 ? 10000 : 60000
|
||||
triggeredOnStart: true
|
||||
onTriggered: lastActiveAt.text = Qt.binding(() =>
|
||||
utils.formatRelativeTime(new Date() - model.last_active_at)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user