[gnome-builder/ebassi/gnome-app-template: 1/3] meson-template: Remove hard-coded default size




commit e33a6bdcaf59da593f2ee3f2dcc0dcf9c14083a9
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Feb 8 21:18:26 2022 +0000

    meson-template: Remove hard-coded default size
    
    The default size of the application window should only be set in the
    UI definition files. This way we can easily modify the generated
    application in order to store and restore the window size and state.
    If we pass default-width and default-height to the constructor of
    the application window, we won't be able to set up a GSettings binding
    in out instance initialization function.

 src/plugins/meson-templates/resources/src/application.c  | 2 --
 src/plugins/meson-templates/resources/src/application.rs | 1 -
 src/plugins/meson-templates/resources/src/main.c         | 2 --
 3 files changed, 5 deletions(-)
---
diff --git a/src/plugins/meson-templates/resources/src/application.c 
b/src/plugins/meson-templates/resources/src/application.c
index ae844bd22..a270897c6 100644
--- a/src/plugins/meson-templates/resources/src/application.c
+++ b/src/plugins/meson-templates/resources/src/application.c
@@ -44,8 +44,6 @@ static void
   if (window == NULL)
     window = g_object_new ({{PREFIX}}_TYPE_WINDOW,
                            "application", app,
-                           "default-width", 600,
-                           "default-height", 300,
                            NULL);
 
   /* Ask the window manager/compositor to present the window. */
diff --git a/src/plugins/meson-templates/resources/src/application.rs 
b/src/plugins/meson-templates/resources/src/application.rs
index 1f13b37f6..fea527d93 100644
--- a/src/plugins/meson-templates/resources/src/application.rs
+++ b/src/plugins/meson-templates/resources/src/application.rs
@@ -39,7 +39,6 @@ mod imp {
                 window
             } else {
                 let window = {{PreFix}}Window::new(application);
-                window.set_default_size(600, 300);
                 window.upcast()
             };
 
diff --git a/src/plugins/meson-templates/resources/src/main.c 
b/src/plugins/meson-templates/resources/src/main.c
index c35abcc8a..20f81d217 100644
--- a/src/plugins/meson-templates/resources/src/main.c
+++ b/src/plugins/meson-templates/resources/src/main.c
@@ -21,8 +21,6 @@ on_activate (GtkApplication *app)
        if (window == NULL)
                window = g_object_new ({{PREFIX}}_TYPE_WINDOW,
                                       "application", app,
-                                      "default-width", 600,
-                                      "default-height", 300,
                                       NULL);
 
        /* Ask the window manager/compositor to present the window. */


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