diff --git a/app/NativeMacReceiverSelector/ReceiverView.swift b/app/NativeMacReceiverSelector/ReceiverView.swift index af23158..1739f76 100644 --- a/app/NativeMacReceiverSelector/ReceiverView.swift +++ b/app/NativeMacReceiverSelector/ReceiverView.swift @@ -37,15 +37,24 @@ class ReceiverView : NSStackView { self.receiver = receiver + let statusText = receiver.status.application.isIdleScreen ? "\(receiver.host):\(receiver.port)" : receiver.status.application.statusText + let addressLabel = makeLabel(statusText + , size: NSFont.smallSystemFontSize + , color: .secondaryLabelColor) + + // Truncate long status text + addressLabel.toolTip = statusText + addressLabel.cell?.lineBreakMode = .byTruncatingTail + addressLabel.setContentCompressionResistancePriority( + .defaultLow, for: .horizontal) + let metaStackView = NSStackView(views: [ makeLabel(receiver.friendlyName, size: 14) - , makeLabel(statusText - , size: NSFont.smallSystemFontSize - , color: .secondaryLabelColor) + , addressLabel ]) metaStackView.alignment = .leading diff --git a/ext/src/ui/popup/index.tsx b/ext/src/ui/popup/index.tsx index 7000804..fe5b2ed 100755 --- a/ext/src/ui/popup/index.tsx +++ b/ext/src/ui/popup/index.tsx @@ -229,15 +229,18 @@ class ReceiverEntry extends Component { } public render () { + const { application } = this.props.receiver.status; + return (
  • { this.props.receiver.friendlyName }
    -
    - { this.props.receiver.status.application.isIdleScreen +
    + { application.isIdleScreen ? `${this.props.receiver.host}:${this.props.receiver.port}` - : this.props.receiver.status.application.statusText } + : application.statusText }