Debugger - Added stay on top option

This commit is contained in:
SpoinkyNL committed 2020-09-17 00:28:03 +02:00
1 parent 5496ae97ef
commit 5dd2f2dd37
4 files changed
+33 -41

No files matched your search

@@ -18,7 +18,8 @@
Width="800"
Height="800"
d:DesignHeight="800" d:DesignWidth="800" d:DataContext="{d:DesignInstance debug:DebugViewModel}"
Icon="/Resources/Images/Logo/logo-512.png">
Icon="/Resources/Images/Logo/logo-512.png"
Topmost="{Binding StayOnTopSetting.Value}">
<DockPanel>
<mde:AppBar Type="Dense"
Title="Debugger"
@@ -30,6 +31,14 @@
<materialDesign:PopupBox DockPanel.Dock="Right" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<StackPanel>
<Button Command="{s:Action ToggleStayOnTop}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}"
Margin="0 0 10 0"
IsChecked="{Binding StayOnTopSetting.Value}"/>
<TextBlock>Stay on top</TextBlock>
</StackPanel>
</Button>
<Button Content="Force garbage collection" Command="{s:Action ForceGarbageCollection}" />
</StackPanel>
</materialDesign:PopupBox>
@@ -1,4 +1,6 @@
using System;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Screens.Settings.Debug.Tabs;
using Stylet;
@@ -6,16 +8,35 @@ namespace Artemis.UI.Screens.Settings.Debug
{
public class DebugViewModel : Conductor<Screen>.Collection.OneActive
{
public DebugViewModel(RenderDebugViewModel renderDebugViewModel, DataModelDebugViewModel dataModelDebugViewModel, LogsDebugViewModel logsDebugViewModel)
public DebugViewModel(
ISettingsService settingsService,
RenderDebugViewModel renderDebugViewModel,
DataModelDebugViewModel dataModelDebugViewModel,
LogsDebugViewModel logsDebugViewModel)
{
Items.Add(renderDebugViewModel);
Items.Add(dataModelDebugViewModel);
Items.Add(logsDebugViewModel);
ActiveItem = renderDebugViewModel;
StayOnTopSetting = settingsService.GetSetting("Debugger.StayOnTop", false);
}
public PluginSetting<bool> StayOnTopSetting { get; }
public string Title => "Debugger";
public void ToggleStayOnTop()
{
StayOnTopSetting.Value = !StayOnTopSetting.Value;
}
protected override void OnClose()
{
StayOnTopSetting.Save();
base.OnClose();
}
public void ForceGarbageCollection()
{
GC.Collect();