diff --git a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs index 5e60eddc..dc345dac 100644 --- a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs @@ -175,6 +175,8 @@ namespace v2rayN.ViewModels [Reactive] public string RunningServerDisplay { get; set; } [Reactive] + public string RunningServerToolTipText { get; set; } + [Reactive] public string RunningInfoDisplay { get; set; } [Reactive] public string SpeedProxyDisplay { get; set; } @@ -770,7 +772,10 @@ namespace v2rayN.ViewModels var running = ConfigHandler.GetDefaultServer(ref _config); if (running != null) { - RunningServerDisplay = string.Format("{0}:{1}", ResUI.menuServers, running.GetSummary()); + var runningSummary = running.GetSummary(); + var runningProfileItemModel = _profileItems.FirstOrDefault(t => t.indexId == running.indexId); + RunningServerDisplay = $"{ResUI.menuServers}:{runningSummary}"; + RunningServerToolTipText = runningProfileItemModel is null ? runningSummary : $"[{runningProfileItemModel.subRemarks}] {runningSummary}"; } })); } diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index 1a528d8d..9be80b66 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -158,6 +158,7 @@ namespace v2rayN.Views this.BindCommand(ViewModel, vm => vm.SubUpdateViaProxyCmd, v => v.menuSubUpdateViaProxy2).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.NotifyIcon, v => v.tbNotify.Icon).DisposeWith(disposables); + this.OneWayBind(ViewModel, vm => vm.RunningServerToolTipText, v => v.tbNotify.ToolTipText).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.NotifyLeftClickCmd, v => v.tbNotify.LeftClickCommand).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.AppIcon, v => v.Icon).DisposeWith(disposables);