Kaydet (Commit) 6897cd49 authored tarafından Lex's avatar Lex

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.
üst 4c7ca69b
......@@ -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);
}
......
......@@ -90,6 +90,7 @@ gboolean ignore_callback; /* hack workaround for GTK+ toggle button callback pro
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 */
}
......
......@@ -51,6 +51,8 @@ GeanyStatus;
extern GeanyStatus main_status;
extern gboolean main_use_geany_icon;
const gchar *main_get_version_string(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment