Expand appearance settings to include font and background customization - #4
Merged
Merged
Conversation
The settings window only knew the eight highlight colors. It now also holds the editor background color and the font family and size, all stored in UserDefaults and applied to the open document right away. `ColorSettings` becomes `AppearanceSettings` around a new `EditorTheme` value: palette, background hex, font family and size in one comparable struct, so the text view can tell in one check whether it has to redraw. Two details worth noting: a custom background gets black or white text (and a matching aqua/darkAqua appearance for the scrollers), because `.textColor` follows the system appearance and would otherwise turn unreadable; and the suggest panel draws its rows in the editor font, since that is the text it inserts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EkV7zVGNsJEj5ex3SV1ejf
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.
Summary
Refactored and expanded the appearance customization system to manage not just syntax highlighting colors, but also editor font family, font size, and background color. Renamed
ColorSettingstoAppearanceSettingsto reflect its broader scope.Key Changes
Replaced
ColorSettingswithAppearanceSettings: The new class manages the complete visual appearance of the editor, including:Introduced
EditorThemevalue type: A new struct that encapsulates all theme properties as a single, equatable value for efficient change detection and comparison. Includes computed properties for:Added
FontCatalogutility: Provides cached lists of available monospaced and all font families to avoid repeated expensive NSFontManager queries.Enhanced
SettingsView: Expanded UI to include:Updated
GherkinTextViewand related components:paletteto passing completeEditorThemeExtended
NSColorutilities: AddedisDarkproperty using Rec. 601 brightness calculation to determine appropriate text color contrast.Updated README: Added documentation about font and background customization features.
Implementation Details
EditorThemeequality comparison, triggering rehighlighting only when necessaryhttps://claude.ai/code/session_01EkV7zVGNsJEj5ex3SV1ejf