[gnome-clocks] gschema: Revert newer keys for width and height



commit a7ca05b1435e85d0c4ca0225c68c456cb5302ca6
Author: Maximiliano Sandoval R <msandova gnome org>
Date:   Wed Jan 5 14:49:48 2022 +0100

    gschema: Revert newer keys for width and height
    
    To avoid migrations.

 data/org.gnome.clocks.gschema.xml.in | 15 ++++-----------
 src/window.vala                      |  6 ++----
 2 files changed, 6 insertions(+), 15 deletions(-)
---
diff --git a/data/org.gnome.clocks.gschema.xml.in b/data/org.gnome.clocks.gschema.xml.in
index 9f183f9b..b4b2cde4 100644
--- a/data/org.gnome.clocks.gschema.xml.in
+++ b/data/org.gnome.clocks.gschema.xml.in
@@ -46,18 +46,11 @@
         Whether the window is maximized.
       </description>
     </key>
-    <key type="i" name="width">
-      <default>870</default>
-      <summary>Window width</summary>
+    <key type="(ii)" name="size">
+      <default>(870, 690)</default>
+      <summary>Window width and height</summary>
       <description>
-        Width of the window.
-      </description>
-    </key>
-    <key type="i" name="height">
-      <default>690</default>
-      <summary>Window height</summary>
-      <description>
-        Height of the window.
+        Width and height of the window.
       </description>
     </key>
     <key enum="org.gnome.clocks.panelid" name="panel-id">
diff --git a/src/window.vala b/src/window.vala
index 29b3b8d9..ae945225 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -209,8 +209,7 @@ public class Window : Adw.ApplicationWindow {
             maximize ();
         } else {
             int width, height;
-            width = settings.get_int ("width");
-            height = settings.get_int ("height");
+            settings.get ("size", "(ii)", out width, out height);
             set_default_size (width, height);
         }
     }
@@ -223,8 +222,7 @@ public class Window : Adw.ApplicationWindow {
 
         debug ("Saving window geometry: %i × %i", width, height);
 
-        settings.set_int ("width", width);
-        settings.set_int ("height", height);
+        settings.set ("size", "(ii)", width, height);
 
         settings.set_boolean ("maximized", is_maximized ());
         settings.apply ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]