aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Webster <miketwebster@gmail.com>2023-02-06 09:51:55 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-02-06 12:08:33 +0100
commit480730067e500de1af2eb616663179e106ea995b (patch)
treea1910fb1147320ea3768a519259511275e411e57
parentd1371ed702dc5714d22f13f2e27f019f86df2f24 (diff)
downloadarctica-greeter-480730067e500de1af2eb616663179e106ea995b.tar.gz
arctica-greeter-480730067e500de1af2eb616663179e106ea995b.tar.bz2
arctica-greeter-480730067e500de1af2eb616663179e106ea995b.zip
Set our own cursor theme and size internally via GtkSettings.
The gtk and icon themes already work this way. Ported from Slick Greeter by Mike Gabriel. https://github.com/linuxmint/slick-greeter/commit/97f9f54b686303dec81918d3056194bff2a3163c
-rw-r--r--data/org.ArcticaProject.arctica-greeter.gschema.xml8
-rw-r--r--src/arctica-greeter.vala21
-rw-r--r--src/settings.vala2
3 files changed, 28 insertions, 3 deletions
diff --git a/data/org.ArcticaProject.arctica-greeter.gschema.xml b/data/org.ArcticaProject.arctica-greeter.gschema.xml
index b0069c2..a264432 100644
--- a/data/org.ArcticaProject.arctica-greeter.gschema.xml
+++ b/data/org.ArcticaProject.arctica-greeter.gschema.xml
@@ -45,6 +45,14 @@
<default>'Adwaita'</default>
<summary>Icon theme to use</summary>
</key>
+ <key name="cursor-theme-name" type="s">
+ <default>'default'</default>
+ <summary>Cursor theme to use</summary>
+ </key>
+ <key name="cursor-theme-size" type="i">
+ <default>0</default>
+ <summary>Size to use for cursors - 0 is default size</summary>
+ </key>
<key name="font-name" type="s">
<default>'Sans 11'</default>
<summary>Font to use</summary>
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index 3f119c4..89d52b8 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -910,14 +910,29 @@ public class ArcticaGreeter : Object
debug ("Setting GTK+ settings");
var settings = Gtk.Settings.get_default ();
var value = AGSettings.get_string (AGSettings.KEY_THEME_NAME);
- if (value != "")
+ 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 (value != "")
+ if (value != ""){
+ debug ("Setting icon theme: %s", value);
settings.set ("gtk-icon-theme-name", value, null);
+ }
+ value = AGSettings.get_string (AGSettings.KEY_CURSOR_THEME_NAME);
+ if (value != "") {
+ debug ("Setting cursor theme: %s", value);
+ settings.set ("gtk-cursor-theme-name", value, null);
+ }
+ var int_value = AGSettings.get_integer (AGSettings.KEY_CURSOR_THEME_SIZE);
+ if (int_value != 0) {
+ debug ("Settings cursor theme size: %d", int_value);
+ settings.set ("gtk-cursor-theme-size", int_value, null);
+ }
value = AGSettings.get_string (AGSettings.KEY_FONT_NAME);
- if (value != "")
+ if (value != ""){
settings.set ("gtk-font-name", value, null);
+ }
var double_value = AGSettings.get_double (AGSettings.KEY_XFT_DPI);
if (double_value != 0.0)
settings.set ("gtk-xft-dpi", (int) (1024 * double_value), null);
diff --git a/src/settings.vala b/src/settings.vala
index af753ce..05f54fe 100644
--- a/src/settings.vala
+++ b/src/settings.vala
@@ -33,6 +33,8 @@ public class AGSettings : Object
public const string KEY_THEME_NAME = "theme-name";
public const string KEY_HIGH_CONTRAST_THEME_NAME = "high-contrast-theme-name";
public const string KEY_ICON_THEME_NAME = "icon-theme-name";
+ public const string KEY_CURSOR_THEME_NAME = "cursor-theme-name";
+ public const string KEY_CURSOR_THEME_SIZE = "cursor-theme-size";
public const string KEY_FONT_NAME = "font-name";
public const string KEY_XFT_ANTIALIAS = "xft-antialias";
public const string KEY_XFT_DPI = "xft-dpi";