dtkgui/tools/dci-icon-theme
zhangkun 187be9a947 feat: improve icon theme generation with scalable support
1. Add SCALABLE_SIZE constant for scalable icon directories
2. Change foundSize return type from uint to int to support scalable
detection
3. Modify writeScaledImage to accept baseSize parameter instead of
parsing from directory
4. Move directory parsing logic to writeImage function for better
organization
5. Add scalable directory detection in size parsing logic
6. Use QImageReader's scaledSize for better image scaling quality
7. Fix error handling to continue processing instead of exiting on first
error

Log: Improved icon theme generation with better scalable icon support

Influence:
1. Test with icon directories containing scalable icons
2. Verify different scale factors work correctly
3. Test error handling when encountering invalid image files
4. Verify image quality at various scales
5. Test with both fixed-size and scalable icon directories

feat: 改进图标主题生成,支持可缩放图标

1. 添加 SCALABLE_SIZE 常量用于可缩放图标目录
2. 将 foundSize 返回类型从 uint 改为 int 以支持可缩放检测
3. 修改 writeScaledImage 函数,接受 baseSize 参数而非从目录解析
4. 将目录解析逻辑移至 writeImage 函数以获得更好的代码组织
5. 在尺寸解析逻辑中添加可缩放目录检测
6. 使用 QImageReader 的 scaledSize 获得更好的图像缩放质量
7. 修复错误处理,在遇到错误时继续处理而非立即退出

Log: 改进图标主题生成,提供更好的可缩放图标支持

Influence:
1. 测试包含可缩放图标的目录
2. 验证不同缩放因子是否正确工作
3. 测试遇到无效图像文件时的错误处理
4. 验证各种缩放比例下的图像质量
5. 测试固定尺寸和可缩放图标目录
2025-10-23 08:41:20 +00:00
..
CMakeLists.txt feat: switch to QGuiApplication for SVG rendering 2025-07-31 13:42:53 +08:00
README.md refactor: move icon finder functionality to separate tool 2025-07-23 04:16:59 +00:00
main.cpp feat: improve icon theme generation with scalable support 2025-10-23 08:41:20 +00:00

README.md

dci-icon-theme

Usage: dci-icon-theme [options] ~/dci-png-icons
dci-icon-theme tool is a command tool that generate dci icons from common icons.
For example, the tool is used in the following ways:
     dci-icon-theme /usr/share/icons/hicolor/256x256/apps -o ~/Desktop/hicolor -O 3=95
     dci-icon-theme -m *.png /usr/share/icons/hicolor/256x256/apps -o ~/Desktop/hicolor -O 3=95
     dci-icon-theme --fix-dark-theme <input dci files directory> -o <output directory path>
     dci-icon-theme <input file directory> -o <output directory path> -s <csv file> -O <qualities>


Options:
  -m, --match <wildcard palette>       Give wildcard rules on search icon
                                       files, Each eligible icon will be
                                       packaged to a dci file, If the icon have
                                       the dark mode, it needs to store the dark
                                       icon file at "dark/" directory relative
                                       to current icon file, and the file name
                                       should be consistent.
  -o, --output <directory>             Save the *.dci files to the given
                                       directory.
  -s, --symlink <csv file>             Give a csv file to create symlinks for
                                       the output icon file.
                                       The content of symlink.csv like:
                                         sublime-text, com.sublimetext.2
                                         deb, "
                                         application-vnd.debian.binary-package
                                         application-x-deb
                                         gnome-mime-application-x-deb
                                         "

  --fix-dark-theme                     Create symlinks from light theme for
                                       dark theme files.
  --find                               Find dci icon file path
  -O, --scale-quality <scale quality>  Quility of dci scaled icon image
                                       The value may like <scale size>=<quality
                                       value>  e.g. 2=98:3=95
                                       The quality factor must be in the range 0
                                       to 100 or -1.
                                       Specify 0 to obtain small compressed
                                       files, 100 for large uncompressed files
                                       and -1 to use the image handler default
                                       settings.
                                       The higher the quality, the larger the
                                       dci icon file size
  -h, --help                           Displays help on commandline options.
  --help-all                           Displays help including Qt specific
                                       options.
  -v, --version                        Displays version information.

Arguments:
  source                               Search the given directory and it's
                                       subdirectories, get the files conform to
                                       rules of --match.