ui/gtk/toolkit.c

branch
newapi
changeset 310
4918f9132552
parent 302
b00cbbfeec7a
--- a/ui/gtk/toolkit.c	Mon Sep 23 23:22:27 2024 +0200
+++ b/ui/gtk/toolkit.c	Thu Sep 26 22:43:13 2024 +0200
@@ -314,12 +314,44 @@
 
 static GtkCssProvider* ui_gtk_css_provider;
 
+#if GTK_MAJOR_VERSION == 4
+static const char *ui_gtk_css = 
+"#path-textfield-box {\n"
+"  background-color: alpha(currentColor, 0.1);"
+"  border-radius: 6px;"
+"  padding: 0px;"
+"}\n"
+".pathbar-extra-button {\n"
+"  border-top-right-radius: 6px;"
+"  border-bottom-right-radius: 6px;"
+"  border-top-left-radius: 0px;"
+"  border-bottom-left-radius: 0px;"
+"}\n"
+"#pathbar button {\n"
+"  margin: 3px;"
+"  border-radius: 4px;"
+"  padding-top: 0px;"
+"  padding-bottom: 0px;"
+"  padding-left: 8px;"
+"  padding-right: 8px;"
+"}\n"
+"#path-textfield-box entry {\n"
+"  background-color: #00000000;"
+"  border-top-left-radius: 6px;"
+"  border-bottom-left-radius: 6px;"
+"  border-top-right-radius: 0px;"
+"  border-bottom-right-radius: 0px;"
+"}"
+;
+
+#elif GTK_MAJOR_VERSION == 3
 static const char *ui_gtk_css = 
 "#path-textfield-box {"
 "  background-color: @theme_base_color;"
 "  border-radius: 5px;"
 "  padding: 0px;"
 "}";
+#endif
 
 void ui_css_init(void) {
     ui_gtk_css_provider = gtk_css_provider_new();
@@ -344,7 +376,7 @@
 #endif /* GTK_MINOR_VERSION < 12 */
     
     GdkDisplay *display = gdk_display_get_default();
-    gtk_style_context_add_provider_for_display(display, GTK_STYLE_PROVIDER(ui_gtk_css_provider), GTK_STYLE_PROVIDER_PRIORITY_USER);
+    gtk_style_context_add_provider_for_display(display, GTK_STYLE_PROVIDER(ui_gtk_css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
     
 #endif /* UI_GTK4 */
 }

mercurial