2020-05-01 18:35:54 +10:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import "../Base"
|
|
|
|
|
|
|
|
HLabel {
|
2020-05-20 09:48:52 +10:00
|
|
|
text:
|
|
|
|
unreads >= 1000000 ? Math.floor(unreads / 1000000) + "M" :
|
|
|
|
unreads >= 1000 ? Math.floor(unreads / 1000) + "K" :
|
2020-06-26 19:43:49 +10:00
|
|
|
unreads ? unreads :
|
|
|
|
localUnreads ? "!" :
|
|
|
|
""
|
2020-05-20 09:48:52 +10:00
|
|
|
|
2020-05-01 18:35:54 +10:00
|
|
|
font.pixelSize: theme.fontSize.small
|
2020-06-26 19:43:49 +10:00
|
|
|
font.bold: text === "!"
|
2020-05-01 18:35:54 +10:00
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
leftPadding: theme.spacing / 4
|
|
|
|
rightPadding: leftPadding
|
|
|
|
|
2020-06-26 19:43:49 +10:00
|
|
|
scale: text ? 1 : 0
|
|
|
|
visible: text !== ""
|
2020-05-01 18:35:54 +10:00
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color:
|
2020-06-01 09:13:19 +10:00
|
|
|
highlights ?
|
2020-05-01 18:35:54 +10:00
|
|
|
indicatorTheme.mentionBackground :
|
|
|
|
indicatorTheme.background
|
|
|
|
|
|
|
|
radius: theme.radius / 4
|
|
|
|
|
|
|
|
Behavior on color { HColorAnimation {} }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
property QtObject indicatorTheme
|
|
|
|
property int unreads: 0
|
2020-06-01 09:13:19 +10:00
|
|
|
property int highlights: 0
|
2020-06-26 19:43:49 +10:00
|
|
|
property bool localUnreads: false
|
2020-05-01 18:35:54 +10:00
|
|
|
|
|
|
|
|
|
|
|
Behavior on scale { HNumberAnimation {} }
|
|
|
|
}
|