Skip to content

Commit

Permalink
add better close check for esc
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjmcghee committed Dec 27, 2023
1 parent 81c9946 commit 28402a9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rem/remApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
if (self?.searchViewWindow?.isVisible ?? false) && event.keyCode == 53 {
self?.closeSearchView()
}

if (self?.timelineViewWindow?.isVisible ?? false) && event.keyCode == 53 {
self?.closeTimelineView()
}
return event
}

Expand Down Expand Up @@ -445,6 +449,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
searchViewWindow?.close()
}

func closeTimelineView() {
timelineViewWindow?.isReleasedWhenClosed = false
timelineViewWindow?.close()
}

@objc func showSearchView() {
// Ensure that the search view window is created and shown
if searchViewWindow == nil {
Expand Down

0 comments on commit 28402a9

Please sign in to comment.