From: Jim Evins Date: Sat, 4 Sep 2010 16:12:58 +0000 (-0400) Subject: Theme friendly app icons. X-Git-Tag: glabels-2_3_1~207 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3fd4017b3e2461638683b3753b96c7484e7d4ed2;p=glabels Theme friendly app icons. --- diff --git a/configure.ac b/configure.ac index d3ee342c..a889716e 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,7 @@ AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource) AC_PATH_PROG(UPDATE_MIME_DATABASE, update-mime-database) AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, update-desktop-database) +AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache) dnl --------------------------------------------------------------------------- dnl - GLABELS branch @@ -275,11 +276,17 @@ src/Makefile src/pixmaps/Makefile src/stock-pixmaps/Makefile data/Makefile -data/pixmaps/Makefile -data/mime/Makefile -data/ui/Makefile data/desktop/Makefile +data/icons/Makefile +data/icons/16x16/Makefile +data/icons/22x22/Makefile +data/icons/24x24/Makefile +data/icons/32x32/Makefile +data/icons/48x48/Makefile data/man/Makefile +data/mime/Makefile +data/pixmaps/Makefile +data/ui/Makefile templates/Makefile po/Makefile.in help/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index 1a11481f..ed0a3699 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = desktop man mime pixmaps ui +SUBDIRS = desktop icons man mime pixmaps ui diff --git a/data/icons/16x16/Makefile.am b/data/icons/16x16/Makefile.am new file mode 100644 index 00000000..de73342e --- /dev/null +++ b/data/icons/16x16/Makefile.am @@ -0,0 +1,11 @@ + +size = 16x16 +appiconsdir = $(datadir)/icons/hicolor/$(size)/apps + +appicons_DATA = \ + apps/glabels-3.0.png + +noinst_DATA = + +EXTRA_DIST = $(appicons_DATA) \ + $(noinst_DATA) diff --git a/data/icons/16x16/apps/glabels-3.0.png b/data/icons/16x16/apps/glabels-3.0.png new file mode 100644 index 00000000..4e244e33 Binary files /dev/null and b/data/icons/16x16/apps/glabels-3.0.png differ diff --git a/data/icons/22x22/Makefile.am b/data/icons/22x22/Makefile.am new file mode 100644 index 00000000..955d8609 --- /dev/null +++ b/data/icons/22x22/Makefile.am @@ -0,0 +1,11 @@ + +size = 22x22 +appiconsdir = $(datadir)/icons/hicolor/$(size)/apps + +appicons_DATA = \ + apps/glabels-3.0.png + +noinst_DATA = + +EXTRA_DIST = $(appicons_DATA) \ + $(noinst_DATA) diff --git a/data/icons/22x22/apps/glabels-3.0.png b/data/icons/22x22/apps/glabels-3.0.png new file mode 100644 index 00000000..ea1ee024 Binary files /dev/null and b/data/icons/22x22/apps/glabels-3.0.png differ diff --git a/data/icons/24x24/Makefile.am b/data/icons/24x24/Makefile.am new file mode 100644 index 00000000..baf6b8ef --- /dev/null +++ b/data/icons/24x24/Makefile.am @@ -0,0 +1,11 @@ + +size = 24x24 +appiconsdir = $(datadir)/icons/hicolor/$(size)/apps + +appicons_DATA = \ + apps/glabels-3.0.png + +noinst_DATA = + +EXTRA_DIST = $(appicons_DATA) \ + $(noinst_DATA) diff --git a/data/icons/24x24/apps/glabels-3.0.png b/data/icons/24x24/apps/glabels-3.0.png new file mode 100644 index 00000000..8e876e29 Binary files /dev/null and b/data/icons/24x24/apps/glabels-3.0.png differ diff --git a/data/icons/32x32/Makefile.am b/data/icons/32x32/Makefile.am new file mode 100644 index 00000000..c792c3da --- /dev/null +++ b/data/icons/32x32/Makefile.am @@ -0,0 +1,11 @@ + +size = 32x32 +appiconsdir = $(datadir)/icons/hicolor/$(size)/apps + +appicons_DATA = \ + apps/glabels-3.0.png + +noinst_DATA = + +EXTRA_DIST = $(appicons_DATA) \ + $(noinst_DATA) diff --git a/data/icons/32x32/apps/glabels-3.0.png b/data/icons/32x32/apps/glabels-3.0.png new file mode 100644 index 00000000..79c36f0f Binary files /dev/null and b/data/icons/32x32/apps/glabels-3.0.png differ diff --git a/data/icons/48x48/Makefile.am b/data/icons/48x48/Makefile.am new file mode 100644 index 00000000..64a76f96 --- /dev/null +++ b/data/icons/48x48/Makefile.am @@ -0,0 +1,11 @@ + +size = 48x48 +appiconsdir = $(datadir)/icons/hicolor/$(size)/apps + +appicons_DATA = \ + apps/glabels-3.0.png + +noinst_DATA = + +EXTRA_DIST = $(appicons_DATA) \ + $(noinst_DATA) diff --git a/data/icons/48x48/apps/glabels-3.0.png b/data/icons/48x48/apps/glabels-3.0.png new file mode 100644 index 00000000..e54900ae Binary files /dev/null and b/data/icons/48x48/apps/glabels-3.0.png differ diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am new file mode 100644 index 00000000..7a9e4f2e --- /dev/null +++ b/data/icons/Makefile.am @@ -0,0 +1,15 @@ + +SUBDIRS = 16x16 22x22 24x24 32x32 48x48 + +gtk_update_icon_cache = $(GTK_UPDATE_ICON_CACHE) -f -t $(datadir)/icons/hicolor + +install-data-hook: update-icon-cache +uninstall-hook: update-icon-cache +update-icon-cache: + @-if test -z "$(DESTDIR)"; then \ + echo "Updating Gtk icon cache."; \ + $(gtk_update_icon_cache); \ + else \ + echo "*** Icon cache not updated. After (un)install, run this:"; \ + echo "*** $(gtk_update_icon_cache)"; \ + fi diff --git a/data/pixmaps/Makefile.am b/data/pixmaps/Makefile.am index f08962d8..f531e899 100644 --- a/data/pixmaps/Makefile.am +++ b/data/pixmaps/Makefile.am @@ -15,14 +15,10 @@ glabels_pixmaps_DATA = \ glabels_app_icondir = $(datadir)/pixmaps -glabels_app_icon_DATA = \ - $(GLABELS_BRANCH).png - glabels_mime_icondir = $(datadir)/icons/hicolor/48x48/mimetypes glabels_mime_icon_DATA = \ application-x-glabels.png EXTRA_DIST = $(glabels_pixmaps_DATA) \ - $(glabels_app_icon_DATA) \ $(glabels_mime_icon_DATA) diff --git a/data/pixmaps/glabels-3.0.png b/data/pixmaps/glabels-3.0.png deleted file mode 100644 index afb7ecfb..00000000 Binary files a/data/pixmaps/glabels-3.0.png and /dev/null differ diff --git a/src/Makefile.am b/src/Makefile.am index ea2bd76d..53084844 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,10 +12,9 @@ INCLUDES = \ $(LIBQRENCODE_CFLAGS) \ $(LIBIEC16022_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \ - -DGLABELS_LOCALEDIR=\""$(datadir)/locale"\" \ - -DGLABELS_ICON_DIR=\""$(datadir)/pixmaps"\" \ - -DGLABELS_ICON=\""$(GLABELS_BRANCH).png"\" \ + -DGLABELS_LOCALE_DIR=\""$(datadir)/locale"\" \ -DGLABELS_DATA_DIR=\""$(datadir)/$(GLABELS_BRANCH)"\" \ + -DGLABELS_ICON_NAME=\""$(GLABELS_BRANCH)\"" \ -DG_LOG_DOMAIN=\""glabels\"" glabels_3_LDFLAGS = -export-dynamic diff --git a/src/glabels-batch.c b/src/glabels-batch.c index 1ab8ec72..4dd16e06 100644 --- a/src/glabels-batch.c +++ b/src/glabels-batch.c @@ -90,7 +90,7 @@ main (int argc, char **argv) gchar *utf8_filename; GError *error = NULL; - bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALEDIR); + bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); diff --git a/src/glabels.c b/src/glabels.c index ce95ba54..e43f9768 100644 --- a/src/glabels.c +++ b/src/glabels.c @@ -66,13 +66,12 @@ main (int argc, char **argv) }; GOptionContext *option_context; - gchar *icon_file; GList *file_list = NULL, *p; GtkWidget *win; gchar *utf8_filename; GError *error = NULL; - bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALEDIR); + bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); @@ -98,17 +97,7 @@ main (int argc, char **argv) gl_warning_handler_init(); /* Set default icon */ - icon_file = g_build_filename (GLABELS_ICON_DIR, GLABELS_ICON, NULL); - if (!g_file_test (icon_file, G_FILE_TEST_EXISTS)) - { - g_message ("Could not find %s", icon_file); - } - else - { - gtk_window_set_default_icon_from_file (icon_file, NULL); - } - g_free (icon_file); - + gtk_window_set_default_icon_name (GLABELS_ICON_NAME); /* Initialize subsystems */ gl_debug_init (); diff --git a/src/template-designer.c b/src/template-designer.c index 4a8473e7..9cddc7b5 100644 --- a/src/template-designer.c +++ b/src/template-designer.c @@ -403,7 +403,7 @@ gl_template_designer_construct (glTemplateDesigner *dialog) gtk_window_set_title (GTK_WINDOW(dialog), _("New gLabels Template")); - logo_filename = g_build_filename (GLABELS_ICON_DIR, GLABELS_ICON, NULL); + logo_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "new-select.png", NULL); logo = gdk_pixbuf_new_from_file (logo_filename, NULL); g_free (logo_filename);