From d8892f9d92e4acf3aa1d751e5f4832e3328419c1 Mon Sep 17 00:00:00 2001 From: Serhii Bykov Date: Thu, 15 Oct 2026 21:47:53 +0200 Subject: [PATCH] refactor: rename color panel controller --- .../Features/Settings/Keyboard/KeyboardSettingsPane.swift | 2 +- .../Keyty/Features/Settings/Mouse/MouseSettingsPane.swift | 6 +++--- .../AppKit/{ColorPanel.swift => ColorPanelController.swift} | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) rename Apps/Keyty/Sources/Keyty/Support/Bridges/AppKit/{ColorPanel.swift => ColorPanelController.swift} (77%) diff --git a/Apps/Keyty/Sources/Keyty/Features/Settings/Keyboard/KeyboardSettingsPane.swift b/Apps/Keyty/Sources/Keyty/Features/Settings/Keyboard/KeyboardSettingsPane.swift index ac054a30..d8f65077 100644 --- a/Apps/Keyty/Sources/Keyty/Features/Settings/Keyboard/KeyboardSettingsPane.swift +++ b/Apps/Keyty/Sources/Keyty/Features/Settings/Keyboard/KeyboardSettingsPane.swift @@ -11,7 +11,7 @@ import SwiftUI struct KeyboardSettingsPane: View { @StateObject private var model: KeyboardSettingsPaneViewModel - @State private var legendColorPanel = ColorPanel() + @State private var legendColorPanel = ColorPanelController() init(settings: KeyboardVisualizerSettings) { self._model = StateObject(wrappedValue: KeyboardSettingsPaneViewModel(settings: settings)) diff --git a/Apps/Keyty/Sources/Keyty/Features/Settings/Mouse/MouseSettingsPane.swift b/Apps/Keyty/Sources/Keyty/Features/Settings/Mouse/MouseSettingsPane.swift index 2bcad7e5..52bfb56e 100644 --- a/Apps/Keyty/Sources/Keyty/Features/Settings/Mouse/MouseSettingsPane.swift +++ b/Apps/Keyty/Sources/Keyty/Features/Settings/Mouse/MouseSettingsPane.swift @@ -11,9 +11,9 @@ import SwiftUI struct MouseSettingsPane: View { @StateObject var model: MouseSettingsPaneViewModel - @State var ringColorPanel = ColorPanel() - @State var iconBackgroundColorPanel = ColorPanel() - @State var iconTintColorPanel = ColorPanel() + @State var ringColorPanel = ColorPanelController() + @State var iconBackgroundColorPanel = ColorPanelController() + @State var iconTintColorPanel = ColorPanelController() init( pointerRingVisualizer: PointerRingVisualizer, diff --git a/Apps/Keyty/Sources/Keyty/Support/Bridges/AppKit/ColorPanel.swift b/Apps/Keyty/Sources/Keyty/Support/Bridges/AppKit/ColorPanelController.swift similarity index 77% rename from Apps/Keyty/Sources/Keyty/Support/Bridges/AppKit/ColorPanel.swift rename to Apps/Keyty/Sources/Keyty/Support/Bridges/AppKit/ColorPanelController.swift index 60e9274b..f0cf60b6 100644 --- a/Apps/Keyty/Sources/Keyty/Support/Bridges/AppKit/ColorPanel.swift +++ b/Apps/Keyty/Sources/Keyty/Support/Bridges/AppKit/ColorPanelController.swift @@ -1,5 +1,5 @@ // -// ColorPanel.swift +// ColorPanelController.swift // Keyty // // SPDX-FileCopyrightText: 2026 Serhii Bykov @@ -8,8 +8,9 @@ import AppKit +/// Bridges the shared `NSColorPanel` target-action callbacks to closure-based color-change handling. @MainActor -final class ColorPanel: NSObject { +final class ColorPanelController: NSObject { var onColorChange: ((NSColor) -> Void)? func present(initialColor: NSColor) {