Merge pull request #695 from kiwix/532-bookmark-no-long-press

532 bookmark no long press
This commit is contained in:
Kelson 2024-03-20 17:28:20 +01:00 committed by GitHub
commit 5b339ee389
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,6 +71,26 @@ struct BookmarkButton: View {
Text("common.button.done".localized).fontWeight(.semibold)
}
}
ToolbarItem(placement: .navigationBarTrailing) {
Button {
if browser.articleBookmarked {
browser.deleteBookmark()
} else {
browser.createBookmark()
}
} label: {
Label {
Text(
browser.articleBookmarked ?
"common.dialog.button.remove_bookmark".localized :
"common.dialog.button.add_bookmark".localized
)
} icon: {
Image(systemName: browser.articleBookmarked ? "star.fill" : "star")
.renderingMode(browser.articleBookmarked ? .original : .template)
}
}.disabled(browser.url == nil)
}
}
}
.frame(idealWidth: 360, idealHeight: 600)