diff --git a/.drone.yml b/.drone.yml index 3d960b895..12c323c4c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,7 @@ name: qt-5.12 steps: - name: cmake - image: nextcloudci/client-5.12:client-5.12-12 + image: ghcr.io/nextcloud/continuous-integration-client:client-5.12-18 volumes: - name: build path: /drone/build @@ -11,7 +11,7 @@ steps: - cd /drone/build - cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=Debug -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DECM_ENABLE_SANITIZERS=address ../src - name: compile - image: nextcloudci/client-5.12:client-5.12-12 + image: ghcr.io/nextcloud/continuous-integration-client:client-5.12-18 volumes: - name: build path: /drone/build @@ -19,7 +19,7 @@ steps: - cd /drone/build - make -j$(nproc) - name: test - image: nextcloudci/client-5.12:client-5.12-12 + image: ghcr.io/nextcloud/continuous-integration-client:client-5.12-18 volumes: - name: build path: /drone/build @@ -47,7 +47,7 @@ name: qt-5.12-clang steps: - name: cmake - image: nextcloudci/client-5.12:client-5.12-12 + image: ghcr.io/nextcloud/continuous-integration-client:client-5.12-18 volumes: - name: build path: /drone/build @@ -55,7 +55,7 @@ steps: - cd /drone/build - cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_BUILD_TYPE=Debug -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DECM_ENABLE_SANITIZERS=address ../src - name: compile - image: nextcloudci/client-5.12:client-5.12-12 + image: ghcr.io/nextcloud/continuous-integration-client:client-5.12-18 volumes: - name: build path: /drone/build @@ -63,7 +63,7 @@ steps: - cd /drone/build - ninja - name: test - image: nextcloudci/client-5.12:client-5.12-12 + image: ghcr.io/nextcloud/continuous-integration-client:client-5.12-18 volumes: - name: build path: /drone/build @@ -73,7 +73,7 @@ steps: - chown -R test:test . - su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test - name: clang-tidy - image: nextcloudci/client-5.12:client-5.12-12 + image: ghcr.io/nextcloud/continuous-integration-client:client-5.12-18 volumes: - name: build path: /drone/build @@ -98,7 +98,7 @@ name: AppImage steps: - name: build - image: nextcloudci/client-5.12:client-5.12-9 + image: ghcr.io/nextcloud/continuous-integration-client-appimage:client-appimage-1 environment: CI_UPLOAD_GIT_TOKEN: from_secret: CI_UPLOAD_GIT_TOKEN @@ -120,7 +120,7 @@ name: Debian steps: - name: build - image: nextcloudci/client-debian-ci:client-debian-ci-2 + image: ghcr.io/nextcloud/continuous-integration-client-debian:client-debian-3 commands: - /bin/bash -c "./admin/linux/debian/drone-build.sh" || echo "[WARNING] Debian build failed but this is a non-blocking CI event" environment: diff --git a/.gitignore b/.gitignore index b727d9090..15a7371a0 100644 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,7 @@ CPackSourceConfig.cmake compile_commands.json convert.exe .dir-locals.el +*-icon.png +*-sidebar.png +*-w10startmenu.png +theme.qrc diff --git a/admin/linux/build-appimage.sh b/admin/linux/build-appimage.sh index ac7040039..52c7ba406 100755 --- a/admin/linux/build-appimage.sh +++ b/admin/linux/build-appimage.sh @@ -6,7 +6,7 @@ mkdir /app mkdir /build #Set Qt-5.12 -export QT_BASE_DIR=/opt/qt5.12.9 +export QT_BASE_DIR=/opt/qt5.12.10 export QTDIR=$QT_BASE_DIR export PATH=$QT_BASE_DIR/bin:$PATH export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index ab0c65879..284e71752 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -231,6 +231,75 @@ if (NOT DEFINED APPLICATION_ICON_NAME) set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME}) endif() +# Generate png icons from svg +find_program(INKSCAPE + NAMES inkscape inkscape.exe + REQUIRED + HINTS "C:\\Program Files\\Inkscape\\bin" "/usr/bin" ENV INKSCAPE_DIR) +# REQUIRED keyword is only supported on CMake 3.18 and above +if (NOT INKSCAPE) + message(FATAL_ERROR "Could not find inkscape. Set INKSCAPE_DIR to the path of executable.") +endif() + +function(generate_sized_png_from_svg icon_path size) + get_filename_component(icon_name_dir ${icon_path} DIRECTORY) + get_filename_component(icon_name_wle ${icon_path} NAME_WLE) + + if (EXISTS "${icon_name_dir}/${size}-${icon_name_wle}.png") + return() + endif() + + set(icon_output_name "${size}-${icon_name_wle}.png") + message(STATUS "Generate ${icon_output_name}") + execute_process(COMMAND + "${INKSCAPE}" -w ${size} -h ${size} "${icon_path}" -o "${icon_output_name}" + WORKING_DIRECTORY "${icon_name_dir}" + RESULT_VARIABLE + INKSCAPE_SIDEBAR_ERROR + OUTPUT_QUIET + ERROR_QUIET) + + if (INKSCAPE_SIDEBAR_ERROR) + message(FATAL_ERROR + "inkscape could not generate icon: ${INKSCAPE_SIDEBAR_ERROR}") + else() + endif() +endfunction() + +if ((APPLICATION_ICON_SET MATCHES "PNG") + AND + (NOT EXISTS "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon.svg")) + # We may have no svg application icon in when customers use PNG + # icons in brander, but theme.qrc expects a svg icon. + file(TOUCH "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon.svg") +endif() + +if(APPLE) + set(MACOS_SIDEBAR_ICON_SVG "${theme_dir}/colored/${APPLICATION_ICON_NAME}-sidebar.svg") + generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 16) + generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 32) + generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 64) + generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 128) + generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 256) +endif() + +if(WIN32) + set(STARTMENU_ICON_SVG "${theme_dir}/colored/${APPLICATION_ICON_NAME}-w10startmenu.svg") + generate_sized_png_from_svg(${STARTMENU_ICON_SVG} 70) + generate_sized_png_from_svg(${STARTMENU_ICON_SVG} 150) +endif() + +set(APP_ICON_SVG "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon.svg") +generate_sized_png_from_svg(${APP_ICON_SVG} 16) +generate_sized_png_from_svg(${APP_ICON_SVG} 24) +generate_sized_png_from_svg(${APP_ICON_SVG} 32) +generate_sized_png_from_svg(${APP_ICON_SVG} 48) +generate_sized_png_from_svg(${APP_ICON_SVG} 64) +generate_sized_png_from_svg(${APP_ICON_SVG} 128) +generate_sized_png_from_svg(${APP_ICON_SVG} 256) +generate_sized_png_from_svg(${APP_ICON_SVG} 512) +generate_sized_png_from_svg(${APP_ICON_SVG} 1024) + file(GLOB_RECURSE OWNCLOUD_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-icon*") if(APPLE) file(GLOB_RECURSE OWNCLOUD_SIDEBAR_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-sidebar*") diff --git a/theme/colored/128-Nextcloud-sidebar.png b/theme/colored/128-Nextcloud-sidebar.png deleted file mode 100644 index 4ca9fae9b..000000000 Binary files a/theme/colored/128-Nextcloud-sidebar.png and /dev/null differ diff --git a/theme/colored/150-Nextcloud-w10startmenu.png b/theme/colored/150-Nextcloud-w10startmenu.png deleted file mode 100644 index b2b7217ab..000000000 Binary files a/theme/colored/150-Nextcloud-w10startmenu.png and /dev/null differ diff --git a/theme/colored/16-Nextcloud-sidebar.png b/theme/colored/16-Nextcloud-sidebar.png deleted file mode 100644 index 4bcc1a54f..000000000 Binary files a/theme/colored/16-Nextcloud-sidebar.png and /dev/null differ diff --git a/theme/colored/256-Nextcloud-sidebar.png b/theme/colored/256-Nextcloud-sidebar.png deleted file mode 100644 index 19da6fe9d..000000000 Binary files a/theme/colored/256-Nextcloud-sidebar.png and /dev/null differ diff --git a/theme/colored/32-Nextcloud-sidebar.png b/theme/colored/32-Nextcloud-sidebar.png deleted file mode 100644 index e49a15c83..000000000 Binary files a/theme/colored/32-Nextcloud-sidebar.png and /dev/null differ diff --git a/theme/colored/64-Nextcloud-sidebar.png b/theme/colored/64-Nextcloud-sidebar.png deleted file mode 100644 index bd1adb490..000000000 Binary files a/theme/colored/64-Nextcloud-sidebar.png and /dev/null differ diff --git a/theme/colored/70-Nextcloud-w10startmenu.png b/theme/colored/70-Nextcloud-w10startmenu.png deleted file mode 100644 index 98dcff0ac..000000000 Binary files a/theme/colored/70-Nextcloud-w10startmenu.png and /dev/null differ diff --git a/theme/colored/Nextcloud-w10startmenu.svg b/theme/colored/Nextcloud-w10startmenu.svg new file mode 100644 index 000000000..1a4d3d847 --- /dev/null +++ b/theme/colored/Nextcloud-w10startmenu.svg @@ -0,0 +1,121 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + +