Put an action behind new message count circle, fixes #13

This commit is contained in:
Sebastian J. Wolf 2020-09-22 19:26:49 +02:00
parent 266dd12570
commit ea123b08ea
2 changed files with 27 additions and 17 deletions

View file

@ -48,6 +48,7 @@ Item {
if (typeof photoData === "object") {
if (photoData.local.is_downloading_completed) {
profileImageLoader.active = true;
replacementThumbnailItem.visible = false;
} else {
tdLibWrapper.downloadFile(photoData.id);
}
@ -83,6 +84,7 @@ Item {
if (fileInformation.local.is_downloading_completed) {
photoData = fileInformation;
profileImageLoader.active = true;
replacementThumbnailItem.visible = false;
}
}
}
@ -144,8 +146,7 @@ Item {
id: replacementThumbnailItem
width: parent.width - Theme.paddingSmall
height: parent.height - Theme.paddingSmall
//visible: singleImage.status !== Image.Ready
visible: !profileImageLoader.active
visible: true
Rectangle {
id: replacementThumbnailBackground

View file

@ -731,29 +731,38 @@ Page {
}
}
Rectangle {
id: chatUnreadMessagesCountBackground
color: Theme.highlightBackgroundColor
Item {
id: chatUnreadMessagesItem
width: Theme.fontSizeHuge
height: Theme.fontSizeHuge
anchors.right: parent.right
anchors.rightMargin: Theme.paddingMedium
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.paddingMedium
radius: width / 2
visible: !chatPage.loading && chatInformation.unread_count > 0
}
Rectangle {
id: chatUnreadMessagesCountBackground
color: Theme.highlightBackgroundColor
anchors.fill: parent
radius: width / 2
visible: !chatPage.loading && chatInformation.unread_count > 0
}
Text {
id: chatUnreadMessagesCount
font.pixelSize: Theme.fontSizeMedium
font.bold: true
color: Theme.primaryColor
anchors.centerIn: chatUnreadMessagesCountBackground
visible: chatUnreadMessagesCountBackground.visible
text: chatInformation.unread_count > 99 ? "99+" : chatInformation.unread_count
Text {
id: chatUnreadMessagesCount
font.pixelSize: Theme.fontSizeMedium
font.bold: true
color: Theme.primaryColor
anchors.centerIn: chatUnreadMessagesCountBackground
visible: chatUnreadMessagesCountBackground.visible
text: chatInformation.unread_count > 99 ? "99+" : chatInformation.unread_count
}
MouseArea {
anchors.fill: parent
onClicked: {
chatView.positionViewAtIndex(chatView.count - 1 - chatInformation.unread_count, ListView.Beginning);
}
}
}
}
Column {