| 161 GtkWidget *box, |
161 GtkWidget *box, |
| 162 UiToolbarItem *item, |
162 UiToolbarItem *item, |
| 163 UiObject *obj, |
163 UiObject *obj, |
| 164 enum UiToolbarPos pos) |
164 enum UiToolbarPos pos) |
| 165 { |
165 { |
| 166 GtkWidget *button = ui_create_button(obj, item->args.label, item->args.icon, item->args.onclick, item->args.onclickdata, 0, FALSE); |
166 GtkWidget *button = ui_create_button(obj, item->args.label, item->args.icon, item->args.tooltip, item->args.onclick, item->args.onclickdata, 0, FALSE); |
| 167 ui_set_widget_groups(obj->ctx, button, item->args.groups); |
167 ui_set_widget_groups(obj->ctx, button, item->args.groups); |
| 168 WIDGET_ADD_CSS_CLASS(button, "flat"); |
168 WIDGET_ADD_CSS_CLASS(button, "flat"); |
| 169 headerbar_add(headerbar, box, button, pos); |
169 headerbar_add(headerbar, box, button, pos); |
| 170 } |
170 } |
| 171 |
171 |
| 177 enum UiToolbarPos pos) |
177 enum UiToolbarPos pos) |
| 178 { |
178 { |
| 179 GtkWidget *button = gtk_toggle_button_new(); |
179 GtkWidget *button = gtk_toggle_button_new(); |
| 180 ui_set_widget_groups(obj->ctx, button, item->args.groups); |
180 ui_set_widget_groups(obj->ctx, button, item->args.groups); |
| 181 WIDGET_ADD_CSS_CLASS(button, "flat"); |
181 WIDGET_ADD_CSS_CLASS(button, "flat"); |
| 182 ui_setup_togglebutton(obj, button, item->args.label, item->args.icon, item->args.varname, NULL, item->args.onchange, item->args.onchangedata, 0); |
182 ui_setup_togglebutton(obj, button, item->args.label, item->args.icon, item->args.tooltip, item->args.varname, NULL, item->args.onchange, item->args.onchangedata, 0); |
| 183 headerbar_add(headerbar, box, button, pos); |
183 headerbar_add(headerbar, box, button, pos); |
| 184 } |
184 } |
| 185 |
185 |
| 186 void ui_add_headerbar_menu( |
186 void ui_add_headerbar_menu( |
| 187 GtkWidget *headerbar, |
187 GtkWidget *headerbar, |