Diff of /src/document.c [7e3a23] .. [35cc44]  Maximize  Restore

Switch to side-by-side view

--- a/src/document.c
+++ b/src/document.c
@@ -2771,6 +2771,25 @@
 		return NULL;
 	if (! document_status_styles[status].loaded)
 	{
+#if GTK_CHECK_VERSION(3, 0, 0)
+		GdkRGBA color;
+		GtkWidgetPath *path = gtk_widget_path_new();
+		GtkStyleContext *ctx = gtk_style_context_new();
+		gtk_widget_path_append_type(path, GTK_TYPE_WINDOW);
+		gtk_widget_path_append_type(path, GTK_TYPE_BOX);
+		gtk_widget_path_append_type(path, GTK_TYPE_NOTEBOOK);
+		gtk_widget_path_append_type(path, GTK_TYPE_LABEL);
+		gtk_widget_path_iter_set_name(path, -1, document_status_styles[status].name);
+		gtk_style_context_set_screen(ctx, gtk_widget_get_screen(GTK_WIDGET(doc->editor->sci)));
+		gtk_style_context_set_path(ctx, path);
+		gtk_style_context_get_color(ctx, GTK_STATE_NORMAL, &color);
+		document_status_styles[status].color.red   = 0xffff * color.red;
+		document_status_styles[status].color.green = 0xffff * color.green;
+		document_status_styles[status].color.blue  = 0xffff * color.blue;
+		document_status_styles[status].loaded = TRUE;
+		gtk_widget_path_unref(path);
+		g_object_unref(ctx);
+#else
 		GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(doc->editor->sci));
 		gchar *path = g_strconcat("GeanyMainWindow.GtkHBox.GtkNotebook.",
 				document_status_styles[status].name, NULL);
@@ -2779,6 +2798,7 @@
 		document_status_styles[status].color = style->fg[GTK_STATE_NORMAL];
 		document_status_styles[status].loaded = TRUE;
 		g_free(path);
+#endif
 	}
 	return &document_status_styles[status].color;
 }

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks