Merge pull request 'WIP 02-contacts' (#323) from dan/ui:02-contacts into master
the build was successful
Details
the build was successful
Details
Reviewed-on: #323
This commit is contained in:
commit
a814dee7af
|
@ -11,26 +11,18 @@ import "../opaque" as Opaque
|
||||||
import "../opaque/styles"
|
import "../opaque/styles"
|
||||||
import "../opaque/theme"
|
import "../opaque/theme"
|
||||||
import "../const"
|
import "../const"
|
||||||
|
import "../utils.js" as Utils
|
||||||
|
|
||||||
Opaque.PortraitRow {
|
Opaque.PortraitRow {
|
||||||
property int status: 0
|
property int status: Const.state_disconnected
|
||||||
property int badge
|
property int badge
|
||||||
property bool loading
|
property bool loading
|
||||||
property string authorization
|
property string authorization
|
||||||
|
|
||||||
// TODO: should be in ContactRow
|
|
||||||
property bool blocked
|
property bool blocked
|
||||||
|
|
||||||
badgeColor: Theme.portraitContactBadgeColor
|
badgeColor: Theme.portraitOnlineBadgeColor
|
||||||
badgeVisible: badge > 0
|
badgeVisible: (Utils.isGroup(handle) && status == Const.state_synced) || (Utils.isPeer(handle) && status == Const.state_authenticated)
|
||||||
|
|
||||||
badgeContent: Label {
|
|
||||||
id: lblUnread
|
|
||||||
color: Theme.portraitContactBadgeTextColor
|
|
||||||
font.pixelSize: Theme.badgeTextSize * gcd.themeScale
|
|
||||||
font.weight: Font.Bold
|
|
||||||
text: badge > 99 ? "99+" : badge
|
|
||||||
}
|
|
||||||
|
|
||||||
ProgressBar { // LOADING ?
|
ProgressBar { // LOADING ?
|
||||||
id: loadingProgress
|
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 {
|
Column {
|
||||||
visible: authorization == Const.auth_unknown
|
visible: authorization == Const.auth_unknown
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
Reference in New Issue