unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 00996b9f284ba423fdeb61c32130a1647f711452 7367 bytes (raw)
name: gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
 
From 35a6bd68317972b7bfccf546de04060e09dbab93 Mon Sep 17 00:00:00 2001
From: wb9688 <wb9688@users.noreply.github.com>
Date: Tue, 2 Mar 2021 14:00:48 +0100
Subject: [PATCH 1/2] Set some settings in GSettings as well

---
 src/lxappearance.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/src/lxappearance.c b/src/lxappearance.c
index f31e794..18ba471 100644
--- a/src/lxappearance.c
+++ b/src/lxappearance.c
@@ -462,6 +462,97 @@ static void lxappearance_save_gtkrc()
     g_free(file_path);
 }
 
+#if GLIB_CHECK_VERSION(2, 40, 0)
+static void lxappearance_save_gsettings()
+{
+    GSettingsSchemaSource *source = g_settings_schema_source_get_default();
+    if (!source)
+        return;
+
+    GSettingsSchema *schema = g_settings_schema_source_lookup(source, "org.gnome.desktop.interface", TRUE);
+    if (!schema)
+        return;
+
+    GSettings *settings = g_settings_new("org.gnome.desktop.interface");
+
+    if (app.widget_theme && g_settings_schema_has_key(schema, "gtk-theme"))
+        g_settings_set_string(settings, "gtk-theme", app.widget_theme);
+
+    if (app.icon_theme && g_settings_schema_has_key(schema, "icon-theme"))
+        g_settings_set_string(settings, "icon-theme", app.icon_theme);
+
+    if (app.default_font && g_settings_schema_has_key(schema, "font-name"))
+        g_settings_set_string(settings, "font-name", app.default_font);
+
+    if (app.cursor_theme && g_settings_schema_has_key(schema, "cursor-theme"))
+        g_settings_set_string(settings, "cursor-theme", app.cursor_theme);
+
+    if (g_settings_schema_has_key(schema, "cursor-size"))
+        g_settings_set_int(settings, "cursor-size", app.cursor_theme_size);
+
+    if (app.font_rgba && g_settings_schema_has_key(schema, "font-antialiasing") && g_settings_schema_has_key(schema, "font-rgba-order"))
+    {
+        if (!app.enable_antialising)
+            g_settings_set_string(settings, "font-antialiasing", "none");
+        else if (strcmp(app.font_rgba, "none") == 0)
+            g_settings_set_string(settings, "font-antialiasing", "grayscale");
+        else
+        {
+            g_settings_set_string(settings, "font-antialiasing", "rgba");
+            if (strcmp(app.font_rgba, "rgb") == 0)
+                g_settings_set_string(settings, "font-rgba-order", "rgb");
+            else if (strcmp(app.font_rgba, "bgr") == 0)
+                g_settings_set_string(settings, "font-rgba-order", "bgr");
+            else if (strcmp(app.font_rgba, "vrgb") == 0)
+                g_settings_set_string(settings, "font-rgba-order", "vrgb");
+            else if (strcmp(app.font_rgba, "vbgr") == 0)
+                g_settings_set_string(settings, "font-rgba-order", "vbgr");
+        }
+    }
+
+    if (app.hinting_style && g_settings_schema_has_key(schema, "font-hinting"))
+    {
+        if (!app.enable_hinting || strcmp(app.hinting_style, "hintnone") == 0)
+            g_settings_set_string(settings, "font-hinting", "none");
+        else if (strcmp(app.hinting_style, "hintslight") == 0)
+            g_settings_set_string(settings, "font-hinting", "slight");
+        else if (strcmp(app.hinting_style, "hintmedium") == 0)
+            g_settings_set_string(settings, "font-hinting", "medium");
+        else if (strcmp(app.hinting_style, "hintfull") == 0)
+            g_settings_set_string(settings, "font-hinting", "full");
+    }
+
+    if (g_settings_schema_has_key(schema, "menus-have-icons"))
+        g_settings_set_boolean(settings, "menus-have-icons", app.menu_images);
+
+    if (g_settings_schema_has_key(schema, "buttons-have-icons"))
+        g_settings_set_boolean(settings, "buttons-have-icons", app.button_images);
+
+    if (g_settings_schema_has_key(schema, "toolbar-style"))
+    {
+        if (app.toolbar_style == 0)
+            g_settings_set_string(settings, "toolbar-style", "icons");
+        else if (app.toolbar_style == 1)
+            g_settings_set_string(settings, "toolbar-style", "text");
+        else if (app.toolbar_style == 2)
+            g_settings_set_string(settings, "toolbar-style", "both");
+        else if (app.toolbar_style == 3)
+            g_settings_set_string(settings, "toolbar-style", "both-horiz");
+    }
+
+    if (g_settings_schema_has_key(schema, "toolbar-icons-size"))
+    {
+        if (app.toolbar_icon_size == 2)
+            g_settings_set_string(settings, "toolbar-icons-size", "small");
+        else if (app.toolbar_icon_size == 3)
+            g_settings_set_string(settings, "toolbar-icons-size", "large");
+    }
+
+    g_settings_schema_unref(schema);
+    g_object_unref(settings);
+}
+#endif
+
 static void lxappearance_save_lxsession()
 {
     char* rel_path = g_strconcat("lxsession/", lxsession_name, "/desktop.conf", NULL);
@@ -532,6 +623,9 @@ static void on_dlg_response(GtkDialog* dlg, int res, gpointer user_data)
         if(app.use_lxsession)
             lxappearance_save_lxsession();
         lxappearance_save_gtkrc();
+#if GLIB_CHECK_VERSION(2, 40, 0)
+        lxappearance_save_gsettings();
+#endif
 
         reload_all_programs();
 

From 703accd389b9dc6e9f5ed4fc3ffc23aacf893bc1 Mon Sep 17 00:00:00 2001
From: wb9688 <wb9688@users.noreply.github.com>
Date: Tue, 16 Mar 2021 19:20:08 +0100
Subject: [PATCH 2/2] Remove toolbar icon size options other than large and
 small

---
 data/ui/lxappearance.glade | 12 ------------
 src/other.c                |  4 ++--
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/data/ui/lxappearance.glade b/data/ui/lxappearance.glade
index 19554cc..892c46d 100644
--- a/data/ui/lxappearance.glade
+++ b/data/ui/lxappearance.glade
@@ -2125,24 +2125,12 @@
       <column type="gchararray"/>
     </columns>
     <data>
-      <row>
-        <col id="0" translatable="yes">Same as menu items</col>
-      </row>
       <row>
         <col id="0" translatable="yes">Small toolbar icon</col>
       </row>
       <row>
         <col id="0" translatable="yes">Large toolbar icon</col>
       </row>
-      <row>
-        <col id="0" translatable="yes">Same as buttons</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Same as drag icons</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Same as dialogs</col>
-      </row>
     </data>
   </object>
   <object class="GtkListStore" id="tb_style_store">
diff --git a/src/other.c b/src/other.c
index d79b28d..aaaeb41 100644
--- a/src/other.c
+++ b/src/other.c
@@ -30,7 +30,7 @@ static void on_tb_style_changed(GtkComboBox* combo, gpointer user_data)
 
 static void on_tb_icon_size_changed(GtkComboBox* combo, gpointer user_data)
 {
-    app.toolbar_icon_size = gtk_combo_box_get_active(combo) + GTK_ICON_SIZE_MENU;
+    app.toolbar_icon_size = gtk_combo_box_get_active(combo) + GTK_ICON_SIZE_SMALL_TOOLBAR;
     lxappearance_changed();
 }
 
@@ -72,7 +72,7 @@ void other_init(GtkBuilder* b)
     g_signal_connect(app.tb_style_combo, "changed", G_CALLBACK(on_tb_style_changed), NULL);
 
     app.tb_icon_size_combo = GTK_WIDGET(gtk_builder_get_object(b, "tb_icon_size"));
-    idx = app.toolbar_icon_size - GTK_ICON_SIZE_MENU;
+    idx = app.toolbar_icon_size - GTK_ICON_SIZE_SMALL_TOOLBAR;
     gtk_combo_box_set_active(GTK_COMBO_BOX(app.tb_icon_size_combo), idx);
     g_signal_connect(app.tb_icon_size_combo, "changed", G_CALLBACK(on_tb_icon_size_changed), NULL);
 

debug log:

solving 00996b9f28 ...
found 00996b9f28 in https://yhetil.org/guix-patches/c587ca4b3a1a7e10dda0ea7984c7d27061b3d035.1670878271.git.florhizome@posteo.net/

applying [1/1] https://yhetil.org/guix-patches/c587ca4b3a1a7e10dda0ea7984c7d27061b3d035.1670878271.git.florhizome@posteo.net/
diff --git a/gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch b/gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch
new file mode 100644
index 0000000000..00996b9f28

1:23: trailing whitespace.
 
1:125: trailing whitespace.
 
1:127: trailing whitespace.
 
1:174: trailing whitespace.
 
1:181: trailing whitespace.
 
Checking patch gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch...
Applied patch gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch cleanly.
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.

index at:
100644 00996b9f284ba423fdeb61c32130a1647f711452	gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).