Show stop button text regardless of receiver idle state

This commit is contained in:
hensm
2020-01-20 01:24:14 +00:00
parent ede9de4f7d
commit 058b40b3cd
2 changed files with 14 additions and 3 deletions

View File

@@ -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

View File

@@ -302,7 +302,7 @@ class ReceiverEntry extends Component<ReceiverEntryProps, ReceiverEntryState> {
, (this.state.isLoading
? this.state.ellipsis
: ""))
: !application.isIdleScreen && this.state.showAlternateAction
: this.state.showAlternateAction
? _("popupStopButtonTitle")
: _("popupCastButtonTitle") }
</button>