diff options
-rw-r--r-- | Makefile.am | 7 | ||||
-rw-r--r-- | ico/sciteco-16.png | bin | 0 -> 320 bytes | |||
-rw-r--r-- | ico/sciteco-256.png | bin | 0 -> 262927 bytes | |||
-rw-r--r-- | ico/sciteco-32.png | bin | 0 -> 1949 bytes | |||
-rw-r--r-- | src/interface-gtk/interface-gtk.cpp | 26 |
5 files changed, 25 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am index ddd8ed4..67a9d0f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,11 +8,12 @@ noinst_HEADERS = compat/bsd/sys/cdefs.h \ EXTRA_DIST = README TODO -# Only the PNG icon is installed as it is +# Only the lower resolution PNG icons are installed as they are # required by the GTK UI. # Other uses are left to the distro package manager. -dist_pkgdata_DATA += ico/sciteco-48.png -EXTRA_DIST += ico/sciteco.ico +dist_pkgdata_DATA += ico/sciteco-16.png ico/sciteco-32.png \ + ico/sciteco-48.png +EXTRA_DIST += ico/sciteco-256.png ico/sciteco.ico # Distribute entire scintilla directory and # do some manual cleanup diff --git a/ico/sciteco-16.png b/ico/sciteco-16.png Binary files differnew file mode 100644 index 0000000..e52d2cc --- /dev/null +++ b/ico/sciteco-16.png diff --git a/ico/sciteco-256.png b/ico/sciteco-256.png Binary files differnew file mode 100644 index 0000000..30734e6 --- /dev/null +++ b/ico/sciteco-256.png diff --git a/ico/sciteco-32.png b/ico/sciteco-32.png Binary files differnew file mode 100644 index 0000000..775d729 --- /dev/null +++ b/ico/sciteco-32.png diff --git a/src/interface-gtk/interface-gtk.cpp b/src/interface-gtk/interface-gtk.cpp index 9b0b0aa..b204caa 100644 --- a/src/interface-gtk/interface-gtk.cpp +++ b/src/interface-gtk/interface-gtk.cpp @@ -36,6 +36,7 @@ */ #define GDK_DISABLE_DEPRECATION_WARNINGS #include <gdk/gdk.h> +#include <gdk-pixbuf/gdk-pixbuf.h> #include <gtk/gtk.h> #include "gtk-info-popup.h" @@ -401,6 +402,14 @@ InterfaceGtk::widget_set_font(GtkWidget *widget, const gchar *font_name) void InterfaceGtk::event_loop_impl(void) { + static const gchar *icon_files[] = { + SCITECODATADIR G_DIR_SEPARATOR_S "sciteco-16.png", + SCITECODATADIR G_DIR_SEPARATOR_S "sciteco-32.png", + SCITECODATADIR G_DIR_SEPARATOR_S "sciteco-48.png", + NULL + }; + + GList *icon_list = NULL; GThread *thread; /* @@ -408,12 +417,19 @@ InterfaceGtk::event_loop_impl(void) * If the file could not be found, we fail silently. * FIXME: On Windows, it may be better to load the icon compiled * as a resource into the binary. - * FIXME: Provide all the different icon sizes we have - * (gtk_window_set_default_icon_list()). */ - gtk_window_set_default_icon_from_file(SCITECODATADIR G_DIR_SEPARATOR_S - "sciteco-48.png", - NULL); + for (const gchar **file = icon_files; *file; file++) { + GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_file(*file, NULL); + + /* fail silently if there's a problem with one of the icons */ + if (icon_pixbuf) + icon_list = g_list_append(icon_list, icon_pixbuf); + } + + gtk_window_set_default_icon_list(icon_list); + + if (icon_list) + g_list_free_full(icon_list, g_object_unref); /* * When changing views, the new widget is not |