ui/gtk/webview.c

changeset 112
c3f2f16fa4b8
parent 110
c00e968d018b
--- a/ui/gtk/webview.c	Sat Oct 04 14:54:25 2025 +0200
+++ b/ui/gtk/webview.c	Sun Oct 19 21:20:08 2025 +0200
@@ -34,13 +34,11 @@
 #ifdef UI_WEBVIEW
 
 UIWIDGET ui_webview_create(UiObject *obj, UiWebviewArgs *args) {
-    UiObject* current = uic_current_obj(obj);
-    
     GtkWidget *webview = webkit_web_view_new();
     
     ui_set_name_and_style(webview, args->name, args->style_class);
     
-    UiVar *var = uic_widget_var(obj->ctx, current->ctx, args->value, args->varname, UI_VAR_GENERIC);
+    UiVar *var = uic_widget_var(obj->ctx, obj->ctx, args->value, args->varname, UI_VAR_GENERIC);
     if(var) {
         WebViewData *data = malloc(sizeof(WebViewData));
         memset(data, 0, sizeof(WebViewData));
@@ -60,8 +58,9 @@
     }
     
     ui_set_widget_groups(obj->ctx, webview, args->groups);
-    UI_APPLY_LAYOUT2(current, args);
-    current->container->add(current->container, webview);
+    UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;
+    UiLayout layout = UI_ARGS2LAYOUT(args);
+    ct->add(ct, webview, &layout);
     
     return webview;
 }
@@ -97,7 +96,7 @@
     }
     
     ui_webview_enable_javascript(g, data->javascript);
-    webkit_web_view_set_zoom_level(data->webview, data->zoom);
+    ui_webview_set_zoom(g, data->zoom);
     
     return 0;
 }

mercurial