nwg-piotr / nwg-look

GTK3 settings editor adapted to work in the wlroots environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[PATCH] Loading text scale from file

Grzegorzorzorz opened this issue · comments

Hi,

Firstly I'd like to thank you for this project, it's been really helpful in my transition to Wayland.

I've noticed that currently when using nwg-look -a, the text scaling factor is not actually read from the file, and the default is instead used. I've had a go at creating a patch for it (see below), and it seems to work well on my end.

Cheers,
Grzegorz

From d6dd3f231f5fcfc6b75a17da66f369c7fd09061e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Grzegorz=20Cio=C5=82ek?= <ciolek.greg@gmail.com>
Date: Tue, 23 May 2023 16:46:01 +0100
Subject: [PATCH] Fixed text scale loading from file

---
 tools.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools.go b/tools.go
index fd98763..f6d5385 100644
--- a/tools.go
+++ b/tools.go
@@ -534,6 +534,11 @@ func applyGsettingsFromFile() {
 						gsettings.fontAntialiasing = value
 					case "font-rgba-order":
 						gsettings.fontRgbaOrder = value
+					case "text-scaling-factor":
+						v, err := strconv.ParseFloat(value, 64)
+						if err == nil {
+							gsettings.textScalingFactor = v
+						}
 					case "event-sounds":
 						gsettings.eventSounds = value == "true"
 					case "input-feedback-sounds":
-- 
2.39.3

Hi,

Probably the text-scaling-factor property support was added later, and forgotten in the applyGsettingsFromFile() function. Thanks for pointing this out. Wouldn't you like to make a PR?

Regards,
Piotr

Sure, I've opened a PR for you. #35

Merged, thanks!