TagStudio
TagStudio copied to clipboard
feat: code syntax highlighting
Summary
Replaces the thumbnail display for plaintext files with a new TextDisplay widget, which supports syntax highlighting.
The syntax highlighting style is configurable, with GitHub Dark being the default.
Notes:
superqt'sCodeSyntaxHighlightutility is used to provide syntax highlighting to theQTextEditwidget thatTextDisplayis based on. The syntax highlighting itself and all of the styles are provided bypygments.- Instead, a custom implementation of
CodeSyntaxHighlightcould 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.
- Instead, a custom implementation of
- This PR is based on #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 #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
- [x] Linux x86
- [ ] Linux ARM
- Tested For:
- [x] Basic functionality
- [ ] PyInstaller executable