Skip to content

Commit

Permalink
Merge pull request #6830 from Pandagrapher/real_hidpi
Browse files Browse the repository at this point in the history
"Real" Hi-DPI support for RawTherapee GUI - Part 1
  • Loading branch information
Lawrence37 committed Mar 6, 2024
2 parents 619b186 + 7e63892 commit 7f45af1
Show file tree
Hide file tree
Showing 574 changed files with 13,279 additions and 32,199 deletions.
43 changes: 42 additions & 1 deletion .github/workflows/appimage.yml
Expand Up @@ -35,7 +35,7 @@ jobs:
echo "Running apt update."
sudo apt update
echo "Installing dependencies with apt."
DEBIAN_FRONTEND=noninteractive sudo apt install -y cmake libgtk-3-dev libgtkmm-3.0-dev liblensfun-dev librsvg2-dev liblcms2-dev libfftw3-dev libiptcdata0-dev libtiff5-dev libcanberra-gtk3-dev liblensfun-bin libexpat1-dev libbrotli-dev zlib1g-dev libinih-dev
DEBIAN_FRONTEND=noninteractive sudo apt install -y cmake libgtk-3-dev libgtkmm-3.0-dev liblensfun-dev librsvg2-dev liblcms2-dev libfftw3-dev libiptcdata0-dev libtiff5-dev libcanberra-gtk3-dev liblensfun-bin libexpat1-dev libbrotli-dev zlib1g-dev libinih-dev adwaita-icon-theme-full
- name: Install Exiv2
run: |
Expand All @@ -51,6 +51,26 @@ jobs:
echo "Building and installing."
sudo make -j$(nproc) install
- name: Install Librsvg required min. version
# Required min. version is not available for Ubuntu 20.04 LTS (but is for 22.04 LTS) so needs to be built manually
run: |
LIBRSVG2_VERSION='2.52.2'
echo "Cloning Librsvg2 $LIBRSVG2_VERSION."
git clone --depth 1 --branch "$LIBRSVG2_VERSION" https://gitlab.gnome.org/GNOME/librsvg.git ext/librsvg2
echo "Installing required dependencies with apt."
DEBIAN_FRONTEND=noninteractive sudo apt install -y rustc cargo gtk-doc-tools libgirepository1.0-dev
echo "Updating PATH."
export PATH="$PATH:/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0"
echo "Configuring build."
cd ext/librsvg2
sh autogen.sh
echo "Building and installing."
sudo make install
- name: Configure build
run: |
export REF_NAME_FILTERED="$(echo '${{github.ref_name}}' | sed 's/[^A-z0-9_.-]//g')"
Expand Down Expand Up @@ -107,6 +127,27 @@ jobs:
echo "Copying Lensfun database to the build directory."
cp -R ~/.local/share/lensfun/updates/* build/AppDir/usr/share/lensfun/
- name: Include Adwaita icon theme (partial)
run: |
mkdir build/AppDir/usr/bin/icons/Adwaita
icons_dir=('actions' 'devices' 'mimetypes' 'places' 'status' 'ui' 'devices')
for dir in "${icons_dir[@]}"; do
find_res=$(find /usr/share/icons/Adwaita -name "${dir}" -type d)
if [ -z "$find_res" ]
then
echo "-Warning: Icons folder '"${dir}"' not found in Adwaita theme."
else
new_dir=($(echo "$find_res" | awk -F/ '{print $(NF-1)"/"$NF}'))
for d in "${new_dir[@]}"; do
echo "-Copying '"${d}"' into 'AppDir/usr/bin/icons/Adwaita'."
mkdir -p "build/AppDir/usr/bin/icons/Adwaita/${d}"
cp -R "/usr/share/icons/Adwaita/${d}/." "build/AppDir/usr/bin/icons/Adwaita/${d}"
done
fi
done
echo "-Copying 'index.theme' into 'AppDir/usr/bin/icons/Adwaita'."
cp /usr/share/icons/Adwaita/index.theme build/AppDir/usr/bin/icons/Adwaita
- name: Restore AppImage tools from cache
id: appimage-tools-cache
uses: actions/cache@v3
Expand Down
12 changes: 4 additions & 8 deletions CMakeLists.txt
Expand Up @@ -462,13 +462,9 @@ endif()
# Check for libraries:
find_package(PkgConfig)

if(WIN32)
pkg_check_modules(GTK REQUIRED gtk+-3.0>=3.22.24)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0>=3.22)
else()
pkg_check_modules(GTK REQUIRED gtk+-3.0>=3.16)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0>=3.16)
endif()
# Gtk version shall be greater than 3.24.3 for fixed Hi-DPI support
pkg_check_modules(GTK REQUIRED gtk+-3.0>=3.24.3)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0>=3.24)

if(GTK_VERSION VERSION_GREATER "3.24.1" AND GTK_VERSION VERSION_LESS "3.24.7")
if(GTK_VERSION VERSION_EQUAL "3.24.5")
Expand All @@ -495,7 +491,7 @@ pkg_check_modules(GTHREAD REQUIRED gthread-2.0>=2.48)
pkg_check_modules(GOBJECT REQUIRED gobject-2.0>=2.48)
pkg_check_modules(SIGC REQUIRED sigc++-2.0>=2.3.1)
pkg_check_modules(LENSFUN REQUIRED lensfun>=0.2)
pkg_check_modules(RSVG REQUIRED librsvg-2.0>=2.40)
pkg_check_modules(RSVG REQUIRED librsvg-2.0>=2.52)

# Require exiv2 >= 0.24 to make sure everything we need is available
#find_package(Exiv2 0.24 REQUIRED)
Expand Down
25 changes: 5 additions & 20 deletions rtdata/CMakeLists.txt
Expand Up @@ -3,14 +3,11 @@ file(GLOB SOUNDFILES "sounds/*")
file(GLOB INPUTICCFILES "iccprofiles/input/*")
file(GLOB OUTPUTICCFILES "iccprofiles/output/*")
file(GLOB DCPFILES "dcpprofiles/*")
file(GLOB FONTS "fonts/*")

set(PROFILESDIR "profiles")
set(THEMEDIR "themes")

file(GLOB IMG_SVG LIST_DIRECTORIES false "images/svg/*")
file(GLOB IMG_PNG LIST_DIRECTORIES false "images/png/*")
file(GLOB IMG_ICO LIST_DIRECTORIES false "images/*")
set(ICONTHEMEDIR "icons")
set(IMAGESDIR "images")

if(WIN32)
set(OPTIONSFILE "options/options.win")
Expand All @@ -27,14 +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(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-16.png" DESTINATION "${ICONSDIR}/hicolor/16x16/apps" RENAME rawtherapee.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-24.png" DESTINATION "${ICONSDIR}/hicolor/24x24/apps" RENAME rawtherapee.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-32.png" DESTINATION "${ICONSDIR}/hicolor/32x32/apps" RENAME rawtherapee.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-48.png" DESTINATION "${ICONSDIR}/hicolor/48x48/apps" RENAME rawtherapee.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-64.png" DESTINATION "${ICONSDIR}/hicolor/64x64/apps" RENAME rawtherapee.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-128.png" DESTINATION "${ICONSDIR}/hicolor/128x128/apps" RENAME rawtherapee.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/png/rawtherapee-logo-256.png" DESTINATION "${ICONSDIR}/hicolor/256x256/apps" RENAME rawtherapee.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/rt-logo.svg" DESTINATION "${ICONSDIR}/hicolor/scalable/apps" RENAME rawtherapee.svg)
install(DIRECTORY "${ICONTHEMEDIR}/hicolor" DESTINATION "${ICONSDIR}")
endif()

install(FILES ${LANGUAGEFILES} DESTINATION "${DATADIR}/languages")
Expand All @@ -43,16 +33,11 @@ install(FILES ${INPUTICCFILES} DESTINATION "${DATADIR}/iccprofiles/input")
install(FILES ${OUTPUTICCFILES} DESTINATION "${DATADIR}/iccprofiles/output")
install(FILES ${DCPFILES} DESTINATION "${DATADIR}/dcpprofiles")
install(FILES ${OPTIONSFILE} DESTINATION "${DATADIR}" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME options)
if(WIN32)
install(FILES ${FONTS} DESTINATION "${DATADIR}/fonts")
endif()

install(DIRECTORY "${PROFILESDIR}" DESTINATION "${DATADIR}" FILES_MATCHING PATTERN "*.pp3")
install(DIRECTORY "${THEMEDIR}" DESTINATION "${DATADIR}")

install(FILES ${IMG_SVG} DESTINATION "${DATADIR}/images")
install(FILES ${IMG_PNG} DESTINATION "${DATADIR}/images")
install(FILES ${IMG_ICO} DESTINATION "${DATADIR}/images")
install(DIRECTORY "${ICONTHEMEDIR}/rawtherapee" DESTINATION "${DATADIR}/${ICONTHEMEDIR}")
install(DIRECTORY "${IMAGESDIR}" DESTINATION "${DATADIR}")

if(APPLE)
# CMake escapes first item quote character. Do not remove 'DUMMY_VARIABLE='
Expand Down
Binary file removed rtdata/fonts/DroidSansMonoSlashed.ttf
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
48 changes: 48 additions & 0 deletions 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
File renamed without changes
File renamed without changes
18 changes: 18 additions & 0 deletions rtdata/icons/rawtherapee/index.theme
@@ -0,0 +1,18 @@
[Icon Theme]
Name=RawTherapee
Comment=RawTherapee icon theme
Inherits=Adwaita
Directories=24x24/apps,scalable/apps


[24x24/apps]
Size=24
Context=Applications
Type=Threshold

[scalable/apps]
MinSize=16
Size=128
MaxSize=256
Context=Applications
Type=Scalable
77 changes: 77 additions & 0 deletions rtdata/icons/rawtherapee/scalable/apps/add-small.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions rtdata/icons/rawtherapee/scalable/apps/add.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 7f45af1

@Benitoite
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lawrence37 @Pandagrapher
bf988ad removes the default font in favor of the OS default.

Source: "{#MyBuildBasePath}\fonts\DroidSansMonoSlashed.ttf"; DestDir: "{fonts}"; FontInstall: "Droid Sans Mono Slashed"; Flags: onlyifdoesntexist uninsneveruninstall
causes the win build fail trying to load the deleted font.

Please sign in to comment.