dan
/
ui
forked from cwtch.im/ui
1
0
Fork 0

make contact badge just be green/online, and move unread messages to right side of row

02-contacts
Dan Ballard 2 years ago
parent 31abd0020e
commit c580597c8d
  1. 36
      qml/widgets/ContactRow.qml

@ -11,26 +11,18 @@ import "../opaque" as Opaque
import "../opaque/styles"
import "../opaque/theme"
import "../const"
import "../utils.js" as Utils
Opaque.PortraitRow {
property int status: 0
property int status: Const.state_disconnected
property int badge
property bool loading
property string authorization
// TODO: should be in ContactRow
property bool blocked
badgeColor: Theme.portraitContactBadgeColor
badgeVisible: badge > 0
badgeContent: Label {
id: lblUnread
color: Theme.portraitContactBadgeTextColor
font.pixelSize: Theme.badgeTextSize * gcd.themeScale
font.weight: Font.Bold
text: badge > 99 ? "99+" : badge
}
badgeColor: Theme.portraitOnlineBadgeColor
badgeVisible: (Utils.isGroup(handle) && status == Const.state_synced) || (Utils.isPeer(handle) && status == Const.state_authenticated)
ProgressBar { // LOADING ?
id: loadingProgress
@ -53,6 +45,26 @@ Opaque.PortraitRow {
}
}
Opaque.Badge {
id: unreadBadge
visible: badge > 0
color: Theme.portraitContactBadgeColor
size: parent.height/4
anchors.right: parent.right
anchors.rightMargin: 25 * gcd.themeScale
anchors.leftMargin: 1 * gcd.themeScale
anchors.verticalCenter: parent.verticalCenter
content: Label {
id: lblUnread
color: Theme.portraitContactBadgeTextColor
font.pixelSize: Theme.badgeTextSize * gcd.themeScale
font.weight: Font.Bold
text: badge > 99 ? "99+" : badge
}
}
Column {
visible: authorization == Const.auth_unknown
anchors.right: parent.right

Loading…
Cancel
Save