ui/gtk/image.c

changeset 962
7016bcb8d38b
parent 961
687f43736aef
--- a/ui/gtk/image.c	Sun Dec 07 12:02:58 2025 +0100
+++ b/ui/gtk/image.c	Sun Dec 07 12:09:04 2025 +0100
@@ -30,6 +30,7 @@
 
 #include "container.h"
 #include "menu.h"
+#include "widget.h"
 #include "../common/context.h"
 #include "../common/object.h"
 
@@ -68,19 +69,13 @@
     GtkWidget *toplevel;
     GtkWidget *widget = drawingarea;
     
-    if(args->width > 0 || args->height > 0) {
-        int width = args->width;
-        int height = args->height;
-        if(width == 0) {
-            width = -1;
-        }
-        if(height == 0) {
-            height = -1;
-        }
-        gtk_widget_set_size_request(drawingarea, width, height);
-    } else {
-        gtk_widget_set_size_request(drawingarea, 100, 100);
+    int width = args->width;
+    int height = args->height;
+    if(width == 0 && height == 0) {
+        width = 100;
+        height = 100;
     }
+    ui_widget_size_request(drawingarea, width, height);
     
 #if GTK_MAJOR_VERSION < 4
     GtkWidget *eventbox = gtk_event_box_new();

mercurial