Skip to content

Commit

Permalink
Workaround disappearing header in empty search results
Browse files Browse the repository at this point in the history
It still blinks but at least still shown
#555
  • Loading branch information
p0deje committed Sep 25, 2023
1 parent fd10f90 commit 58549a6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Maccy/Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,12 @@ class Menu: NSMenu, NSMenuDelegate {

private func highlightItem(_ itemToHighlight: NSMenuItem?) {
let highlightItemSelector = NSSelectorFromString("highlightItem:")
if let item = itemToHighlight, !item.isHighlighted {
// we need to highlight filter menu item to force menu redrawing
// when it has more items that can fit into the screen height
// and scrolling items are added to the top and bottom of menu
perform(highlightItemSelector, with: items.first)
if items.contains(item) {
perform(highlightItemSelector, with: item)
}
// we need to highlight filter menu item to force menu redrawing
// when it has more items that can fit into the screen height
// and scrolling items are added to the top and bottom of menu
perform(highlightItemSelector, with: items.first)
if let item = itemToHighlight, !item.isHighlighted, items.contains(item) {
perform(highlightItemSelector, with: item)
} else {
// Unhighlight current item.
perform(highlightItemSelector, with: nil)
Expand Down

0 comments on commit 58549a6

Please sign in to comment.