Skip to content

Commit

Permalink
Highlight sort button when name sort is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
jotaemepereira committed Jul 19, 2024
1 parent 3f1583e commit c34d7af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DuckDuckGo/Bookmarks/View/BookmarkListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ final class BookmarkListViewController: NSViewController {
hideSearchBar()
dataSource.reloadData(with: mode)
outlineView.reloadData()
sortBookmarksButton.backgroundColor = mode.shouldHighlightButton ? .buttonMouseDown : .clear
sortBookmarksButton.mouseOverColor = mode.shouldHighlightButton ? .buttonMouseDown : .buttonMouseOver
}

@objc func openManagementInterface(_ sender: NSButton) {
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/Bookmarks/ViewModel/SortBookmarksViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ enum BookmarksSortMode: Codable {
}
}

var shouldHighlightButton: Bool {
return self != .manual
}

var menu: NSMenu {
switch self {
case .manual:
Expand Down

0 comments on commit c34d7af

Please sign in to comment.