add ui_window_default_size function (GTK)

Sun, 14 Sep 2025 18:32:26 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 14 Sep 2025 18:32:26 +0200
changeset 764
5ff4b9c0cf96
parent 763
258ec399fbe6
child 765
ee08f7859b78

add ui_window_default_size function (GTK)

ui/gtk/window.c file | annotate | diff | comparison | revisions
ui/ui/window.h file | annotate | diff | comparison | revisions
--- a/ui/gtk/window.c	Sat Sep 13 19:53:50 2025 +0200
+++ b/ui/gtk/window.c	Sun Sep 14 18:32:26 2025 +0200
@@ -338,6 +338,11 @@
                 height);
 }
 
+void ui_window_default_size(UiObject *obj, int width, int height) {
+    window_default_width = width;
+    window_default_height = height;
+}
+
 #ifdef UI_LIBADWAITA
 
 static void dialog_response(AdwAlertDialog *self, gchar *response, UiEventData *data) {
--- a/ui/ui/window.h	Sat Sep 13 19:53:50 2025 +0200
+++ b/ui/ui/window.h	Sun Sep 14 18:32:26 2025 +0200
@@ -81,6 +81,7 @@
 #define ui_dialog_window0(parent) ui_dialog_window_create(parent, &(UiDialogWindowArgs){ 0 });
 
 UIEXPORT void ui_window_size(UiObject *obj, int width, int height);
+UIEXPORT void ui_window_default_size(UiObject *obj, int width, int height);
 
 #define ui_dialog(parent, ...) ui_dialog_create(parent, &(UiDialogArgs){ __VA_ARGS__ } )
 

mercurial