ui/gtk/toolkit.c

changeset 56
294d5515583a
parent 51
e324291ca9f8
equal deleted inserted replaced
55:1ce14068ef31 56:294d5515583a
164 gtk_widget_show_all(obj->widget); 164 gtk_widget_show_all(obj->widget);
165 #endif 165 #endif
166 } 166 }
167 167
168 void ui_close(UiObject *obj) { 168 void ui_close(UiObject *obj) {
169 // TODO 169 #if GTK_CHECK_VERSION(4, 0, 0)
170 //gtk_widget_destroy(obj->widget); 170 gtk_window_close(GTK_WINDOW(obj->widget));
171 #else
172 gtk_widget_destroy(obj->widget);
173 #endif
171 } 174 }
172 175
173 176
174 static gboolean ui_job_finished(void *data) { 177 static gboolean ui_job_finished(void *data) {
175 UiJob *job = data; 178 UiJob *job = data;
343 " border-bottom-right-radius: 0px;" 346 " border-bottom-right-radius: 0px;"
344 "}\n" 347 "}\n"
345 ".pathbar-button-inactive {\n" 348 ".pathbar-button-inactive {\n"
346 " color: alpha(currentColor, 0.5);" 349 " color: alpha(currentColor, 0.5);"
347 "}\n" 350 "}\n"
351 ".ui_test {\n"
352 " background-color: red;\n"
353 "}\n"
348 ; 354 ;
349 355
350 #elif GTK_MAJOR_VERSION == 3 356 #elif GTK_MAJOR_VERSION == 3
351 static const char *ui_gtk_css = 357 static const char *ui_gtk_css =
352 "#path-textfield-box {" 358 "#path-textfield-box {"
407 } 413 }
408 free(cls); 414 free(cls);
409 415
410 } 416 }
411 } 417 }
418
419 void ui_set_widget_groups(UiContext *ctx, GtkWidget *widget, const int *groups) {
420 if(!groups) {
421 return;
422 }
423
424 size_t ngroups = uic_group_array_size(groups);
425 uic_add_group_widget_i(ctx, widget, (ui_enablefunc)ui_set_enabled, groups, ngroups);
426 ui_set_enabled(widget, FALSE);
427 }

mercurial