312 |
312 |
313 #if GTK_MAJOR_VERSION >= 3 |
313 #if GTK_MAJOR_VERSION >= 3 |
314 |
314 |
315 static GtkCssProvider* ui_gtk_css_provider; |
315 static GtkCssProvider* ui_gtk_css_provider; |
316 |
316 |
|
317 #if GTK_MAJOR_VERSION == 4 |
|
318 static const char *ui_gtk_css = |
|
319 "#path-textfield-box {\n" |
|
320 " background-color: alpha(currentColor, 0.1);" |
|
321 " border-radius: 6px;" |
|
322 " padding: 0px;" |
|
323 "}\n" |
|
324 ".pathbar-extra-button {\n" |
|
325 " border-top-right-radius: 6px;" |
|
326 " border-bottom-right-radius: 6px;" |
|
327 " border-top-left-radius: 0px;" |
|
328 " border-bottom-left-radius: 0px;" |
|
329 "}\n" |
|
330 "#pathbar button {\n" |
|
331 " margin: 3px;" |
|
332 " border-radius: 4px;" |
|
333 " padding-top: 0px;" |
|
334 " padding-bottom: 0px;" |
|
335 " padding-left: 8px;" |
|
336 " padding-right: 8px;" |
|
337 "}\n" |
|
338 "#path-textfield-box entry {\n" |
|
339 " background-color: #00000000;" |
|
340 " border-top-left-radius: 6px;" |
|
341 " border-bottom-left-radius: 6px;" |
|
342 " border-top-right-radius: 0px;" |
|
343 " border-bottom-right-radius: 0px;" |
|
344 "}" |
|
345 ; |
|
346 |
|
347 #elif GTK_MAJOR_VERSION == 3 |
317 static const char *ui_gtk_css = |
348 static const char *ui_gtk_css = |
318 "#path-textfield-box {" |
349 "#path-textfield-box {" |
319 " background-color: @theme_base_color;" |
350 " background-color: @theme_base_color;" |
320 " border-radius: 5px;" |
351 " border-radius: 5px;" |
321 " padding: 0px;" |
352 " padding: 0px;" |
322 "}"; |
353 "}"; |
|
354 #endif |
323 |
355 |
324 void ui_css_init(void) { |
356 void ui_css_init(void) { |
325 ui_gtk_css_provider = gtk_css_provider_new(); |
357 ui_gtk_css_provider = gtk_css_provider_new(); |
326 |
358 |
327 #ifdef UI_GTK3 |
359 #ifdef UI_GTK3 |
342 #else |
374 #else |
343 gtk_css_provider_load_from_string(ui_gtk_css_provider, ui_gtk_css); |
375 gtk_css_provider_load_from_string(ui_gtk_css_provider, ui_gtk_css); |
344 #endif /* GTK_MINOR_VERSION < 12 */ |
376 #endif /* GTK_MINOR_VERSION < 12 */ |
345 |
377 |
346 GdkDisplay *display = gdk_display_get_default(); |
378 GdkDisplay *display = gdk_display_get_default(); |
347 gtk_style_context_add_provider_for_display(display, GTK_STYLE_PROVIDER(ui_gtk_css_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); |
379 gtk_style_context_add_provider_for_display(display, GTK_STYLE_PROVIDER(ui_gtk_css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); |
348 |
380 |
349 #endif /* UI_GTK4 */ |
381 #endif /* UI_GTK4 */ |
350 } |
382 } |
351 |
383 |
352 |
384 |