Skip to content

Commit 26bbc97

Browse files
authored
refactor: replace fragmented theme system with unified ThemeEngine (#320)
* refactor: replace fragmented theme system with unified ThemeEngine * fix: address review issues in theme engine migration
1 parent 16040f7 commit 26bbc97

57 files changed

Lines changed: 1245 additions & 944 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

TablePro/Core/AI/InlineSuggestionManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ final class InlineSuggestionManager {
310310
layer.allowsFontSubpixelQuantization = true
311311

312312
// Use the editor's font and grey color for ghost appearance
313-
let font = SQLEditorTheme.font
313+
let font = ThemeEngine.shared.editorFonts.font
314314
let attrs: [NSAttributedString.Key: Any] = [
315315
.font: font,
316316
.foregroundColor: NSColor.tertiaryLabelColor

TablePro/Core/Plugins/PluginManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ final class PluginManager {
515515
if let hex = PluginMetadataRegistry.shared.snapshot(forTypeId: databaseType.pluginTypeId)?.brandColorHex {
516516
return Color(hex: hex)
517517
}
518-
return Theme.defaultDatabaseColor
518+
return Color.gray
519519
}
520520

521521
func supportsDatabaseSwitching(for databaseType: DatabaseType) -> Bool {

TablePro/Core/Services/Infrastructure/SettingsNotifications.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ extension Notification.Name {
1818
static let editorSettingsDidChange = Notification.Name("editorSettingsDidChange")
1919

2020
/// Posted when the system accessibility text size preference changes.
21-
/// Observers should reload fonts via SQLEditorTheme.reloadFromSettings().
21+
/// Observers should reload fonts via ThemeEngine.shared.reloadFontCaches().
2222
static let accessibilityTextSizeDidChange = Notification.Name("accessibilityTextSizeDidChange")
23+
24+
/// Posted when the active theme changes (colors, fonts, or entire theme switch).
25+
/// Used by AppKit components that cannot observe @Observable directly.
26+
static let themeDidChange = Notification.Name("themeDidChange")
2327
}

TablePro/Core/Vim/VimCursorManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ final class VimCursorManager {
9696
}
9797

9898
// Calculate character width from the editor font
99-
let font = SQLEditorTheme.font
99+
let font = ThemeEngine.shared.editorFonts.font
100100
let charWidth = (NSString(" ").size(withAttributes: [.font: font])).width
101101

102102
guard charWidth > 0 else {
@@ -122,7 +122,7 @@ final class VimCursorManager {
122122
// Create new layer
123123
let layer = CALayer()
124124
layer.contentsScale = textView.window?.backingScaleFactor ?? 2.0
125-
layer.backgroundColor = SQLEditorTheme.insertionPoint.withAlphaComponent(0.4).cgColor
125+
layer.backgroundColor = ThemeEngine.shared.colors.editor.cursor.withAlphaComponent(0.4).cgColor
126126
layer.frame = frame
127127

128128
// Add blink animation

0 commit comments

Comments
 (0)