Noise brush - Added default values

Color brush - Added default values
UI - Replaced OnActivate overrides in screens with the more appropriate OnInitialActivate
Tray icon - Fixed empty window appearing for half a second on startup
This commit is contained in:
SpoinkyNL committed 2020-02-23 22:28:56 +01:00
1 parent 5710acb321
commit f704e66296
10 files changed
+54 -45

No files matched your search

+14 -5
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
@@ -31,21 +32,29 @@ namespace Artemis.UI
protected override void Launch()
{
StartupArguments = Args.ToList();
var logger = Kernel.Get<ILogger>();
var windowManager = Kernel.Get<IWindowManager>();
windowManager.ShowWindow(RootViewModel);
var viewManager = Kernel.Get<IViewManager>();
Task.Run(() =>
Task.Run(async () =>
{
try
{
StartupArguments = Args.ToList();
if (StartupArguments.Contains("-autorun"))
{
logger.Information("Sleeping for 15 seconds on auto run to allow applications like iCUE and LGS to start");
await Task.Delay(TimeSpan.FromSeconds(15));
}
// Create and bind the root view, this is a tray icon so don't show it with the window manager
Execute.OnUIThread(() => viewManager.CreateAndBindViewForModelIfNecessary(RootViewModel));
// Start the Artemis core
_core = Kernel.Get<ICoreService>();
}
catch (Exception e)
{
var logger = Kernel.Get<ILogger>();
logger.Fatal(e, "Fatal exception during initialization, shutting down.");
// TODO: A proper exception viewer
@@ -1,8 +1,7 @@
{
"profiles": {
"Artemis.UI": {
"commandName": "Project",
"commandLineArgs": "-autorun"
"commandName": "Project"
}
}
}
@@ -120,19 +120,19 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
_profileEditorService.RedoUpdateProfile(Module);
}
protected override void OnActivate()
protected override void OnInitialActivate()
{
LoadWorkspaceSettings();
_profileEditorService.StopRegularRender();
Task.Run(LoadProfiles);
base.OnActivate();
base.OnInitialActivate();
}
protected override void OnDeactivate()
protected override void OnClose()
{
SaveWorkspaceSettings();
_profileEditorService.ResumeRegularRender();
base.OnDeactivate();
base.OnClose();
}
private void ChangeSelectedProfile(Profile profile)
@@ -114,7 +114,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
}
}
protected override void OnActivate()
protected override void OnInitialActivate()
{
HighlightSelectedLayer = _settingsService.GetSetting("ProfileEditor.HighlightSelectedLayer", true);
PauseRenderingOnFocusLoss = _settingsService.GetSetting("ProfileEditor.PauseRenderingOnFocusLoss", true);
@@ -122,10 +122,10 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
HighlightSelectedLayer.SettingChanged += HighlightSelectedLayerOnSettingChanged;
_updateTrigger.Start();
base.OnActivate();
base.OnInitialActivate();
}
protected override void OnDeactivate()
protected override void OnClose()
{
HighlightSelectedLayer.Save();
PauseRenderingOnFocusLoss.Save();
@@ -139,7 +139,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
// TODO: Remove when fixed in RGB.NET, or avoid double stopping
}
base.OnDeactivate();
base.OnClose();
}
private void CreateUpdateTrigger()
@@ -36,18 +36,18 @@ namespace Artemis.UI.Screens.Settings.Debug
GC.WaitForPendingFinalizers();
}
protected override void OnActivate()
protected override void OnInitialActivate()
{
_coreService.FrameRendered += CoreServiceOnFrameRendered;
_coreService.FrameRendering += CoreServiceOnFrameRendering;
base.OnActivate();
base.OnInitialActivate();
}
protected override void OnDeactivate()
protected override void OnClose()
{
_coreService.FrameRendered -= CoreServiceOnFrameRendered;
_coreService.FrameRendering -= CoreServiceOnFrameRendering;
base.OnDeactivate();
base.OnClose();
}
private void CoreServiceOnFrameRendered(object sender, FrameRenderedEventArgs e)
@@ -142,17 +142,17 @@ namespace Artemis.UI.Screens.SurfaceEditor
#region Overrides of Screen
protected override void OnActivate()
protected override void OnInitialActivate()
{
LoadSurfaceConfigurations();
LoadWorkspaceSettings();
base.OnActivate();
base.OnInitialActivate();
}
protected override void OnDeactivate()
protected override void OnClose()
{
SaveWorkspaceSettings();
base.OnDeactivate();
base.OnClose();
}
#endregion
+3 -2
View File
@@ -1,4 +1,4 @@
<Window x:Class="Artemis.UI.Screens.TrayView"
<controls:MaterialWindow x:Class="Artemis.UI.Screens.TrayView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -6,6 +6,7 @@
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:controls="clr-namespace:MaterialDesignExtensions.Controls;assembly=MaterialDesignExtensions"
mc:Ignorable="d"
Title="Artemis"
Height="1"
@@ -33,4 +34,4 @@
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
</Window>
</controls:MaterialWindow>