ui/gtk/toolkit.c

changeset 42
9af327d0e0e4
parent 39
ef4e2f560fa5
child 44
473954dc6b74
equal deleted inserted replaced
41:7ada3db4cfa8 42:9af327d0e0e4
302 " padding: 0px;" 302 " padding: 0px;"
303 "}"; 303 "}";
304 304
305 void ui_css_init(void) { 305 void ui_css_init(void) {
306 ui_gtk_css_provider = gtk_css_provider_new(); 306 ui_gtk_css_provider = gtk_css_provider_new();
307
308 #ifdef UI_GTK3
307 gtk_css_provider_load_from_data(ui_gtk_css_provider, ui_gtk_css, -1, NULL); 309 gtk_css_provider_load_from_data(ui_gtk_css_provider, ui_gtk_css, -1, NULL);
308 310
309 GdkScreen *screen = gdk_screen_get_default(); 311 GdkScreen *screen = gdk_screen_get_default();
310 gtk_style_context_add_provider_for_screen( 312 gtk_style_context_add_provider_for_screen(
311 screen, 313 screen,
312 GTK_STYLE_PROVIDER(ui_gtk_css_provider), 314 GTK_STYLE_PROVIDER(ui_gtk_css_provider),
313 GTK_STYLE_PROVIDER_PRIORITY_USER); 315 GTK_STYLE_PROVIDER_PRIORITY_USER);
314 } 316 #endif /* UI_GTK3 */
315 317
316 318 #ifdef UI_GTK4
317 319
318 #endif 320
321 #if GTK_MINOR_VERSION < 12
322 gtk_css_provider_load_from_data(ui_gtk_css_provider, ui_gtk_css, -1);
323 #else
324 gtk_css_provider_load_from_string(ui_gtk_css_provider, ui_gtk_css);
325 #endif /* GTK_MINOR_VERSION < 12 */
326
327 GdkDisplay *display = gdk_display_get_default();
328 gtk_style_context_add_provider_for_display(display, GTK_STYLE_PROVIDER(ui_gtk_css_provider), GTK_STYLE_PROVIDER_PRIORITY_USER);
329
330 #endif /* UI_GTK4 */
331 }
332
333
334
335 #endif

mercurial