Branch: refs/heads/gtk3-support Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Tue, 09 Oct 2012 11:25:12 UTC Commit: f735e6800bddcffc1819b480601be658560f0256 https://github.com/geany/geany/commit/f735e6800bddcffc1819b480601be658560f02...
Log Message: ----------- Add GTK3 version of our custom styles
Although GTK3 still have gtk_rc_parse_string(), it doesn't work anymore for our overrides, so register proper CSS for them.
Modified Paths: -------------- Makefile.am configure.ac data/geany.css src/ui_utils.c
Modified: Makefile.am 7 files changed, 6 insertions(+), 1 deletions(-) =================================================================== @@ -24,8 +24,13 @@ SYS_DATA_FILES = \ $(srcdir)/data/templates/* \ $(srcdir)/data/templates/files/* \ $(srcdir)/data/colorschemes/* \ - $(top_srcdir)/data/geany.glade \ + $(top_srcdir)/data/geany.glade + +if GTK3 + $(top_srcdir)/data/geany.css +else $(top_srcdir)/data/geany.gtkrc +endif
EXTRA_DIST = \ autogen.sh \
Modified: configure.ac 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -67,6 +67,7 @@ AS_IF([test "x$enable_gtk3" = xyes], gtk_min_version=3.0], [gtk_package=gtk+-2.0 gtk_min_version=2.16]) +AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
# GTK/GLib/GIO checks gtk_modules="$gtk_package >= $gtk_min_version glib-2.0 >= 2.20"
Modified: data/geany.css 25 files changed, 25 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,25 @@ +/* custom GTK3 CSS for Geany */ + +/* make close button on the editor's tabs smaller */ +#geany-close-tab-button { + -GtkWidget-focus-padding: 0; + -GtkWidget-focus-line-width: 0; + -GtkButton-default-border: 0; + -GtkButton-default-outside-border: 0; + -GtkButton-inner-border: 0; + padding: 0; +} + +/* use monospaced font in search entries for easier reading of regexp (#1907117) */ +#GeanyDialogSearch GtkEntry { + font-family: monospace; +} + +/* set red background for GtkEntries showing unmatched searches */ +#geany-search-entry-no-match { + color: #fff; + background: #ff6666; +} +#geany-search-entry-no-match:selected { + background-color: #771111; +}
Modified: src/ui_utils.c 20 files changed, 20 insertions(+), 0 deletions(-) =================================================================== @@ -2260,10 +2260,30 @@ void ui_init_builder(void)
static void init_custom_style(void) { +#if GTK_CHECK_VERSION(3, 0, 0) + gchar *css_file = g_build_filename(app->datadir, "geany.css", NULL); + GtkCssProvider *css = gtk_css_provider_new(); + GError *error = NULL; + + if (! gtk_css_provider_load_from_path(css, css_file, &error)) + { + g_warning("Failed to load custom CSS: %s", error->message); + g_error_free(error); + } + else + { + gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), + GTK_STYLE_PROVIDER(css), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } + + g_object_unref(css); + g_free(css_file); +#else gchar *gtkrc_file = g_build_filename(app->datadir, "geany.gtkrc", NULL);
gtk_rc_parse(gtkrc_file); g_free(gtkrc_file); +#endif }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).