ui/gtk/container.c

changeset 783
25b2da0aac15
parent 768
dc8e64b87e60
child 794
ebd7b3394501
--- a/ui/gtk/container.c	Mon Sep 29 21:34:43 2025 +0200
+++ b/ui/gtk/container.c	Wed Oct 01 14:20:10 2025 +0200
@@ -1053,6 +1053,34 @@
 }
 #endif
 
+/* ------------------------ Split Window Panels ------------------------ */
+
+static UIWIDGET splitwindow_panel(UiObject *obj, GtkWidget *pbox, UiSidebarArgs *args) {
+    if(!pbox) {
+        fprintf(stderr, "Error: window is not a splitview window\n");
+        return NULL;
+    }
+    
+    GtkWidget *box = ui_gtk_vbox_new(args->spacing);
+    ui_box_set_margin(box, args->margin);
+    BOX_ADD_EXPAND(pbox, box);
+    
+    UiObject *newobj = uic_object_new(obj, box);
+    newobj->container = ui_box_container(obj, box, UI_CONTAINER_VBOX);
+    uic_obj_add(obj, newobj);
+    
+    return box;
+}
+
+UIWIDGET ui_left_panel_create(UiObject *obj, UiSidebarArgs *args) {
+    return splitwindow_panel(obj, g_object_get_data(G_OBJECT(obj->widget), "ui_left_panel"), args);
+}
+
+UIWIDGET ui_right_panel_create(UiObject *obj, UiSidebarArgs *args) {
+    return splitwindow_panel(obj, g_object_get_data(G_OBJECT(obj->widget), "ui_right_panel"), args);
+}
+
+
 /* -------------------- Splitpane -------------------- */
 
 static GtkWidget* create_paned(UiOrientation orientation) {

mercurial