aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-30 14:22:02 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-10-10 22:42:28 +0200
commitd60f177134fb113ccdf0bb172a2fc8c5ecb2411f (patch)
tree9d9cf418a621f9dd799bcf99b1541d4ca106a637 /src
parentdf05936e999785768cabb13df6f30c1cbcfc2d87 (diff)
downloadarctica-greeter-d60f177134fb113ccdf0bb172a2fc8c5ecb2411f.tar.gz
arctica-greeter-d60f177134fb113ccdf0bb172a2fc8c5ecb2411f.tar.bz2
arctica-greeter-d60f177134fb113ccdf0bb172a2fc8c5ecb2411f.zip
settings: Add font scaling via GDK_DPI_SCALE. This is not adjustable at runtime (for now).
Diffstat (limited to 'src')
-rw-r--r--src/arctica-greeter.vala8
-rw-r--r--src/settings.vala1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index 3ff9a24..0bb4c8d 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -974,6 +974,14 @@ public class ArcticaGreeter : Object
debug ("Setting GDK_SCALE to: %d (scaling all UI elements by this factor)", scaling_factor_hidpi);
GLib.Environment.set_variable ("GDK_SCALE", "%d".printf (scaling_factor_hidpi), true);
+ /* Font scaling settings */
+ var scaling_factor_fonts = AGSettings.get_double (AGSettings.KEY_FONT_SCALING);
+ debug ("Scaling factor for fonts is: %f", scaling_factor_fonts);
+
+ /* Adjust GDK_SCALE / GDK_DPI_SCALE to our configured scaling factors. */
+ debug ("Setting GDK_DPI_SCALE to: %f (scaling fonts only by this factor)", scaling_factor_fonts);
+ GLib.Environment.set_variable ("GDK_DPI_SCALE", "%f".printf (scaling_factor_fonts), true);
+
/* Make nm-applet hide items the user does not have permissions to interact with */
Environment.set_variable ("NM_APPLET_HIDE_POLICY_ITEMS", "1", true);
diff --git a/src/settings.vala b/src/settings.vala
index c5d59ca..e4386a6 100644
--- a/src/settings.vala
+++ b/src/settings.vala
@@ -73,6 +73,7 @@ public class AGSettings : Object
public const string KEY_FLATBUTTON_BGCOLOR = "flatbutton-bgcolor";
public const string KEY_FLATBUTTON_BORDERCOLOR = "flatbutton-bordercolor";
public const string KEY_ENABLE_HIDPI = "enable-hidpi";
+ public const string KEY_FONT_SCALING = "font-scaling";
public const string KEY_MENUBAR_ALPHA = "menubar-alpha";
public const string KEY_HIDE_DEFAULT_XSESSION = "hide-default-xsession";
public const string KEY_HIDE_X11_SESSIONS = "hide-x11-sessions";