113 UiToolbarItem *item, |
113 UiToolbarItem *item, |
114 UiObject *obj, |
114 UiObject *obj, |
115 enum UiToolbarPos pos) |
115 enum UiToolbarPos pos) |
116 { |
116 { |
117 GtkWidget *button = ui_create_button(obj, item->args.label, item->args.icon, item->args.onclick, item->args.onclickdata, 0, FALSE); |
117 GtkWidget *button = ui_create_button(obj, item->args.label, item->args.icon, item->args.onclick, item->args.onclickdata, 0, FALSE); |
|
118 ui_set_widget_groups(obj->ctx, button, item->args.groups); |
118 WIDGET_ADD_CSS_CLASS(button, "flat"); |
119 WIDGET_ADD_CSS_CLASS(button, "flat"); |
119 headerbar_add(headerbar, box, button, pos); |
120 headerbar_add(headerbar, box, button, pos); |
120 } |
121 } |
121 |
122 |
122 void ui_add_headerbar_toggleitem( |
123 void ui_add_headerbar_toggleitem( |
125 UiToolbarToggleItem *item, |
126 UiToolbarToggleItem *item, |
126 UiObject *obj, |
127 UiObject *obj, |
127 enum UiToolbarPos pos) |
128 enum UiToolbarPos pos) |
128 { |
129 { |
129 GtkWidget *button = gtk_toggle_button_new(); |
130 GtkWidget *button = gtk_toggle_button_new(); |
|
131 ui_set_widget_groups(obj->ctx, button, item->args.groups); |
130 WIDGET_ADD_CSS_CLASS(button, "flat"); |
132 WIDGET_ADD_CSS_CLASS(button, "flat"); |
131 ui_setup_togglebutton(obj, button, item->args.label, item->args.icon, item->args.varname, NULL, item->args.onchange, item->args.onchangedata, 0); |
133 ui_setup_togglebutton(obj, button, item->args.label, item->args.icon, item->args.varname, NULL, item->args.onchange, item->args.onchangedata, 0); |
132 headerbar_add(headerbar, box, button, pos); |
134 headerbar_add(headerbar, box, button, pos); |
133 } |
135 } |
134 |
136 |