From: Andy Spencer Date: Tue, 6 Sep 2011 05:07:35 +0000 (+0000) Subject: Add new application icons X-Git-Tag: v0.5.2~8 X-Git-Url: http://pileus.org/git/?p=aweather;a=commitdiff_plain;h=5d02e9824afbc67d431e3d3e59797425f91cddcd Add new application icons The new icon is works better with different background colors, it also avoids using flat background colors or borders. The small icons (less than 32) pixels do not includes the sun in the background because it is difficult to see at such small sizes and just add clutter. The old icon is kept as logo.svg and is used in the about dialog. It may be converted to use the new icon eventually as well. --- diff --git a/aweather.nsi b/aweather.nsi index c897f01..5db4eec 100644 --- a/aweather.nsi +++ b/aweather.nsi @@ -23,7 +23,7 @@ name "AWeather" outFile "aweather-${VERSION}.exe" !endif installDir AWeather -Icon "data/aweather.ico" +Icon "data/icons/48x48/aweather.ico" !define MUI_ABORTWARNING diff --git a/data/.gitignore b/data/.gitignore index 0b45144..27de9f1 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -1,4 +1,3 @@ -*.png *.ico aweather main.ui diff --git a/data/Makefile.am b/data/Makefile.am index ad651d1..f644750 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -4,24 +4,38 @@ dist_gtkbuilder_DATA = main.ui configdir = $(datadir)/aweather/ dist_config_DATA = defaults.ini +logodir = $(datadir)/aweather/ +logo_DATA = logo.svg + colordir = $(datadir)/aweather/colors/ dist_color_DATA = colors/*.clr if WIN32 -noinst_DATA = aweather.ico +noinst_DATA = icons/48x48/aweather.ico else desktopdir = $(datadir)/applications dist_desktop_DATA = aweather.desktop -pixmapdir = $(datadir)/pixmaps -dist_pixmap_DATA = aweather.png +icon16dir = $(datadir)/icons/hicolor/16x16/apps/ +icon22dir = $(datadir)/icons/hicolor/22x22/apps/ +icon24dir = $(datadir)/icons/hicolor/24x24/apps/ +icon32dir = $(datadir)/icons/hicolor/32x32/apps/ +icon48dir = $(datadir)/icons/hicolor/48x48/apps/ +iconSCdir = $(datadir)/icons/hicolor/scalable/apps + +icon16_DATA = icons/16x16/aweather.png +icon22_DATA = icons/22x22/aweather.png +icon24_DATA = icons/24x24/aweather.png +icon32_DATA = icons/32x32/aweather.png +iconSC_DATA = icons/scalable/aweather.svg + +install-data-hook: + gtk-update-icon-cache -f -t $(datadir)/icons/hicolor endif glade: GLADE_CATALOG_PATH=. glade-3 main.ui.in -.svg.png: - rsvg -w 48 -h 48 $< $@ .png.ico: icotool -c $< -o $@ diff --git a/data/aweather.desktop b/data/aweather.desktop index 7019aca..d06877b 100644 --- a/data/aweather.desktop +++ b/data/aweather.desktop @@ -4,5 +4,5 @@ Name=AWeather Comment=Advanced weather reporting program Exec=aweather Terminal=false -Icon=aweather.png +Icon=aweather Categories=Education;Science;Geoscience diff --git a/data/icons/16x16/aweather.png b/data/icons/16x16/aweather.png new file mode 100644 index 0000000..de90ffc Binary files /dev/null and b/data/icons/16x16/aweather.png differ diff --git a/data/icons/16x16/aweather.xcf b/data/icons/16x16/aweather.xcf new file mode 100644 index 0000000..d702012 Binary files /dev/null and b/data/icons/16x16/aweather.xcf differ diff --git a/data/icons/22x22/aweather.png b/data/icons/22x22/aweather.png new file mode 100644 index 0000000..7b7200e Binary files /dev/null and b/data/icons/22x22/aweather.png differ diff --git a/data/icons/22x22/aweather.xcf b/data/icons/22x22/aweather.xcf new file mode 100644 index 0000000..74e3a5c Binary files /dev/null and b/data/icons/22x22/aweather.xcf differ diff --git a/data/icons/24x24/aweather.png b/data/icons/24x24/aweather.png new file mode 100644 index 0000000..3ca8695 Binary files /dev/null and b/data/icons/24x24/aweather.png differ diff --git a/data/icons/24x24/aweather.xcf b/data/icons/24x24/aweather.xcf new file mode 100644 index 0000000..cfb80f8 Binary files /dev/null and b/data/icons/24x24/aweather.xcf differ diff --git a/data/icons/32x32/aweather.png b/data/icons/32x32/aweather.png new file mode 100644 index 0000000..2f3582a Binary files /dev/null and b/data/icons/32x32/aweather.png differ diff --git a/data/icons/32x32/aweather.xcf b/data/icons/32x32/aweather.xcf new file mode 100644 index 0000000..99844ad Binary files /dev/null and b/data/icons/32x32/aweather.xcf differ diff --git a/data/icons/48x48/aweather.png b/data/icons/48x48/aweather.png new file mode 100644 index 0000000..2b30a1c Binary files /dev/null and b/data/icons/48x48/aweather.png differ diff --git a/data/icons/48x48/aweather.xcf b/data/icons/48x48/aweather.xcf new file mode 100644 index 0000000..69943b8 Binary files /dev/null and b/data/icons/48x48/aweather.xcf differ diff --git a/data/icons/scalable/aweather.svg b/data/icons/scalable/aweather.svg new file mode 100644 index 0000000..66996c7 --- /dev/null +++ b/data/icons/scalable/aweather.svg @@ -0,0 +1,279 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/aweather.svg b/data/logo.svg similarity index 100% rename from data/aweather.svg rename to data/logo.svg diff --git a/data/main.ui.in b/data/main.ui.in index 0aeb93d..34fbbe9 100644 --- a/data/main.ui.in +++ b/data/main.ui.in @@ -320,6 +320,7 @@ The hypothetical commands `show w' and `show c' should show the appropriate part The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>. Andy Spencer <andy753421@gmail.com> + logo.svg True diff --git a/src/Makefile.am b/src/Makefile.am index 7203aa0..d3861eb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,6 +10,7 @@ aweather_SOURCES = main.c \ aweather-location.c aweather-location.h aweather_CPPFLAGS = \ -DHTMLDIR="\"$(dots)$(htmldir)\"" \ + -DICONDIR="\"$(dots)$(datadir)/icons\"" \ -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ -DPLUGINSDIR="\"$(dots)$(pkglibdir)\"" aweather_LDADD = $(GRITS_LIBS) diff --git a/src/aweather-gui.c b/src/aweather-gui.c index c349d12..6d8e423 100644 --- a/src/aweather-gui.c +++ b/src/aweather-gui.c @@ -441,6 +441,27 @@ static void time_setup(AWeatherGui *self) G_CALLBACK(update_time_widget), self); } +static void icons_setup(AWeatherGui *self) +{ + gchar *icons[] = { + ICONDIR "/hicolor/16x16/apps/aweather.png", + ICONDIR "/hicolor/22x22/apps/aweather.png", + ICONDIR "/hicolor/24x24/apps/aweather.png", + ICONDIR "/hicolor/32x32/apps/aweather.png", + ICONDIR "/hicolor/48x48/apps/aweather.png", + ICONDIR "/hicolor/scalable/apps/aweather.svg", + }; + GList *list = NULL; + for (int i = 0; i < G_N_ELEMENTS(icons); i++) { + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(icons[i], NULL); + if (!pixbuf) + g_warning("AWeatherGui: icons_setup - %s failed", icons[i]); + list = g_list_prepend(list, pixbuf); + } + gtk_window_set_default_icon_list(list); + g_list_free(list); +} + /*********** * Methods * @@ -549,6 +570,7 @@ static void aweather_gui_parser_finished(GtkBuildable *_self, GtkBuilder *builde site_setup(self); time_setup(self); prefs_setup(self); + icons_setup(self); /* Connect signals */ gtk_builder_connect_signals(self->builder, self);