fix tray icon

This commit is contained in:
Jakob 2023-09-25 20:26:35 +02:00
parent a601b8937c
commit aa7aeff1f8
4 changed files with 8 additions and 1 deletions

View file

@ -26,6 +26,9 @@ namespace EnvyUpdate
{
InitializeComponent();
if (GlobalVars.startMinimized)
Application.Current.MainWindow.Hide(); // Hide only AFTER initializing dashboard page, otherwise tray icon doesn't work
if (Debug.isFake)
localDriv = Debug.LocalDriv();
else

View file

@ -244,6 +244,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Hardcodet.NotifyIcon.Wpf">
<Version>1.1.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
<Version>7.1.3</Version>
</PackageReference>

View file

@ -12,6 +12,7 @@ namespace EnvyUpdate
public static readonly string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\envyupdate\\";
public static readonly string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
public static bool monitoringInstall = false;
public static bool startMinimized = false;
public static readonly string useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Firefox/115.0";
}
}

View file

@ -84,7 +84,7 @@ namespace EnvyUpdate
{
Debug.LogToFile("INFO Launching minimized.");
WindowState = WindowState.Minimized;
Hide();
GlobalVars.startMinimized = true;
}
GlobalVars.isMobile = Util.IsMobile();