ui/gtk/container.c

branch
newapi
changeset 409
86fbc80f0be7
parent 378
d41b1ffc5f77
child 410
a080c69125d1
equal deleted inserted replaced
408:b06e43f1edd4 409:86fbc80f0be7
889 return ui_headerbar_fallback_create(obj, args); 889 return ui_headerbar_fallback_create(obj, args);
890 } 890 }
891 891
892 #endif 892 #endif
893 893
894 /* -------------------- Sidebar -------------------- */
895
896 #ifdef UI_LIBADWAITA
897 UIWIDGET ui_sidebar_create(UiObject *obj, UiSidebarArgs args) {
898 GtkWidget *sidebar_toolbar_view = g_object_get_data(G_OBJECT(obj->widget), "ui_sidebar");
899 if(!sidebar_toolbar_view) {
900 fprintf(stderr, "Error: window is not configured for sidebar\n");
901 return NULL;
902 }
903
904 GtkWidget *box = ui_gtk_vbox_new(args.spacing);
905 ui_box_set_margin(box, args.margin);
906 adw_toolbar_view_set_content(ADW_TOOLBAR_VIEW(sidebar_toolbar_view), box);
907
908 UiObject *newobj = uic_object_new(obj, box);
909 newobj->container = ui_box_container(obj, box, UI_CONTAINER_VBOX);
910 uic_obj_add(obj, newobj);
911
912 return box;
913 }
914 #endif
915
894 /* -------------------- Splitpane -------------------- */ 916 /* -------------------- Splitpane -------------------- */
895 917
896 static GtkWidget* create_paned(UiOrientation orientation) { 918 static GtkWidget* create_paned(UiOrientation orientation) {
897 #if GTK_MAJOR_VERSION >= 3 919 #if GTK_MAJOR_VERSION >= 3
898 switch(orientation) { 920 switch(orientation) {

mercurial