mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 21:52:25 +00:00
macOS 一些优化 (#6596)
* [macOS] hide icon in Dock * [macOS] fix: close button not work * [macOS] fix: cant directly show window when click `Show or hide the main window` on minimized
This commit is contained in:
parent
e674a025d8
commit
f71125d8f3
2 changed files with 26 additions and 24 deletions
|
@ -52,5 +52,6 @@ internal class Program
|
||||||
//.WithInterFont()
|
//.WithInterFont()
|
||||||
.WithFontByDefault()
|
.WithFontByDefault()
|
||||||
.LogToTrace()
|
.LogToTrace()
|
||||||
.UseReactiveUI();
|
.UseReactiveUI()
|
||||||
|
.With(new MacOSPlatformOptions { ShowInDock = false});
|
||||||
}
|
}
|
|
@ -390,6 +390,7 @@ namespace v2rayN.Desktop.Views
|
||||||
StorageUI();
|
StorageUI();
|
||||||
|
|
||||||
await ViewModel?.MyAppExitAsync(false);
|
await ViewModel?.MyAppExitAsync(false);
|
||||||
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Event
|
#endregion Event
|
||||||
|
@ -398,7 +399,7 @@ namespace v2rayN.Desktop.Views
|
||||||
|
|
||||||
public void ShowHideWindow(bool? blShow)
|
public void ShowHideWindow(bool? blShow)
|
||||||
{
|
{
|
||||||
var bl = blShow ?? !_config.UiItem.ShowInTaskbar;
|
var bl = blShow ?? (!_config.UiItem.ShowInTaskbar ^ (WindowState==WindowState.Minimized));
|
||||||
if (bl)
|
if (bl)
|
||||||
{
|
{
|
||||||
this.Show();
|
this.Show();
|
||||||
|
@ -411,7 +412,7 @@ namespace v2rayN.Desktop.Views
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_config.UiItem.Hide2TrayWhenClose)
|
if (Utils.IsOSX() || _config.UiItem.Hide2TrayWhenClose)
|
||||||
{
|
{
|
||||||
this.Hide();
|
this.Hide();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue