From e255a77fcd9cc0344e751bfa911b9415bc85ceb1 Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Tue, 12 Sep 2023 11:59:43 +0200 Subject: [PATCH] Fixes AppImage build - RawTherapee app icon should be installed in hicolor theme provided in AppImage package - Fix wrong searching path for SVG/PNG images in rtscalable.h --- CMakeLists.txt | 8 +-- rtdata/CMakeLists.txt | 5 +- .../128x128/apps}/rawtherapee.png | Bin .../16x16/apps}/rawtherapee.png | Bin .../24x24/apps}/rawtherapee.png | Bin .../256x256/apps}/rawtherapee.png | Bin .../32x32/apps}/rawtherapee.png | Bin .../48x48/apps}/rawtherapee.png | Bin .../64x64/apps}/rawtherapee.png | Bin rtdata/icons/hicolor/index.theme | 48 ++++++++++++++++++ .../scalable/apps}/rawtherapee.svg | 0 rtdata/icons/rawtherapee/index.theme | 43 ++-------------- rtgui/rtscalable.cc | 7 +-- 13 files changed, 63 insertions(+), 48 deletions(-) rename rtdata/icons/{rawtherapee/128x128/app_icons => hicolor/128x128/apps}/rawtherapee.png (100%) rename rtdata/icons/{rawtherapee/16x16/app_icons => hicolor/16x16/apps}/rawtherapee.png (100%) rename rtdata/icons/{rawtherapee/24x24/app_icons => hicolor/24x24/apps}/rawtherapee.png (100%) rename rtdata/icons/{rawtherapee/256x256/app_icons => hicolor/256x256/apps}/rawtherapee.png (100%) rename rtdata/icons/{rawtherapee/32x32/app_icons => hicolor/32x32/apps}/rawtherapee.png (100%) rename rtdata/icons/{rawtherapee/48x48/app_icons => hicolor/48x48/apps}/rawtherapee.png (100%) rename rtdata/icons/{rawtherapee/64x64/app_icons => hicolor/64x64/apps}/rawtherapee.png (100%) create mode 100644 rtdata/icons/hicolor/index.theme rename rtdata/icons/{rawtherapee/scalable/app_icons => hicolor/scalable/apps}/rawtherapee.svg (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c97d4b16..5445bdff9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -366,12 +366,14 @@ endif() if(NOT DEFINED ICONSDIR) if(UNIX) if(BUILD_BUNDLE) - set(ICONSDIR "${DATADIR}/icons") + if(APPLE) + set(ICONSDIR "${DATADIR}/icons") + else() + set(ICONSDIR "${DATADIR}/share/icons") + endif() else() set(ICONSDIR "${CMAKE_INSTALL_PREFIX}/share/icons") endif() - else() - set(ICONSDIR "${DATADIR}/icons") endif() endif() diff --git a/rtdata/CMakeLists.txt b/rtdata/CMakeLists.txt index 8d7c14573..e14862d7f 100644 --- a/rtdata/CMakeLists.txt +++ b/rtdata/CMakeLists.txt @@ -6,7 +6,7 @@ file(GLOB DCPFILES "dcpprofiles/*") set(PROFILESDIR "profiles") set(THEMEDIR "themes") -set(ICONSDIR "icons") +set(ICONTHEMEDIR "icons") set(IMAGESDIR "images") if(WIN32) @@ -24,6 +24,7 @@ endif() if(UNIX) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/rawtherapee.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/rawtherapee.desktop") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/rawtherapee.desktop" DESTINATION ${DESKTOPDIR}) + install(DIRECTORY "${ICONTHEMEDIR}/hicolor" DESTINATION "${ICONSDIR}") endif() install(FILES ${LANGUAGEFILES} DESTINATION "${DATADIR}/languages") @@ -35,7 +36,7 @@ install(FILES ${OPTIONSFILE} DESTINATION "${DATADIR}" PERMISSIONS OWNER_WRITE OW install(DIRECTORY "${PROFILESDIR}" DESTINATION "${DATADIR}" FILES_MATCHING PATTERN "*.pp3") install(DIRECTORY "${THEMEDIR}" DESTINATION "${DATADIR}") -install(DIRECTORY "${ICONSDIR}" DESTINATION "${DATADIR}") +install(DIRECTORY "${ICONTHEMEDIR}/rawtherapee" DESTINATION "${DATADIR}/${ICONTHEMEDIR}") install(DIRECTORY "${IMAGESDIR}" DESTINATION "${DATADIR}") if(APPLE) diff --git a/rtdata/icons/rawtherapee/128x128/app_icons/rawtherapee.png b/rtdata/icons/hicolor/128x128/apps/rawtherapee.png similarity index 100% rename from rtdata/icons/rawtherapee/128x128/app_icons/rawtherapee.png rename to rtdata/icons/hicolor/128x128/apps/rawtherapee.png diff --git a/rtdata/icons/rawtherapee/16x16/app_icons/rawtherapee.png b/rtdata/icons/hicolor/16x16/apps/rawtherapee.png similarity index 100% rename from rtdata/icons/rawtherapee/16x16/app_icons/rawtherapee.png rename to rtdata/icons/hicolor/16x16/apps/rawtherapee.png diff --git a/rtdata/icons/rawtherapee/24x24/app_icons/rawtherapee.png b/rtdata/icons/hicolor/24x24/apps/rawtherapee.png similarity index 100% rename from rtdata/icons/rawtherapee/24x24/app_icons/rawtherapee.png rename to rtdata/icons/hicolor/24x24/apps/rawtherapee.png diff --git a/rtdata/icons/rawtherapee/256x256/app_icons/rawtherapee.png b/rtdata/icons/hicolor/256x256/apps/rawtherapee.png similarity index 100% rename from rtdata/icons/rawtherapee/256x256/app_icons/rawtherapee.png rename to rtdata/icons/hicolor/256x256/apps/rawtherapee.png diff --git a/rtdata/icons/rawtherapee/32x32/app_icons/rawtherapee.png b/rtdata/icons/hicolor/32x32/apps/rawtherapee.png similarity index 100% rename from rtdata/icons/rawtherapee/32x32/app_icons/rawtherapee.png rename to rtdata/icons/hicolor/32x32/apps/rawtherapee.png diff --git a/rtdata/icons/rawtherapee/48x48/app_icons/rawtherapee.png b/rtdata/icons/hicolor/48x48/apps/rawtherapee.png similarity index 100% rename from rtdata/icons/rawtherapee/48x48/app_icons/rawtherapee.png rename to rtdata/icons/hicolor/48x48/apps/rawtherapee.png diff --git a/rtdata/icons/rawtherapee/64x64/app_icons/rawtherapee.png b/rtdata/icons/hicolor/64x64/apps/rawtherapee.png similarity index 100% rename from rtdata/icons/rawtherapee/64x64/app_icons/rawtherapee.png rename to rtdata/icons/hicolor/64x64/apps/rawtherapee.png diff --git a/rtdata/icons/hicolor/index.theme b/rtdata/icons/hicolor/index.theme new file mode 100644 index 000000000..1215a9989 --- /dev/null +++ b/rtdata/icons/hicolor/index.theme @@ -0,0 +1,48 @@ +[Icon Theme] +Name=Hicolor +Comment=RawTherapee app icon +Hidden=true +Directories=16x16/apps,24x24/apps,32x32/apps,48x48/apps,64x64/apps,128x128/apps,256x256/apps,scalable/apps + + +[16x16/apps] +Size=16 +Context=ApplicationIcons +Type=Threshold + +[24x24/apps] +Size=24 +Context=ApplicationIcons +Type=Threshold + +[32x32/apps] +Size=32 +Context=ApplicationIcons +Type=Threshold + +[48x48/apps] +Size=48 +Context=ApplicationIcons +Type=Threshold + +[64x64/apps] +Size=64 +Context=ApplicationIcons +Type=Threshold + +[128x128/apps] +Size=128 +Context=ApplicationIcons +Type=Threshold + +[256x256/apps] +Size=256 +Context=ApplicationIcons +Type=Threshold + +[scalable/apps] +MinSize=16 +Size=128 +MaxSize=256 +Context=ApplicationIcons +Type=Scalable diff --git a/rtdata/icons/rawtherapee/scalable/app_icons/rawtherapee.svg b/rtdata/icons/hicolor/scalable/apps/rawtherapee.svg similarity index 100% rename from rtdata/icons/rawtherapee/scalable/app_icons/rawtherapee.svg rename to rtdata/icons/hicolor/scalable/apps/rawtherapee.svg diff --git a/rtdata/icons/rawtherapee/index.theme b/rtdata/icons/rawtherapee/index.theme index c862ff01f..1095b2219 100644 --- a/rtdata/icons/rawtherapee/index.theme +++ b/rtdata/icons/rawtherapee/index.theme @@ -2,51 +2,14 @@ Name=RawTherapee Comment=RawTherapee icon theme Inherits=Adwaita -Directories=16x16/app_icons,24x24/app_icons,32x32/app_icons,48x48/app_icons,64x64/app_icons,128x128/app_icons,256x256/app_icons,scalable/app_icons,scalable/apps +Directories=24x24/apps,scalable/apps -[16x16/app_icons] -Size=16 -Context=ApplicationIcons -Type=Threshold - -[24x24/app_icons] +[24x24/apps] Size=24 -Context=ApplicationIcons +Context=Applications Type=Threshold -[32x32/app_icons] -Size=32 -Context=ApplicationIcons -Type=Threshold - -[48x48/app_icons] -Size=48 -Context=ApplicationIcons -Type=Threshold - -[64x64/app_icons] -Size=64 -Context=ApplicationIcons -Type=Threshold - -[128x128/app_icons] -Size=128 -Context=ApplicationIcons -Type=Threshold - -[256x256/app_icons] -Size=256 -Context=ApplicationIcons -Type=Threshold - -[scalable/app_icons] -MinSize=16 -Size=128 -MaxSize=256 -Context=ApplicationIcons -Type=Scalable - [scalable/apps] MinSize=16 Size=128 diff --git a/rtgui/rtscalable.cc b/rtgui/rtscalable.cc index b58da6d12..5e61e8655 100644 --- a/rtgui/rtscalable.cc +++ b/rtgui/rtscalable.cc @@ -24,9 +24,10 @@ #include #include "../rtengine/settings.h" -#include "config.h" #include "guiutils.h" +extern Glib::ustring argv0; + // Default static parameter values double RTScalable::dpi = 96.; int RTScalable::scale = 1; @@ -118,7 +119,7 @@ Cairo::RefPtr RTScalable::loadSurfaceFromPNG(const Glib::us path = fname; } else { // Look for PNG file in "images" folder - Glib::ustring imagesFolder = Glib::build_filename(DATA_SEARCH_PATH, "images"); + Glib::ustring imagesFolder = Glib::build_filename(argv0, "images"); path = Glib::build_filename(imagesFolder, fname); } @@ -145,7 +146,7 @@ Cairo::RefPtr RTScalable::loadSurfaceFromSVG(const Glib::us path = fname; } else { // Look for SVG file in "images" folder - Glib::ustring imagesFolder = Glib::build_filename(DATA_SEARCH_PATH, "images"); + Glib::ustring imagesFolder = Glib::build_filename(argv0, "images"); path = Glib::build_filename(imagesFolder, fname); }