diff --git a/CMakeLists.txt b/CMakeLists.txt index 19d98bb..d8cf19f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(KIGO_VERSION "${KIGO_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION}") project(kigo VERSION ${KIGO_VERSION}) set(QT_MIN_VERSION "6.5.0") -set(KF_MIN_VERSION "5.240.0") +set(KF_MIN_VERSION "5.245.0") find_package(ECM ${KF_MIN_VERSION} REQUIRED CONFIG) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH}) @@ -29,6 +29,8 @@ include(ECMSetupVersion) include(FeatureSummary) include(ECMDeprecationSettings) +include(InternalMacros) + find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Svg Widgets diff --git a/cmake/InternalMacros.cmake b/cmake/InternalMacros.cmake new file mode 100644 index 0000000..ed92065 --- /dev/null +++ b/cmake/InternalMacros.cmake @@ -0,0 +1,64 @@ +# SPDX-FileCopyrightText: 2021, 2023 Friedrich W. H. Kossebau +# +# SPDX-License-Identifier: BSD-3-Clause + +find_package(7Zip) +set_package_properties(7Zip PROPERTIES + PURPOSE "For installing SVG files as SVGZ" +) + +if(WIN32) + set_package_properties(7Zip PROPERTIES + TYPE REQUIRED + ) +else() + set_package_properties(7Zip PROPERTIES + TYPE OPTIONAL + ) + if(NOT TARGET 7Zip::7Zip) + find_package(gzip) + set_package_properties(gzip PROPERTIES + TYPE REQUIRED + PURPOSE "For installing SVG files as SVGZ (less efficient fallback for 7Zip)" + ) + endif() +endif() + +function(generate_svgz svg_file svgz_file target_prefix) + if (NOT IS_ABSOLUTE ${svg_file}) + set(svg_file "${CMAKE_CURRENT_SOURCE_DIR}/${svg_file}") + endif() + if (NOT EXISTS ${svg_file}) + message(FATAL_ERROR "No such file found: ${svg_file}") + endif() + get_filename_component(_fileName "${svg_file}" NAME) + + if(TARGET 7Zip::7Zip) + add_custom_command( + OUTPUT ${svgz_file} + COMMAND 7Zip::7Zip + ARGS + a + -bd # silence logging + -mx9 # compress best + -tgzip + ${svgz_file} ${svg_file} + DEPENDS ${svg_file} + COMMENT "Gzipping ${_fileName}" + ) + else() + add_custom_command( + OUTPUT ${svgz_file} + COMMAND gzip::gzip + ARGS + -9 # compress best + -n # no original name and timestamp stored, for reproducibility + -c # write to stdout + ${svg_file} > ${svgz_file} + DEPENDS ${svg_file} + COMMENT "Gzipping ${_fileName}" + ) + endif() + + add_custom_target("${target_prefix}${_fileName}z" ALL DEPENDS ${svgz_file}) +endfunction() diff --git a/data/themes/CMakeLists.txt b/data/themes/CMakeLists.txt index ede599c..6472ae0 100644 --- a/data/themes/CMakeLists.txt +++ b/data/themes/CMakeLists.txt @@ -1,4 +1,25 @@ -install(FILES - default.desktop kigo_default.svgz kigo_default.png - plain.desktop kigo_plain.svgz kigo_plain.png -DESTINATION ${KDE_INSTALL_DATADIR}/kigo/themes) +# SPDX-FileCopyrightText: 2023 Friedrich W. H. Kossebau +# +# SPDX-License-Identifier: BSD-3-Clause + +function(install_theme name) + cmake_parse_arguments(ARG "" "SVG;PREVIEW" "" ${ARGN}) + if (NOT ARG_SVG) + set(ARG_SVG "${name}.svg") + endif() + if (NOT ARG_PREVIEW) + set(ARG_PREVIEW "${name}_preview.png") + endif() + set(svgz "${CMAKE_CURRENT_BINARY_DIR}/${ARG_SVG}z") + generate_svgz(${ARG_SVG} ${svgz} "theme-") + install( + FILES + ${name}.desktop + ${ARG_PREVIEW} + ${svgz} + DESTINATION ${KDE_INSTALL_DATADIR}/kigo/themes + ) +endfunction() + +install_theme(default SVG kigo_default.svg PREVIEW kigo_default.png) +install_theme(plain SVG kigo_plain.svg PREVIEW kigo_plain.png) diff --git a/data/themes/kigo_default.svg b/data/themes/kigo_default.svg new file mode 100644 index 0000000..16fe6ed --- /dev/null +++ b/data/themes/kigo_default.svg @@ -0,0 +1,8947 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/themes/kigo_default.svgz b/data/themes/kigo_default.svgz deleted file mode 100644 index 38873d4..0000000 Binary files a/data/themes/kigo_default.svgz and /dev/null differ diff --git a/data/themes/kigo_plain.svg b/data/themes/kigo_plain.svg new file mode 100644 index 0000000..87f4197 --- /dev/null +++ b/data/themes/kigo_plain.svg @@ -0,0 +1,4246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/themes/kigo_plain.svgz b/data/themes/kigo_plain.svgz deleted file mode 100644 index 1009095..0000000 Binary files a/data/themes/kigo_plain.svgz and /dev/null differ