1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-01-01 02:03:32 +00:00

Debugger - Added stay on top option

This commit is contained in:
SpoinkyNL 2020-09-17 00:28:03 +02:00
parent 050eb5bd2f
commit 375c04090b
4 changed files with 33 additions and 41 deletions

View File

@ -350,9 +350,7 @@ namespace Artemis.Core
// No point rendering if the alpha was set to zero by one of the effects // No point rendering if the alpha was set to zero by one of the effects
if (layerPaint.Color.Alpha == 0) if (layerPaint.Color.Alpha == 0)
return; return;
layerCanvas.ClipPath(layerPath);
if (!LayerBrush.SupportsTransformation) if (!LayerBrush.SupportsTransformation)
SimpleRender(layerCanvas, _layerBitmap.Info, layerPaint, layerPath); SimpleRender(layerCanvas, _layerBitmap.Info, layerPaint, layerPath);
else if (General.ResizeMode.CurrentValue == LayerResizeMode.Normal) else if (General.ResizeMode.CurrentValue == LayerResizeMode.Normal)

View File

@ -35,15 +35,6 @@
"ExpandedPropertyGroups": { "ExpandedPropertyGroups": {
"$type": "System.Collections.Generic.List`1[[System.String, System.Private.CoreLib]], System.Private.CoreLib", "$type": "System.Collections.Generic.List`1[[System.String, System.Private.CoreLib]], System.Private.CoreLib",
"$values": [] "$values": []
},
"RootDisplayCondition": {
"$type": "Artemis.Storage.Entities.Profile.DisplayConditionGroupEntity, Artemis.Storage",
"BooleanOperator": 0,
"Children": {
"$type":
"System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib",
"$values": []
}
} }
} }
] ]
@ -322,15 +313,6 @@
"$values": [ "$values": [
"LayerBrush" "LayerBrush"
] ]
},
"RootDisplayCondition": {
"$type": "Artemis.Storage.Entities.Profile.DisplayConditionGroupEntity, Artemis.Storage",
"BooleanOperator": 0,
"Children": {
"$type":
"System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib",
"$values": []
}
} }
}, },
{ {
@ -586,15 +568,6 @@
"ExpandedPropertyGroups": { "ExpandedPropertyGroups": {
"$type": "System.Collections.Generic.List`1[[System.String, System.Private.CoreLib]], System.Private.CoreLib", "$type": "System.Collections.Generic.List`1[[System.String, System.Private.CoreLib]], System.Private.CoreLib",
"$values": [] "$values": []
},
"RootDisplayCondition": {
"$type": "Artemis.Storage.Entities.Profile.DisplayConditionGroupEntity, Artemis.Storage",
"BooleanOperator": 0,
"Children": {
"$type":
"System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib",
"$values": []
}
} }
}, },
{ {
@ -837,15 +810,6 @@
"$values": [ "$values": [
"LayerBrush" "LayerBrush"
] ]
},
"RootDisplayCondition": {
"$type": "Artemis.Storage.Entities.Profile.DisplayConditionGroupEntity, Artemis.Storage",
"BooleanOperator": 0,
"Children": {
"$type":
"System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib",
"$values": []
}
} }
} }
] ]

View File

@ -18,7 +18,8 @@
Width="800" Width="800"
Height="800" Height="800"
d:DesignHeight="800" d:DesignWidth="800" d:DataContext="{d:DesignInstance debug:DebugViewModel}" 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> <DockPanel>
<mde:AppBar Type="Dense" <mde:AppBar Type="Dense"
Title="Debugger" Title="Debugger"
@ -30,6 +31,14 @@
<materialDesign:PopupBox DockPanel.Dock="Right" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False"> <materialDesign:PopupBox DockPanel.Dock="Right" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<StackPanel> <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}" /> <Button Content="Force garbage collection" Command="{s:Action ForceGarbageCollection}" />
</StackPanel> </StackPanel>
</materialDesign:PopupBox> </materialDesign:PopupBox>

View File

@ -1,4 +1,6 @@
using System; using System;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Screens.Settings.Debug.Tabs; using Artemis.UI.Screens.Settings.Debug.Tabs;
using Stylet; using Stylet;
@ -6,16 +8,35 @@ namespace Artemis.UI.Screens.Settings.Debug
{ {
public class DebugViewModel : Conductor<Screen>.Collection.OneActive 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(renderDebugViewModel);
Items.Add(dataModelDebugViewModel); Items.Add(dataModelDebugViewModel);
Items.Add(logsDebugViewModel); Items.Add(logsDebugViewModel);
ActiveItem = renderDebugViewModel; ActiveItem = renderDebugViewModel;
StayOnTopSetting = settingsService.GetSetting("Debugger.StayOnTop", false);
} }
public PluginSetting<bool> StayOnTopSetting { get; }
public string Title => "Debugger"; public string Title => "Debugger";
public void ToggleStayOnTop()
{
StayOnTopSetting.Value = !StayOnTopSetting.Value;
}
protected override void OnClose()
{
StayOnTopSetting.Save();
base.OnClose();
}
public void ForceGarbageCollection() public void ForceGarbageCollection()
{ {
GC.Collect(); GC.Collect();