-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ColorPicker's opacity for macOS 14
- Loading branch information
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// Workaround.swift | ||
// | ||
// | ||
// Created by Tatsuya Tanaka on 2023/10/07. | ||
// | ||
|
||
import AppKit | ||
|
||
public enum Workaround { | ||
public static func fixColorPickerOpacity_macOS14() { | ||
if #available(macOS 14, *) { | ||
// The root cause is unknown, but under specific conditions on macOS 14, | ||
// changes to the opacity of SwiftUI's ColorPicker might not be reflected. | ||
// Calling the following can avoid the issue. | ||
NSColorPanel.shared.showsAlpha = true | ||
} | ||
} | ||
} |