aboutsummaryrefslogtreecommitdiff
path: root/src/arctica-greeter.vala
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-18 10:38:25 +0200
committerMihai Moldovan <ionic@ionic.de>2023-09-19 17:23:30 +0200
commit0f287c93d586f16a7d37829da7c54c0f7e48709d (patch)
treeb8c0dab968d890a1cbf28d92348bd81b1837299d /src/arctica-greeter.vala
parentf2f92d4da533b047174fa9d8a90303003a6c2d51 (diff)
downloadarctica-greeter-0f287c93d586f16a7d37829da7c54c0f7e48709d.tar.gz
arctica-greeter-0f287c93d586f16a7d37829da7c54c0f7e48709d.tar.bz2
arctica-greeter-0f287c93d586f16a7d37829da7c54c0f7e48709d.zip
src/arctica-greeter.vala: Check for high-contrast mode when initializing gtk-theme-name and gtk-icon-theme-name.
Diffstat (limited to 'src/arctica-greeter.vala')
-rw-r--r--src/arctica-greeter.vala42
1 files changed, 27 insertions, 15 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index 245c1dc..d0f9902 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -1071,12 +1071,37 @@ public class ArcticaGreeter : Object
/* Set GTK+ settings */
debug ("Setting GTK+ settings");
var settings = Gtk.Settings.get_default ();
- var value = AGSettings.get_string (AGSettings.KEY_THEME_NAME);
+
+ /*
+ * Keep a reference to an AGSettings instance for the whole program
+ * run, so that the SingleInstance property is working the way we'd
+ * like it to work.
+ *
+ * We want to do this before creating the actual greeter, since the
+ * latter is using AGSettings quite extensively.
+ *
+ * This might throw a Vala warning: "local variable `agsettings'
+ * declared but never used" if we don't use the variable, but this can
+ * safely be ignored.
+ */
+ var agsettings = new AGSettings ();
+ string value = "";
+ if (agsettings.high_contrast)
+ {
+ value = AGSettings.get_string (AGSettings.KEY_HIGH_CONTRAST_THEME_NAME);
+ } else {
+ value = AGSettings.get_string (AGSettings.KEY_THEME_NAME);
+ }
if (value != ""){
debug ("Setting GTK theme: %s", value);
settings.set ("gtk-theme-name", value, null);
}
- value = AGSettings.get_string (AGSettings.KEY_ICON_THEME_NAME);
+ if (agsettings.high_contrast)
+ {
+ value = AGSettings.get_string (AGSettings.KEY_HIGH_CONTRAST_ICON_THEME_NAME);
+ } else {
+ value = AGSettings.get_string (AGSettings.KEY_ICON_THEME_NAME);
+ }
if (value != ""){
debug ("Setting icon theme: %s", value);
settings.set ("gtk-icon-theme-name", value, null);
@@ -1107,19 +1132,6 @@ public class ArcticaGreeter : Object
if (value != "")
settings.set ("gtk-xft-rgba", value, null);
- /*
- * Keep a reference to an AGSettings instance for the whole program
- * run, so that the SingleInstance property is working the way we'd
- * like it to work.
- *
- * We want to do this before creating the actual greeter, since the
- * latter is using AGSettings quite extensively.
- *
- * This will throw a Vala warning: "local variable `agsettings' declared
- * but never used". Which can be ignored.
- */
- var agsettings = new AGSettings ();
-
debug ("Creating Arctica Greeter");
var greeter = new ArcticaGreeter (do_test_mode, do_test_highcontrast, do_test_bigfont);
greeter.go();