mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Added devices ZIndex
This commit is contained in:
1 parent
d9c2e7b2dc
commit
10b2328561
9 files changed
+172
-44
No files matched your search
@@ -26,6 +26,7 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
|
||||
public IRGBDevice Device { get; }
|
||||
public SelectionStatus SelectionStatus { get; set; }
|
||||
public Cursor Cursor { get; set; }
|
||||
public int ZIndex { get; set; }
|
||||
|
||||
public IReadOnlyCollection<SurfaceLedViewModel> Leds => _leds.AsReadOnly();
|
||||
public Rect DeviceRectangle => new Rect(Device.Location.X, Device.Location.Y, Device.Size.Width, Device.Size.Height);
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Artemis.UI.ViewModels.Screens
|
||||
SelectedSurfaceConfiguration = AddSurfaceConfiguration("Default");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public SurfaceConfiguration AddSurfaceConfiguration(string name)
|
||||
{
|
||||
var config = new SurfaceConfiguration(name);
|
||||
@@ -107,7 +107,7 @@ namespace Artemis.UI.ViewModels.Screens
|
||||
|
||||
public void BringForward(SurfaceDeviceViewModel surfaceDeviceViewModel)
|
||||
{
|
||||
Console.WriteLine("Bring forward");
|
||||
surfaceDeviceViewModel.ZIndex++;
|
||||
}
|
||||
|
||||
public void SendToBack(SurfaceDeviceViewModel surfaceDeviceViewModel)
|
||||
@@ -117,7 +117,7 @@ namespace Artemis.UI.ViewModels.Screens
|
||||
|
||||
public void SendBackward(SurfaceDeviceViewModel surfaceDeviceViewModel)
|
||||
{
|
||||
Console.WriteLine("Send backward");
|
||||
surfaceDeviceViewModel.ZIndex--;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Cursor="{Binding Cursor}"
|
||||
MouseEnter="{s:Action MouseEnter}"
|
||||
MouseLeave="{s:Action MouseLeave}">
|
||||
MouseLeave="{s:Action MouseLeave}"
|
||||
ToolTip="{Binding Device.DeviceInfo.DeviceName}">
|
||||
<UserControl.Resources>
|
||||
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
|
||||
</UserControl.Resources>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<Grid.Background>
|
||||
<ImageBrush TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,15,15" ImageSource="/Artemis.UI;component/Resources/tile.png" />
|
||||
</Grid.Background>
|
||||
<ItemsControl ItemsSource="{Binding Devices}" ClipToBounds="True">
|
||||
<ItemsControl ItemsSource="{Binding Devices}" ClipToBounds="True" Panel.ZIndex="{Binding Device.ZIndex}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Canvas />
|
||||
|
||||
Reference in new issue
Block a user