loginDialog: Load logo file texture given resource scale

And reload the logo if the resource scale changes.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
This commit is contained in:
Marco Trevisan (Treviño) 2017-11-30 02:34:42 +01:00 committed by Jonas Ådahl
parent 2bda79cb3a
commit 26e3ccda49

View File

@ -481,6 +481,9 @@ var LoginDialog = GObject.registerClass({
this._logoBin = new St.Widget({ style_class: 'login-dialog-logo-bin',
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.END });
this._logoBin.connect('resource-scale-changed', () => {
this._updateLogoTexture(this._textureCache, this._logoFile);
});
this.add_child(this._logoBin);
this._updateLogo();
@ -778,12 +781,12 @@ var LoginDialog = GObject.registerClass({
return;
this._logoBin.destroy_all_children();
if (this._logoFile) {
if (this._logoFile && this._logoBin.resource_scale > 0) {
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile,
-1, _LOGO_ICON_HEIGHT,
scaleFactor,
1));
this._logoBin.resource_scale));
}
}