mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Plugins - Added API versioning
Tray icon - Fix crash when restoring main window from tray
This commit is contained in:
1 parent
a282bf3fd7
commit
9d2136dd6a
3 files changed
+31
-7
No files matched your search
@@ -127,10 +127,16 @@ namespace Artemis.UI.Screens.Root
|
||||
|
||||
public void OpenScreen(string displayName)
|
||||
{
|
||||
// The window will open on the UI thread at some point, respond to that to select the chosen screen
|
||||
MainWindowOpened += OnEventHandler;
|
||||
OpenMainWindow();
|
||||
|
||||
// At this point there is a sidebar VM because the main window was opened
|
||||
SidebarViewModel!.SelectedSidebarScreen = SidebarViewModel.SidebarScreens.FirstOrDefault(s => s.DisplayName == displayName);
|
||||
void OnEventHandler(object? sender, EventArgs args)
|
||||
{
|
||||
if (SidebarViewModel != null)
|
||||
SidebarViewModel.SelectedSidebarScreen = SidebarViewModel.SidebarScreens.FirstOrDefault(s => s.DisplayName == displayName);
|
||||
MainWindowOpened -= OnEventHandler;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OpenDebugger()
|
||||
@@ -167,7 +173,7 @@ namespace Artemis.UI.Screens.Root
|
||||
|
||||
_lifeTime.MainWindow.WindowState = WindowState.Normal;
|
||||
_lifeTime.MainWindow.Activate();
|
||||
OnMainWindowOpened();
|
||||
OnMainWindowOpened();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user