diff options
-rw-r--r-- | data/org.ArcticaProject.arctica-greeter.gschema.xml | 4 | ||||
-rw-r--r-- | src/background.vala | 26 | ||||
-rw-r--r-- | src/settings.vala | 1 |
3 files changed, 30 insertions, 1 deletions
diff --git a/data/org.ArcticaProject.arctica-greeter.gschema.xml b/data/org.ArcticaProject.arctica-greeter.gschema.xml index d3eb5c5..b8085af 100644 --- a/data/org.ArcticaProject.arctica-greeter.gschema.xml +++ b/data/org.ArcticaProject.arctica-greeter.gschema.xml @@ -9,6 +9,10 @@ <default>'#4B1635'</default> <summary>Background color (e.g. #772953), set before wallpaper is seen</summary> </key> + <key name="high-contrast-background-color" type="s"> + <default>'#000000'</default> + <summary>Background color (e.g. #000000 or #FFFFFF) for high contrast mode</summary> + </key> <key name="togglebox-font-fgcolor" type="s"> <default>'#808080'</default> <summary>Font foreground color (e.g. #A0A0A0) for non-active/-hovered and non-selected session names in the session list</summary> diff --git a/src/background.vala b/src/background.vala index 70813ea..a0a2af1 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 { @@ -722,7 +741,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 diff --git a/src/settings.vala b/src/settings.vala index 68ce674..7e8306d 100644 --- a/src/settings.vala +++ b/src/settings.vala @@ -28,6 +28,7 @@ public class AGSettings : Object { public const string KEY_BACKGROUND = "background"; public const string KEY_BACKGROUND_COLOR = "background-color"; + public const string KEY_HIGH_CONTRAST_BACKGROUND_COLOR = "high-contrast-background-color"; public const string KEY_BACKGROUND_MODE = "background-mode"; public const string KEY_DRAW_USER_BACKGROUNDS = "draw-user-backgrounds"; public const string KEY_DRAW_GRID = "draw-grid"; |