ui/gtk/headerbar.c

branch
newapi
changeset 314
d96ba820083a
parent 311
450a813dc2a5
child 322
22f6dadd9f46
equal deleted inserted replaced
313:b679cc6059ab 314:d96ba820083a
150 GtkWidget *box, 150 GtkWidget *box,
151 UiToolbarMenuItem *item, 151 UiToolbarMenuItem *item,
152 UiObject *obj, 152 UiObject *obj,
153 enum UiToolbarPos pos) 153 enum UiToolbarPos pos)
154 { 154 {
155
156
157 #if GTK_MAJOR_VERSION >= 4
155 GtkWidget *menubutton = gtk_menu_button_new(); 158 GtkWidget *menubutton = gtk_menu_button_new();
156
157 if(item->args.label) { 159 if(item->args.label) {
158 gtk_menu_button_set_label(GTK_MENU_BUTTON(menubutton), item->args.label); 160 gtk_menu_button_set_label(GTK_MENU_BUTTON(menubutton), item->args.label);
159 } 161 }
160 if(item->args.icon) { 162 if(item->args.icon) {
161 gtk_menu_button_set_icon_name(GTK_MENU_BUTTON(menubutton), item->args.icon); 163 gtk_menu_button_set_icon_name(GTK_MENU_BUTTON(menubutton), item->args.icon);
162 } 164 }
163 165
164 GMenu *menu = g_menu_new(); 166 GMenu *menu = g_menu_new();
165 ui_gmenu_add_menu_items(menu, 0, &item->menu, obj); 167 ui_gmenu_add_menu_items(menu, 0, &item->menu, obj);
166 168
167 gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(menubutton), G_MENU_MODEL(menu)); 169 gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(menubutton), G_MENU_MODEL(menu));
170 #else
171 GtkWidget *menubutton = gtk_menu_button_new();
172
173 // TODO
174
175
176 #endif
168 177
169 headerbar_add(headerbar, box, menubutton, pos); 178 headerbar_add(headerbar, box, menubutton, pos);
170 } 179 }
171 180
172 #endif 181 #endif

mercurial