[geany/geany] 6897cd: Make use of theme icon a various pref.
Lex
git-noreply at geany.org
Sun Oct 14 02:05:11 UTC 2012
Branch: refs/heads/master
Author: Lex <elextr at gmail.com>
Committer: Lex <elextr at gmail.com>
Date: Sun, 14 Oct 2012 02:05:11
Commit: 6897cd49c69535c6563e56ae011c6f8382fec485
https://github.com/geany/geany/commit/6897cd49c69535c6563e56ae011c6f8382fec485
Log Message:
-----------
Make use of theme icon a various pref.
Some users want the theme icon, some dislike the icon provided by
their theme and want the traditional Geany icon.
This makes that choice a various pref. Used a standalone global
to avoid impacting the plugin interface and CommandLineOptions
and GeanyStatus didn't make sense.
Modified Paths:
--------------
src/keyfile.c
src/main.c
src/main.h
Modified: src/keyfile.c
4 files changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -240,6 +240,10 @@ static void init_pref_groups(void)
"number_non_ft_menu_items", 0);
stash_group_add_integer(group, &build_menu_prefs.number_exec_menu_items,
"number_exec_menu_items", 0);
+
+ /* use the Geany icon instead of the theme */
+ stash_group_add_boolean(group, &main_use_geany_icon,
+ "use_geany_icon", TRUE);
}
Modified: src/main.c
20 files changed, 14 insertions(+), 6 deletions(-)
===================================================================
@@ -90,6 +90,7 @@
GeanyStatus main_status;
CommandLineOptions cl_options; /* fields initialised in parse_command_line_options */
+gboolean main_use_geany_icon;
static const gchar geany_lib_versions[] = "GTK %u.%u.%u, GLib %u.%u.%u";
@@ -1060,12 +1061,19 @@ gint main(gint argc, gchar **argv)
/* set window icon */
{
GdkPixbuf *pb;
- pb = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "geany", 48, 0, NULL);
- if (pb == NULL)
- {
- g_warning("Unable to find Geany icon in theme, using embedded icon");
- pb = ui_new_pixbuf_from_inline(GEANY_IMAGE_LOGO);
- }
+ if (main_use_geany_icon)
+ {
+ pb = ui_new_pixbuf_from_inline(GEANY_IMAGE_LOGO);
+ }
+ else
+ {
+ pb = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "geany", 48, 0, NULL);
+ if (pb == NULL)
+ {
+ g_warning("Unable to find Geany icon in theme, using embedded icon");
+ pb = ui_new_pixbuf_from_inline(GEANY_IMAGE_LOGO);
+ }
+ }
gtk_window_set_icon(GTK_WINDOW(main_widgets.window), pb);
g_object_unref(pb); /* free our reference */
}
Modified: src/main.h
2 files changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -51,6 +51,8 @@
extern GeanyStatus main_status;
+extern gboolean main_use_geany_icon;
+
const gchar *main_get_version_string(void);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
More information about the Commits
mailing list