Skip to content
Snippets Groups Projects
Commit 4aef4a69 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

conference: avoid excessive image caching during resize events

Throttle avatar image queries to the image provider when the
component size changes.

Gitlab: #466
Change-Id: Ie619671a593bcca75899f3d97c2af2071c427ab4
parent 92a3d032
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ Item {
enum Mode { Account, Contact, Conversation }
property int mode: Avatar.Mode.Account
property alias sourceSize: image.sourceSize
property string imageId
......
......@@ -171,8 +171,15 @@ Item {
id: avatar
anchors.centerIn: parent
height: Math.min(parent.width / 2, parent.height / 2)
width: Math.min(parent.width / 2, parent.height / 2)
property real size: Math.min(parent.width / 2, parent.height / 2)
height: size
width: size
// round the avatar source size up to some nearest multiple
readonly property real step: 96
property real imageSize: Math.floor((size + step - 1) / step) * step
sourceSize: Qt.size(imageSize, imageSize)
visible: false
showPresenceIndicator: false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment