application/main.c

changeset 1194
91696f7fa475
parent 1179
2f4c73ff962f
--- a/application/main.c	Sat Jun 13 12:03:09 2026 +0200
+++ b/application/main.c	Sat Jun 13 14:12:43 2026 +0200
@@ -271,6 +271,12 @@
     ui_dialog(event->obj, .title = "Dialog Title", .content = "Content Label", .button1_label = "btn1", .button2_label = "btn2", .input = TRUE, .closebutton_label = "Cancel");
 }
 
+static int toggle_pane0 = 0;
+void action_toolbar_pane0(UiEvent *event, void *userdata) {
+    ui_splitview_window_set_visible(event->obj, 0, toggle_pane0);
+    toggle_pane0 = !toggle_pane0;
+}
+
 void action_dialog_button(UiEvent *event, void *userdata) {
     ui_close(event->obj);
 }
@@ -945,6 +951,8 @@
     }
     
     ui_toolbar_item("Test", .label = "Test", .onclick = action_toolbar_button);
+    ui_toolbar_item("Pane0", .label = "Pane0", .onclick = action_toolbar_pane0);
+    ui_toolbar_item("Test1", .label = "Test1", .onclick = action_toolbar_button);
     ui_toolbar_item("Test2", .label = "New Window", .onclick = action_toolbar_newwindow);
     ui_toolbar_item("Test3", .label = "Dialog", .onclick = action_toolbar_dialog);
     ui_toolbar_item("Test4", .label = "Unref Window", .onclick = action_toolbar_unrefwindow);
@@ -979,6 +987,7 @@
         ui_menuitem("Close");
     }
     
+    ui_toolbar_add_default("Pane0", UI_TOOLBAR_LEFT);
     ui_toolbar_add_default("Test", UI_TOOLBAR_LEFT);
     ui_toolbar_add_default("Test6", UI_TOOLBAR_LEFT);
     ui_toolbar_add_default("Toggle", UI_TOOLBAR_LEFT);
@@ -990,6 +999,8 @@
     ui_toolbar_add_default("Test4", UI_TOOLBAR_RIGHT);
     ui_toolbar_add_default("Test5", UI_TOOLBAR_RIGHT);
     
+    ui_toolbar_add_default("Test1", UI_TOOLBAR_RIGHTPANEL_LEFT);
+    
     threadpool = ui_threadpool_create(10);
     
     // test

mercurial