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

View file

@ -731,29 +731,38 @@ Page {
} }
} }
Rectangle { Item {
id: chatUnreadMessagesCountBackground id: chatUnreadMessagesItem
color: Theme.highlightBackgroundColor
width: Theme.fontSizeHuge width: Theme.fontSizeHuge
height: Theme.fontSizeHuge height: Theme.fontSizeHuge
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: Theme.paddingMedium anchors.rightMargin: Theme.paddingMedium
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.paddingMedium anchors.bottomMargin: Theme.paddingMedium
radius: width / 2 Rectangle {
visible: !chatPage.loading && chatInformation.unread_count > 0 id: chatUnreadMessagesCountBackground
} color: Theme.highlightBackgroundColor
anchors.fill: parent
radius: width / 2
visible: !chatPage.loading && chatInformation.unread_count > 0
}
Text { Text {
id: chatUnreadMessagesCount id: chatUnreadMessagesCount
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
font.bold: true font.bold: true
color: Theme.primaryColor color: Theme.primaryColor
anchors.centerIn: chatUnreadMessagesCountBackground anchors.centerIn: chatUnreadMessagesCountBackground
visible: chatUnreadMessagesCountBackground.visible visible: chatUnreadMessagesCountBackground.visible
text: chatInformation.unread_count > 99 ? "99+" : chatInformation.unread_count 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 { Column {