Dedicated MessageIndicator.qml (unread/mentions)

This commit is contained in:
miruka 2020-05-01 04:35:54 -04:00
parent c352275089
commit 9ebd8644c8
3 changed files with 41 additions and 25 deletions

View File

@ -8,6 +8,7 @@
- fix message delegate too tall
- fix left rooms opacity
- fix escape keybinds (filter rooms, message selection)
- fix nio 429
- lag when switching accounts
- update glass theme

View File

@ -0,0 +1,35 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import "../Base"
HLabel {
text: unreads
font.pixelSize: theme.fontSize.small
verticalAlignment: Qt.AlignVCenter
leftPadding: theme.spacing / 4
rightPadding: leftPadding
scale: unreads === 0 ? 0 : 1
visible: unreads !== 0
background: Rectangle {
color:
mentions ?
indicatorTheme.mentionBackground :
indicatorTheme.background
radius: theme.radius / 4
Behavior on color { HColorAnimation {} }
}
property QtObject indicatorTheme
property int unreads: 0
property int mentions: 0
Behavior on scale { HNumberAnimation {} }
}

View File

@ -36,31 +36,11 @@ HTileDelegate {
color: theme.accountView.roomList.room.name
}
HLabel {
text: model.unreads
font.pixelSize: theme.fontSize.small
verticalAlignment: Qt.AlignVCenter
leftPadding: theme.spacing / 4
rightPadding: leftPadding
scale: model.unreads === 0 ? 0 : 1
visible: model.unreads !== 0
background: Rectangle {
color:
model.mentions ?
indicatorTheme.mentionBackground :
indicatorTheme.background
radius: theme.radius / 4
readonly property QtObject indicatorTheme:
MessageIndicator {
indicatorTheme:
theme.accountView.roomList.room.unreadIndicator
Behavior on color { HColorAnimation {} }
}
Behavior on scale { HNumberAnimation {} }
unreads: model.unreads
mentions: model.mentions
}
HIcon {