Merge pull request #147 from kkebo/fix-donebutton-color-on-mac-catalyst

fix: fix `EditButton` color on Mac Catalyst
This commit is contained in:
Kenta Kubo 2025-09-07 22:40:30 +09:00 committed by GitHub
commit 7e4e5e6f37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -325,7 +325,27 @@ extension ContentView: View {
@ToolbarContentBuilder private var toolbarContent: some ToolbarContent {
ToolbarItem(placement: .topBarLeading) {
if #available(iOS 26, *) {
EditButton()
#if targetEnvironment(macCatalyst)
// Workaround for the issue that the checkmark icon is hard to see if System Settings > Appearance > Theme > Color is Multicolor.
Button {
withAnimation {
if !self.sidebarEditMode.isEditing {
self.sidebarEditMode = .active
} else {
self.sidebarEditMode = .inactive
}
}
} label: {
if !self.sidebarEditMode.isEditing {
Text("Edit")
} else {
Label("Done", systemImage: "checkmark")
}
}
.tint(self.sidebarEditMode.isEditing ? .accentColor : .primary)
#else
EditButton()
#endif
} else {
self.addMenu
}