Multitasking view: Ajust window icon on scaling factor change

This commit is contained in:
José Expósito 2021-06-10 08:39:08 +02:00 committed by Cassidy James Blaede
parent 4be64574c0
commit c0506cb99b

View File

@ -883,14 +883,16 @@ namespace Gala {
private void set_window_icon_position (float window_width, float window_height, bool aligned = true) { private void set_window_icon_position (float window_width, float window_height, bool aligned = true) {
var scale_factor = InternalUtils.get_ui_scaling_factor (); var scale_factor = InternalUtils.get_ui_scaling_factor ();
var x = (window_width - WINDOW_ICON_SIZE) / 2; var size = WINDOW_ICON_SIZE * scale_factor;
var y = window_height - (WINDOW_ICON_SIZE * scale_factor) * 0.75f; var x = (window_width - size) / 2;
var y = window_height - (size * 0.75f);
if (aligned) { if (aligned) {
x = InternalUtils.pixel_align (x); x = InternalUtils.pixel_align (x);
y = InternalUtils.pixel_align (y); y = InternalUtils.pixel_align (y);
} }
window_icon.set_size (size, size);
window_icon.set_position (x, y); window_icon.set_position (x, y);
} }