Merge pull request 'WIP 02-contacts' (#323) from dan/ui:02-contacts into master
the build was successful Details

Reviewed-on: #323
This commit is contained in:
erinn 2020-09-17 15:24:10 -07:00
commit a814dee7af
1 changed files with 24 additions and 12 deletions

View File

@ -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