Repository navigation
Allow setting of the font and font size used in the text viewer - #1930
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds configurable font family and font size support for the text viewer plugin, wiring new XML settings into TextViewerPanel initialization and documenting them in OPTIONS.md. Sequence diagram for TextViewerPanel initialization with configurable font settingssequenceDiagram
actor User
participant ConfigFile as QuickLook.Plugin.TextViewer.config
participant TextViewerPanel
participant SettingHelper
participant TranslationHelper
participant Assembly
User->>ConfigFile: Edit FontFamily and FontSize values
User->>TextViewerPanel: Open text preview
activate TextViewerPanel
TextViewerPanel->>SettingHelper: Get(FontSize, 14.0, QuickLook.Plugin.TextViewer)
SettingHelper-->>TextViewerPanel: FontSize value (from config or default)
TextViewerPanel->>Assembly: GetExecutingAssembly()
Assembly-->>TextViewerPanel: AssemblyName
TextViewerPanel->>TranslationHelper: Get(Editor_FontFamily, AssemblyName)
TranslationHelper-->>TextViewerPanel: default font family
TextViewerPanel->>SettingHelper: Get(FontFamily, defaultFontFamily, QuickLook.Plugin.TextViewer)
SettingHelper-->>TextViewerPanel: FontFamily value (from config or default)
TextViewerPanel-->>User: Display text with configured font family and size
deactivate TextViewerPanel
Class diagram for updated TextViewerPanel font configurationclassDiagram
class TextViewerPanel {
+double FontSize
+FontFamily FontFamily
+bool ShowLineNumbers
+bool WordWrap
+bool IsReadOnly
+TextViewerPanel()
}
class SettingHelper {
+double Get(string key, double defaultValue, string domain)
+string Get(string key, string defaultValue, string domain)
}
class TranslationHelper {
+string Get(string key, string domain)
}
class Assembly {
+AssemblyName GetExecutingAssembly()
}
class AssemblyName {
+string GetName()
}
TextViewerPanel ..> SettingHelper : uses
TextViewerPanel ..> TranslationHelper : uses
TextViewerPanel ..> Assembly : uses
TranslationHelper ..> AssemblyName : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider centralizing the default font size (14.0) and default font family key into a shared constant so the code and configuration documentation cannot drift out of sync.
- It may be worth validating the configured FontSize (e.g., enforcing a reasonable min/max) before applying it to avoid unusable text viewer states from extreme values.
- When reading FontFamily from settings, consider handling invalid or unavailable font families by gracefully falling back to the translation-based default rather than throwing at runtime.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider centralizing the default font size (14.0) and default font family key into a shared constant so the code and configuration documentation cannot drift out of sync.
- It may be worth validating the configured FontSize (e.g., enforcing a reasonable min/max) before applying it to avoid unusable text viewer states from extreme values.
- When reading FontFamily from settings, consider handling invalid or unavailable font families by gracefully falling back to the translation-based default rather than throwing at runtime.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ahocagil
pushed a commit
to ahocagil/UA-FastLook
that referenced
this pull request
Sep 9, 2026
…in#1930) * Allow setting of the font and font size used in the text viewer * Refactor font settings initialization * Clamp TextViewer font size from Settings --------- Co-authored-by: ema <mccoy39082@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Brief Description of Changes
Add support for the font and font size settings in the configuration file (QuickLook.Plugin.TextViewer.config).
Related Issue (if any)
Additional Notes
Summary by Sourcery
Add configurable font family and font size support to the text viewer plugin via settings and documentation updates.
New Features:
Documentation: