diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-10-05 18:00:21 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-10-05 18:00:21 +0200 |
commit | 7bbd070a7dfc107317f3dec43e222a74cb4e1bdc (patch) | |
tree | 2f46e81891fe4e17eadb75a62880f3ae6cf96994 /src | |
parent | 23a2bd20924f785e4f0af6e43de1ceb4d460f330 (diff) | |
download | arctica-greeter-7bbd070a7dfc107317f3dec43e222a74cb4e1bdc.tar.gz arctica-greeter-7bbd070a7dfc107317f3dec43e222a74cb4e1bdc.tar.bz2 arctica-greeter-7bbd070a7dfc107317f3dec43e222a74cb4e1bdc.zip |
src/background.vala: better positioning of logo, make the positioning independent of logo height (i.e., adjust the position to the logo height).
This introduces BackgroundLoader.logo_width and .logo_height. We
currently only use .logo_height for now. But having both geometry values
available might be helpful at a later time. And it feels incomplete to
only pass-through the height.
Diffstat (limited to 'src')
-rw-r--r-- | src/background.vala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/background.vala b/src/background.vala index 75ed517..65a3365 100644 --- a/src/background.vala +++ b/src/background.vala @@ -24,6 +24,8 @@ class BackgroundLoader : Object { public string filename { get; private set; } public Cairo.Surface logo { get; set; } + public int logo_width; + public int logo_height; public int[] widths; public int[] heights; @@ -204,8 +206,8 @@ class BackgroundLoader : Object if (logo != null) { bc.save (); - var x = (int) grid_x_offset + 1.5 * grid_size; - var y = (int) (image.height / grid_size - 2) * grid_size + grid_y_offset; + var x = (int) (grid_x_offset + 1.1 * grid_size); + var y = (int) (image.height - 1.1 * grid_size - logo_height + grid_y_offset); bc.translate (x, y); bc.set_source_surface (logo, 0, 0); bc.paint_with_alpha (AGSettings.get_double (AGSettings.KEY_LOGO_ALPHA)); @@ -803,6 +805,8 @@ public class Background : Gtk.Fixed b = new BackgroundLoader (target_surface, filename, widths, heights); b.logo = version_logo_surface; + b.logo_width = version_logo_width; + b.logo_height = version_logo_height; b.loaded.connect (() => { reload (); }); b.load (); loaders.insert (filename, b); |