[gnome-shell/wip/fmuellner/scale-avatars] userWidget: Fix avatar size
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/scale-avatars] userWidget: Fix avatar size
- Date: Thu, 7 Mar 2019 13:42:11 +0000 (UTC)
commit e08817af4eab87066512b3e7f55f19f017097e80
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Mar 7 13:39:17 2019 +0100
userWidget: Fix avatar size
The texture cache now returns an actor with an appropriate ClutterContent
rather than a ClutterTexture. That actor uses the CONTENT_SIZE request
mode, which means that it will unconditionally request the preferred size
of the content. That is, setting an explicit size no longer has an effect.
Fix this by making sure the image is already loaded with the desired
dimensions.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1024
js/ui/userWidget.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/userWidget.js b/js/ui/userWidget.js
index a3bf4cba1..a3d9985f6 100644
--- a/js/ui/userWidget.js
+++ b/js/ui/userWidget.js
@@ -46,15 +46,15 @@ var Avatar = class {
if (iconFile) {
let file = Gio.File.new_for_path(iconFile);
this.actor.child = null;
- this.actor.style = 'background-image: url("%s");'.format(iconFile);
+ this.actor.style = `
+ background-image: url("${iconFile}");
+ width: ${this._iconSize}px;
+ height: ${this._iconSize}px;`;
} else {
this.actor.style = null;
this.actor.child = new St.Icon({ icon_name: 'avatar-default-symbolic',
icon_size: this._iconSize });
}
-
- let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
- this.actor.set_size(this._iconSize * scaleFactor, this._iconSize * scaleFactor);
}
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]