diff options
| author | Mihai Moldovan <ionic@ionic.de> | 2023-09-18 19:00:31 +0200 |
|---|---|---|
| committer | Mihai Moldovan <ionic@ionic.de> | 2023-09-18 19:00:31 +0200 |
| commit | 264b8a7cde8a728f154f72233e676dafeaac55cb (patch) | |
| tree | 493fac540b6b16f07a4f0ff9584f8a73f790e182 /src/background.vala | |
| parent | 233d577f4b25d77260925b827ff20ded73af7b61 (diff) | |
| parent | d99c415c172c03d5b09b3a4b4ecae9d6a992bbb1 (diff) | |
| download | arctica-greeter-264b8a7cde8a728f154f72233e676dafeaac55cb.tar.gz arctica-greeter-264b8a7cde8a728f154f72233e676dafeaac55cb.tar.bz2 arctica-greeter-264b8a7cde8a728f154f72233e676dafeaac55cb.zip | |
Merge branch 'sunweaver-mr/highcontrast-background-color'
Attributes GH PR #71: https://github.com/ArcticaProject/arctica-greeter/pull/71
Diffstat (limited to 'src/background.vala')
| -rw-r--r-- | src/background.vala | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/background.vala b/src/background.vala index 70813ea..75ed517 100644 --- a/src/background.vala +++ b/src/background.vala @@ -421,6 +421,25 @@ public class Background : Gtk.Fixed } } + private string _highcontrast_bgcolor = null; + public string highcontrast_bgcolor { + get { + if (_highcontrast_bgcolor == null) + { + var settings_bgcolor = AGSettings.get_string (AGSettings.KEY_HIGH_CONTRAST_BACKGROUND_COLOR); + var color = Gdk.RGBA (); + + if (settings_bgcolor == "" || !color.parse (settings_bgcolor)) + { + settings_bgcolor = "#000000"; + } + + _highcontrast_bgcolor = settings_bgcolor; + } + return _highcontrast_bgcolor; + } + } + private string _system_background; public string? system_background { get { @@ -457,14 +476,19 @@ public class Background : Gtk.Fixed } set { + var pretty_value = ""; + if (value == null || value == "") { _current_background = system_background; + pretty_value = "<system default bg image> "; } else { _current_background = value; } + pretty_value += _current_background; + debug ("Background change requested, changing to: %s", pretty_value); reload (); } } @@ -658,7 +682,8 @@ public class Background : Gtk.Fixed c.restore (); - if (DrawFlags.GRID in flags) + var agsettings = new AGSettings(); + if ((DrawFlags.GRID in flags) && (!agsettings.high_contrast)) overlay_grid (c); } @@ -722,7 +747,12 @@ public class Background : Gtk.Fixed private BackgroundLoader load_background (string? filename) { - if (filename == null) + var agsettings = new AGSettings (); + if (agsettings.high_contrast) + { + filename = highcontrast_bgcolor; + } + else if (filename == null) { filename = fallback_bgcolor; } else |
