aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/background.vala26
-rw-r--r--src/settings.vala1
2 files changed, 26 insertions, 1 deletions
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";