ui/gtk/toolkit.c

branch
newapi
changeset 282
3a77b9048664
parent 280
e3565cf7c831
child 290
0dcf13ba5a78
--- a/ui/gtk/toolkit.c	Sun Jun 09 10:24:49 2024 +0200
+++ b/ui/gtk/toolkit.c	Sun Jun 09 15:26:20 2024 +0200
@@ -72,6 +72,8 @@
     gtk_init(&argc, &argv);
     application_name = appname;
     
+    ui_css_init();
+    
     uic_docmgr_init();
     
     uic_toolbar_init();
@@ -287,3 +289,28 @@
 }
 
 
+#if GTK_MAJOR_VERSION >= 3
+
+static GtkCssProvider* ui_gtk_css_provider;
+
+static const char *ui_gtk_css = 
+"#path-textfield-box {"
+"  background-color: @theme_base_color;"
+"  border-radius: 5px;"
+"  padding: 0px;"
+"}";
+
+void ui_css_init(void) {
+    ui_gtk_css_provider = gtk_css_provider_new();
+    gtk_css_provider_load_from_data(ui_gtk_css_provider, ui_gtk_css, -1, NULL);
+    
+    GdkScreen *screen = gdk_screen_get_default();
+    gtk_style_context_add_provider_for_screen(
+            screen,
+            GTK_STYLE_PROVIDER(ui_gtk_css_provider),
+            GTK_STYLE_PROVIDER_PRIORITY_USER);
+}
+
+
+
+#endif
\ No newline at end of file

mercurial