Branch: refs/heads/gtk3-support Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Mon, 11 Feb 2013 03:47:21 UTC Commit: e0104a4bc26461b848c61c06cf885a3b6adf469e https://github.com/geany/geany/commit/e0104a4bc26461b848c61c06cf885a3b6adf46...
Log Message: ----------- Port new configurable document status colors to GTK3
Modified Paths: -------------- data/geany.css src/document.c
Modified: data/geany.css 11 files changed, 11 insertions(+), 0 deletions(-) =================================================================== @@ -23,3 +23,14 @@ #geany-search-entry-no-match:selected { background-color: #771111; } + +/* document status colors */ +#geany-document-status-changed { + color: #ff0000; +} +#geany-document-status-disk-changed { + color: #ff7f00; +} +#geany-document-status-readonly { + color: #007f00; +}
Modified: src/document.c 20 files changed, 20 insertions(+), 0 deletions(-) =================================================================== @@ -2770,6 +2770,25 @@ const GdkColor *document_get_status_color(GeanyDocument *doc) 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); @@ -2778,6 +2797,7 @@ const GdkColor *document_get_status_color(GeanyDocument *doc) 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; }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).