From b838c8c828d2d4e988b10b18f5f734f29bcac28c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Wed, 29 Jul 2015 10:00:19 +0200 Subject: Fix missing icons on GTK3 with custom icon theme --- Makefile.am | 2 +- configure.ac | 1 + icons/Makefile.am | 59 ++++++++++++++++++++++++++ icons/hicolor_apps_16x16_mate.png | Bin 0 -> 774 bytes icons/hicolor_apps_22x22_mate.png | Bin 0 -> 1323 bytes icons/hicolor_apps_24x24_mate.png | Bin 0 -> 1511 bytes icons/hicolor_apps_256x256_mate.png | Bin 0 -> 31357 bytes icons/hicolor_apps_32x32_mate.png | Bin 0 -> 2180 bytes icons/hicolor_apps_48x48_mate.png | Bin 0 -> 4164 bytes icons/hicolor_apps_scalable_mate-symbolic.svg | 24 +++++++++++ mate-about/mate-about.c | 14 +----- mate-about/mate-about.h | 1 - tools/mate-color-select.c | 1 + tools/mate-color-select.desktop.in.in | 2 +- user-guide/mate-user-guide.desktop.in.in | 2 +- 15 files changed, 90 insertions(+), 16 deletions(-) create mode 100644 icons/Makefile.am create mode 100644 icons/hicolor_apps_16x16_mate.png create mode 100644 icons/hicolor_apps_22x22_mate.png create mode 100644 icons/hicolor_apps_24x24_mate.png create mode 100644 icons/hicolor_apps_256x256_mate.png create mode 100644 icons/hicolor_apps_32x32_mate.png create mode 100644 icons/hicolor_apps_48x48_mate.png create mode 100644 icons/hicolor_apps_scalable_mate-symbolic.svg diff --git a/Makefile.am b/Makefile.am index 2be4449..5e76c52 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = libmate-desktop man docs po schemas tools +SUBDIRS = libmate-desktop man docs po schemas tools icons if MATE_ABOUT_ENABLED SUBDIRS += mate-about diff --git a/configure.ac b/configure.ac index aaeea77..05ad090 100644 --- a/configure.ac +++ b/configure.ac @@ -333,6 +333,7 @@ tools/mate-conf-import.desktop.in tools/Makefile user-guide/Makefile user-guide/mate-user-guide.desktop.in +icons/Makefile ]) AC_OUTPUT diff --git a/icons/Makefile.am b/icons/Makefile.am new file mode 100644 index 0000000..786bb26 --- /dev/null +++ b/icons/Makefile.am @@ -0,0 +1,59 @@ +NULL = + +public_icons_themes = \ + hicolor \ + $(NULL) + +public_icons = \ + hicolor_apps_16x16_mate.png \ + hicolor_apps_22x22_mate.png \ + hicolor_apps_24x24_mate.png \ + hicolor_apps_32x32_mate.png \ + hicolor_apps_48x48_mate.png \ + hicolor_apps_256x256_mate.png \ + hicolor_apps_scalable_mate-symbolic.svg \ + $(NULL) + +EXTRA_DIST = \ + $(public_icons) \ + $(NULL) + +############################################################################### + +gtk_update_icon_cache = gtk-update-icon-cache -f -t + +update-icon-cache: + @-if test -z "$(DESTDIR)"; then \ + echo "Updating Gtk icon cache."; \ + for theme in $(public_icons_themes); do \ + $(gtk_update_icon_cache) $(datadir)/icons/$$theme; \ + done; \ + else \ + echo "*** Icon cache not updated. After (un)install, run this:"; \ + for theme in $(public_icons_themes); do \ + echo "*** $(gtk_update_icon_cache) $(datadir)/icons/$$theme"; \ + done; \ + fi + +install-icons: + for icon in $(public_icons); do \ + THEME=`echo $$icon | cut -d_ -f1`; \ + CONTEXT=`echo $$icon | cut -d_ -f2`; \ + SIZE=`echo $$icon | cut -d_ -f3`; \ + ICONFILE=`echo $$icon | cut -d_ -f4`; \ + mkdir -p $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \ + $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \ + done + +uninstall-icons: + -for icon in $(public_icons); do \ + THEME=`echo $$icon | cut -d_ -f1`; \ + CONTEXT=`echo $$icon | cut -d_ -f2`; \ + SIZE=`echo $$icon | cut -d_ -f3`; \ + ICONFILE=`echo $$icon | cut -d_ -f4`; \ + rm -f $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \ + done + +install-data-local: install-icons update-icon-cache + +uninstall-local: uninstall-icons update-icon-cache diff --git a/icons/hicolor_apps_16x16_mate.png b/icons/hicolor_apps_16x16_mate.png new file mode 100644 index 0000000..0a34149 Binary files /dev/null and b/icons/hicolor_apps_16x16_mate.png differ diff --git a/icons/hicolor_apps_22x22_mate.png b/icons/hicolor_apps_22x22_mate.png new file mode 100644 index 0000000..1fd92a8 Binary files /dev/null and b/icons/hicolor_apps_22x22_mate.png differ diff --git a/icons/hicolor_apps_24x24_mate.png b/icons/hicolor_apps_24x24_mate.png new file mode 100644 index 0000000..2065bea Binary files /dev/null and b/icons/hicolor_apps_24x24_mate.png differ diff --git a/icons/hicolor_apps_256x256_mate.png b/icons/hicolor_apps_256x256_mate.png new file mode 100644 index 0000000..9708cdd Binary files /dev/null and b/icons/hicolor_apps_256x256_mate.png differ diff --git a/icons/hicolor_apps_32x32_mate.png b/icons/hicolor_apps_32x32_mate.png new file mode 100644 index 0000000..2a6a192 Binary files /dev/null and b/icons/hicolor_apps_32x32_mate.png differ diff --git a/icons/hicolor_apps_48x48_mate.png b/icons/hicolor_apps_48x48_mate.png new file mode 100644 index 0000000..d00c802 Binary files /dev/null and b/icons/hicolor_apps_48x48_mate.png differ diff --git a/icons/hicolor_apps_scalable_mate-symbolic.svg b/icons/hicolor_apps_scalable_mate-symbolic.svg new file mode 100644 index 0000000..776a8dd --- /dev/null +++ b/icons/hicolor_apps_scalable_mate-symbolic.svg @@ -0,0 +1,24 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/mate-about/mate-about.c b/mate-about/mate-about.c index 2167769..50506e5 100644 --- a/mate-about/mate-about.c +++ b/mate-about/mate-about.c @@ -69,18 +69,8 @@ void mate_about_run(void) { mate_about_dialog = (MateAboutDialog*) mate_about_dialog_new(); - GtkIconTheme* icon_theme = gtk_icon_theme_get_default(); - - if (gtk_icon_theme_has_icon(icon_theme, icon)) - { - gtk_window_set_default_icon_name(icon); - mate_about_dialog_set_logo_icon_name(mate_about_dialog, icon); - } - else - { - gtk_window_set_default_icon_name(desktop_icon); - mate_about_dialog_set_logo_icon_name(mate_about_dialog, desktop_icon); - } + gtk_window_set_default_icon_name(icon); + mate_about_dialog_set_logo_icon_name(mate_about_dialog, icon); // name mate_about_dialog_set_program_name(mate_about_dialog, gettext(program_name)); diff --git a/mate-about/mate-about.h b/mate-about/mate-about.h index f4ecba0..9bf285a 100644 --- a/mate-about/mate-about.h +++ b/mate-about/mate-about.h @@ -31,7 +31,6 @@ const char* program_name = "MATE Desktop Environment"; const char* version = PACKAGE_VERSION; const char* icon = "mate"; -const char* desktop_icon = "desktop"; const char* website = "http://www.mate-desktop.org/"; const char* copyright = "" diff --git a/tools/mate-color-select.c b/tools/mate-color-select.c index 5870ab3..73af718 100644 --- a/tools/mate-color-select.c +++ b/tools/mate-color-select.c @@ -58,6 +58,7 @@ main (int argc, char **argv) /* initialize GTK+ */ gtk_init (&argc, &argv); + gtk_window_set_default_icon_name ("gtk-select-color"); color_dialog = mate_color_selection_dialog_new (_("MATE Color Selection")); mate_color_selection_set_has_palette (MATE_COLOR_SELECTION_DIALOG (color_dialog)->colorsel, TRUE); diff --git a/tools/mate-color-select.desktop.in.in b/tools/mate-color-select.desktop.in.in index 99020b6..458ab6e 100644 --- a/tools/mate-color-select.desktop.in.in +++ b/tools/mate-color-select.desktop.in.in @@ -3,7 +3,7 @@ _Name=MATE Color Selection _GenericName=Color selection dialog _Comment=Choose colors from the palette or the screen Exec=mate-color-select -Icon=gcolor2 +Icon=gtk-select-color Terminal=false Type=Application Categories=GTK;Graphics; diff --git a/user-guide/mate-user-guide.desktop.in.in b/user-guide/mate-user-guide.desktop.in.in index 99d8d82..34ea7b0 100644 --- a/user-guide/mate-user-guide.desktop.in.in +++ b/user-guide/mate-user-guide.desktop.in.in @@ -3,7 +3,7 @@ Type=Application _Name=Help _Comment=Get help with MATE Keywords=documentation;information;manual; -Icon=help +Icon=help-browser Exec=yelp help:mate-user-guide StartupNotify=true Terminal=false -- cgit v1.2.1