Skip to content

Conversation

@TrigamDev
Copy link
Contributor

Summary

Replaces the thumbnail display for plaintext files with a new TextDisplay widget, which supports syntax highlighting.

image

The syntax highlighting style is configurable, with GitHub Dark being the default.

image

Notes:

  • superqt's CodeSyntaxHighlight utility is used to provide syntax highlighting to the QTextEdit widget that TextDisplay is based on. The syntax highlighting itself and all of the styles are provided by pygments.
    • Instead, a custom implementation of CodeSyntaxHighlight could be made to reduce the number of dependencies. This was just a quick way to get something working. Plus, superqt's widgets could potentially prove useful.
  • This PR is based on refactor: thumbnail renderers #1217. Originally, the idea was to also provide syntax highlighting to the thumbnails in the entry grid, but this has been dropped for the time being. This does follow some changes made in refactor: thumbnail renderers #1217, though.
  • This PR follows the file organization from some of my previous PRs. As is said in them, the file organization changes can be reverted if the previous organization is preferred.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added Type: Enhancement New feature or request Type: QoL A quality of life (QoL) enhancement or suggestion Thumbs/Previews File thumbnails or previews labels Nov 25, 2025
@CyanVoxel CyanVoxel added the Status: Review Needed A review of this is needed label Nov 25, 2025
@CyanVoxel CyanVoxel moved this to 🏓 Ready for Review in TagStudio Development Nov 25, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.6.0 milestone Nov 25, 2025
@CyanVoxel CyanVoxel added the Status: Blocked This issue or pull request is awaiting the outcome of another issue or pull request label Nov 25, 2025
# Conflicts:
#	pyproject.toml
#	src/tagstudio/qt/previews/renderer.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Blocked This issue or pull request is awaiting the outcome of another issue or pull request Status: Review Needed A review of this is needed Thumbs/Previews File thumbnails or previews Type: Enhancement New feature or request Type: QoL A quality of life (QoL) enhancement or suggestion

Projects

Status: 🏓 Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants