mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 08:39: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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user