userWidget: Always set actor size inside update()

We also want to ensure the Avatar StBin is sized correctly when an icon
child is used, so always set the actor size inside the `update()`
function.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1018
This commit is contained in:
Jonas Dreßler 2020-02-16 23:16:52 +01:00 committed by Florian Müllner
parent 38b38732d3
commit 2a3875775d

View File

@ -83,13 +83,13 @@ class Avatar extends St.Bin {
iconFile = null;
}
let { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
this.set_size(
this._iconSize * scaleFactor,
this._iconSize * scaleFactor);
if (iconFile) {
this.child = null;
let { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
this.set_size(
this._iconSize * scaleFactor,
this._iconSize * scaleFactor);
this.style = `
background-image: url("${iconFile}");
background-size: cover;`;