mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 02:29:59 +00:00
Show stop button text regardless of receiver idle state
This commit is contained in:
@@ -75,15 +75,26 @@ class ReceiverView : NSStackView {
|
||||
self.addArrangedSubview(self.castButton)
|
||||
|
||||
self.distribution = .fill
|
||||
|
||||
|
||||
var wasDisabled = false
|
||||
|
||||
NSEvent.addLocalMonitorForEvents(
|
||||
matching: .flagsChanged) { event in
|
||||
|
||||
if !self.receiver.status.application.isIdleScreen &&
|
||||
event.modifierFlags.contains(.option) {
|
||||
if wasDisabled {
|
||||
self.castButton.isEnabled = false
|
||||
}
|
||||
|
||||
if event.modifierFlags.contains(.option) {
|
||||
self.castButton.title =
|
||||
InitDataProvider.shared.data.i18n_stopButtonTitle
|
||||
self.castButton.action = #selector(ReceiverView.onStop)
|
||||
if !self.castButton.isEnabled {
|
||||
self.castButton.isEnabled =
|
||||
!self.receiver.status.application.isIdleScreen
|
||||
wasDisabled = self.castButton.isEnabled
|
||||
}
|
||||
} else {
|
||||
self.castButton.title =
|
||||
InitDataProvider.shared.data.i18n_castButtonTitle
|
||||
|
||||
Reference in New Issue
Block a user