mirror of
https://github.com/kkebo/DNSecure.git
synced 2026-03-11 08:54:36 +00:00
Merge pull request #147 from kkebo/fix-donebutton-color-on-mac-catalyst
fix: fix `EditButton` color on Mac Catalyst
This commit is contained in:
commit
7e4e5e6f37
1 changed files with 21 additions and 1 deletions
|
|
@ -325,7 +325,27 @@ extension ContentView: View {
|
||||||
@ToolbarContentBuilder private var toolbarContent: some ToolbarContent {
|
@ToolbarContentBuilder private var toolbarContent: some ToolbarContent {
|
||||||
ToolbarItem(placement: .topBarLeading) {
|
ToolbarItem(placement: .topBarLeading) {
|
||||||
if #available(iOS 26, *) {
|
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 {
|
} else {
|
||||||
self.addMenu
|
self.addMenu
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue