Dedicated MessageIndicator.qml (unread/mentions)
This commit is contained in:
parent
c352275089
commit
9ebd8644c8
1
TODO.md
1
TODO.md
|
@ -8,6 +8,7 @@
|
||||||
- fix message delegate too tall
|
- fix message delegate too tall
|
||||||
- fix left rooms opacity
|
- fix left rooms opacity
|
||||||
- fix escape keybinds (filter rooms, message selection)
|
- fix escape keybinds (filter rooms, message selection)
|
||||||
|
- fix nio 429
|
||||||
|
|
||||||
- lag when switching accounts
|
- lag when switching accounts
|
||||||
- update glass theme
|
- update glass theme
|
||||||
|
|
35
src/gui/MainPane/MessageIndicator.qml
Normal file
35
src/gui/MainPane/MessageIndicator.qml
Normal 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 {} }
|
||||||
|
}
|
|
@ -36,31 +36,11 @@ HTileDelegate {
|
||||||
color: theme.accountView.roomList.room.name
|
color: theme.accountView.roomList.room.name
|
||||||
}
|
}
|
||||||
|
|
||||||
HLabel {
|
MessageIndicator {
|
||||||
text: model.unreads
|
indicatorTheme:
|
||||||
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:
|
|
||||||
theme.accountView.roomList.room.unreadIndicator
|
theme.accountView.roomList.room.unreadIndicator
|
||||||
|
unreads: model.unreads
|
||||||
Behavior on color { HColorAnimation {} }
|
mentions: model.mentions
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on scale { HNumberAnimation {} }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HIcon {
|
HIcon {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user