mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-31 21:12:10 +00:00
Add some Mac tooltips
- Refresh infrastructure - Favorite/Unfavorite
This commit is contained in:
parent
3ce6678f51
commit
3e438b2695
@ -100,6 +100,7 @@ class ProviderServiceView: NSView {
|
|||||||
checkOnlyShowsFavorites.title = L10n.Service.Cells.OnlyShowsFavorites.caption
|
checkOnlyShowsFavorites.title = L10n.Service.Cells.OnlyShowsFavorites.caption
|
||||||
checkOnlyShowsFavorites.state = .off
|
checkOnlyShowsFavorites.state = .off
|
||||||
buttonRefreshInfrastructure.image = NSImage(named: NSImage.refreshTemplateName)
|
buttonRefreshInfrastructure.image = NSImage(named: NSImage.refreshTemplateName)
|
||||||
|
buttonRefreshInfrastructure.toolTip = L10n.Service.Cells.Provider.Refresh.caption
|
||||||
buttonFavorite.image = NSImage(named: NSImage.bookmarksTemplateName)
|
buttonFavorite.image = NSImage(named: NSImage.bookmarksTemplateName)
|
||||||
|
|
||||||
updateFavoriteState()
|
updateFavoriteState()
|
||||||
@ -138,8 +139,10 @@ class ProviderServiceView: NSView {
|
|||||||
if isFavorite {
|
if isFavorite {
|
||||||
profile?.favoriteGroupIds = profile?.favoriteGroupIds ?? []
|
profile?.favoriteGroupIds = profile?.favoriteGroupIds ?? []
|
||||||
profile?.favoriteGroupIds?.append(groupId)
|
profile?.favoriteGroupIds?.append(groupId)
|
||||||
|
buttonFavorite.toolTip = L10n.Provider.Pool.Actions.unfavorite
|
||||||
} else {
|
} else {
|
||||||
profile?.favoriteGroupIds?.removeAll { $0 == groupId }
|
profile?.favoriteGroupIds?.removeAll { $0 == groupId }
|
||||||
|
buttonFavorite.toolTip = L10n.Provider.Pool.Actions.favorite
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable favorite while filtering favorites
|
// disable favorite while filtering favorites
|
||||||
@ -294,6 +297,7 @@ class ProviderServiceView: NSView {
|
|||||||
let groupId = group.uniqueId(in: category)
|
let groupId = group.uniqueId(in: category)
|
||||||
let isFavorite = profile?.favoriteGroupIds?.contains(groupId) ?? false
|
let isFavorite = profile?.favoriteGroupIds?.contains(groupId) ?? false
|
||||||
buttonFavorite.state = isFavorite ? .on : .off
|
buttonFavorite.state = isFavorite ? .on : .off
|
||||||
|
buttonFavorite.toolTip = (isFavorite ? L10n.Provider.Pool.Actions.unfavorite : L10n.Provider.Pool.Actions.favorite)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func delegateSelectedPool() {
|
private func delegateSelectedPool() {
|
||||||
|
Loading…
Reference in New Issue
Block a user