mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Sidebar - Made sidebar resizable (to an extend)
Sidebar - Truncate long profile names Profile editor - Added shift+click on eye-icon in profile tree to focus an element Profile editor - Fixed layer property prefix/affix vertical alignment UI - Made shutdown via tray more responsive UI - Fixed several memory leaks
This commit is contained in:
parent
bab566a2b9
commit
6087a45a18
@ -202,13 +202,13 @@ namespace Artemis.Core
|
|||||||
foreach (BaseLayerEffect baseLayerEffect in LayerEffects.Where(e => !e.Suspended))
|
foreach (BaseLayerEffect baseLayerEffect in LayerEffects.Where(e => !e.Suspended))
|
||||||
baseLayerEffect.PreProcess(canvas, rendererBounds, layerPaint);
|
baseLayerEffect.PreProcess(canvas, rendererBounds, layerPaint);
|
||||||
|
|
||||||
canvas.SaveLayer(layerPaint);
|
|
||||||
canvas.Translate(Bounds.Left - basePosition.X, Bounds.Top - basePosition.Y);
|
|
||||||
|
|
||||||
// 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;
|
||||||
|
|
||||||
|
canvas.SaveLayer(layerPaint);
|
||||||
|
canvas.Translate(Bounds.Left - basePosition.X, Bounds.Top - basePosition.Y);
|
||||||
|
|
||||||
// Iterate the children in reverse because the first layer must be rendered last to end up on top
|
// Iterate the children in reverse because the first layer must be rendered last to end up on top
|
||||||
for (int index = Children.Count - 1; index > -1; index--)
|
for (int index = Children.Count - 1; index > -1; index--)
|
||||||
Children[index].Render(canvas, new SKPointI(Bounds.Left, Bounds.Top));
|
Children[index].Render(canvas, new SKPointI(Bounds.Left, Bounds.Top));
|
||||||
|
|||||||
@ -172,6 +172,9 @@ namespace Artemis.Core
|
|||||||
|
|
||||||
Disposed = true;
|
Disposed = true;
|
||||||
|
|
||||||
|
LayerBrushStore.LayerBrushAdded -= LayerBrushStoreOnLayerBrushAdded;
|
||||||
|
LayerBrushStore.LayerBrushRemoved -= LayerBrushStoreOnLayerBrushRemoved;
|
||||||
|
|
||||||
// Brush first in case it depends on any of the other disposables during it's own disposal
|
// Brush first in case it depends on any of the other disposables during it's own disposal
|
||||||
_layerBrush?.Dispose();
|
_layerBrush?.Dispose();
|
||||||
_general.Dispose();
|
_general.Dispose();
|
||||||
@ -355,8 +358,6 @@ namespace Artemis.Core
|
|||||||
if (Enabled)
|
if (Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Debug.WriteLine($"Enabling {this}");
|
|
||||||
|
|
||||||
LayerBrush?.InternalEnable();
|
LayerBrush?.InternalEnable();
|
||||||
foreach (BaseLayerEffect baseLayerEffect in LayerEffects)
|
foreach (BaseLayerEffect baseLayerEffect in LayerEffects)
|
||||||
baseLayerEffect.InternalEnable();
|
baseLayerEffect.InternalEnable();
|
||||||
@ -370,8 +371,6 @@ namespace Artemis.Core
|
|||||||
if (!Enabled)
|
if (!Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Debug.WriteLine($"Disabling {this}");
|
|
||||||
|
|
||||||
LayerBrush?.InternalDisable();
|
LayerBrush?.InternalDisable();
|
||||||
foreach (BaseLayerEffect baseLayerEffect in LayerEffects)
|
foreach (BaseLayerEffect baseLayerEffect in LayerEffects)
|
||||||
baseLayerEffect.InternalDisable();
|
baseLayerEffect.InternalDisable();
|
||||||
|
|||||||
@ -53,7 +53,6 @@ namespace Artemis.UI.Shared
|
|||||||
|
|
||||||
// Run an update timer at 25 fps
|
// Run an update timer at 25 fps
|
||||||
_timer = new Timer(40);
|
_timer = new Timer(40);
|
||||||
_timer.Elapsed += TimerOnTick;
|
|
||||||
|
|
||||||
MouseLeftButtonUp += OnMouseLeftButtonUp;
|
MouseLeftButtonUp += OnMouseLeftButtonUp;
|
||||||
Loaded += OnLoaded;
|
Loaded += OnLoaded;
|
||||||
@ -158,7 +157,8 @@ namespace Artemis.UI.Shared
|
|||||||
/// </param>
|
/// </param>
|
||||||
protected virtual void Dispose(bool disposing)
|
protected virtual void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing) _timer.Stop();
|
if (disposing)
|
||||||
|
_timer.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -191,6 +191,7 @@ namespace Artemis.UI.Shared
|
|||||||
private void OnUnloaded(object? sender, RoutedEventArgs e)
|
private void OnUnloaded(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_timer.Stop();
|
_timer.Stop();
|
||||||
|
_timer.Elapsed -= TimerOnTick;
|
||||||
|
|
||||||
if (_oldDevice != null)
|
if (_oldDevice != null)
|
||||||
{
|
{
|
||||||
@ -222,6 +223,7 @@ namespace Artemis.UI.Shared
|
|||||||
private void OnLoaded(object? sender, RoutedEventArgs e)
|
private void OnLoaded(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_timer.Start();
|
_timer.Start();
|
||||||
|
_timer.Elapsed += TimerOnTick;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TimerOnTick(object? sender, EventArgs e)
|
private void TimerOnTick(object? sender, EventArgs e)
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<shared:StreamToBitmapImageConverter x:Key="StreamToBitmapImageConverter" />
|
<shared:StreamToBitmapImageConverter x:Key="StreamToBitmapImageConverter" />
|
||||||
|
<shared:StreamToSvgImageConverter x:Key="StreamToSvgImageConverter" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<ContentControl.Style>
|
<ContentControl.Style>
|
||||||
@ -47,10 +48,11 @@
|
|||||||
<Setter Property="ContentTemplate">
|
<Setter Property="ContentTemplate">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<svgc:SvgViewbox StreamSource="{Binding ConfigurationIcon.FileIcon, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
<Image
|
||||||
RenderOptions.BitmapScalingMode="HighQuality"
|
Source="{Binding ConfigurationIcon.FileIcon, Converter={StaticResource StreamToSvgImageConverter}, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||||
Width="Auto"
|
RenderOptions.BitmapScalingMode="HighQuality"
|
||||||
Height="Auto" />
|
Width="Auto"
|
||||||
|
Height="Auto" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|||||||
@ -8,7 +8,7 @@ namespace Artemis.UI.Shared
|
|||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts <see cref="T:Stream" /> into <see cref="T:BitmapImage" />.
|
/// Converts bitmap file in the form of a <see cref="T:Stream" /> into <see cref="T:BitmapImage" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ValueConversion(typeof(Stream), typeof(BitmapImage))]
|
[ValueConversion(typeof(Stream), typeof(BitmapImage))]
|
||||||
public class StreamToBitmapImageConverter : IValueConverter
|
public class StreamToBitmapImageConverter : IValueConverter
|
||||||
@ -16,7 +16,7 @@ namespace Artemis.UI.Shared
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is not Stream stream)
|
if (value is not Stream stream)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
stream.Position = 0;
|
stream.Position = 0;
|
||||||
|
|||||||
@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using SharpVectors.Converters;
|
||||||
|
using SharpVectors.Renderers.Wpf;
|
||||||
|
|
||||||
|
namespace Artemis.UI.Shared
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <summary>
|
||||||
|
/// Converts SVG file in the form of a <see cref="T:Stream" /> into <see cref="T:BitmapImage" />.
|
||||||
|
/// </summary>
|
||||||
|
[ValueConversion(typeof(Stream), typeof(BitmapImage))]
|
||||||
|
public class StreamToSvgImageConverter : IValueConverter
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (value is not Stream stream)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
stream.Position = 0;
|
||||||
|
|
||||||
|
StreamSvgConverter converter = new(new WpfDrawingSettings());
|
||||||
|
using MemoryStream imageStream = new();
|
||||||
|
converter.Convert(stream, imageStream);
|
||||||
|
|
||||||
|
BitmapImage selectedBitmap = new();
|
||||||
|
selectedBitmap.BeginInit();
|
||||||
|
selectedBitmap.StreamSource = imageStream;
|
||||||
|
selectedBitmap.CacheOption = BitmapCacheOption.OnLoad;
|
||||||
|
selectedBitmap.EndInit();
|
||||||
|
selectedBitmap.Freeze();
|
||||||
|
|
||||||
|
stream.Position = 0;
|
||||||
|
return selectedBitmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return Binding.DoNothing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
src/Artemis.UI/Converters/ValuesAdditionConverter.cs
Normal file
20
src/Artemis.UI/Converters/ValuesAdditionConverter.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Artemis.UI.Converters
|
||||||
|
{
|
||||||
|
public class ValuesAdditionConverter : IMultiValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return values.Where(v => v is double).Cast<double>().Sum();
|
||||||
|
}
|
||||||
|
|
||||||
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<ComboBox Width="132"
|
<ComboBox Width="132"
|
||||||
Margin="0 2"
|
Margin="0 2"
|
||||||
Padding="0 -1"
|
Padding="0 -1"
|
||||||
@ -22,6 +22,6 @@
|
|||||||
<ComboBoxItem Content="True" IsSelected="{Binding InputValue}" />
|
<ComboBoxItem Content="True" IsSelected="{Binding InputValue}" />
|
||||||
<ComboBoxItem Content="False" IsSelected="{Binding InputValue, Converter={StaticResource InverseBooleanConverter}}" />
|
<ComboBoxItem Content="False" IsSelected="{Binding InputValue, Converter={StaticResource InverseBooleanConverter}}" />
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<ComboBox Width="132"
|
<ComboBox Width="132"
|
||||||
Margin="0 2"
|
Margin="0 2"
|
||||||
Padding="0 -1"
|
Padding="0 -1"
|
||||||
@ -31,6 +31,6 @@
|
|||||||
ItemTemplateSelector="{dataTemplateSelectors:ComboBoxTemplateSelector
|
ItemTemplateSelector="{dataTemplateSelectors:ComboBoxTemplateSelector
|
||||||
SelectedItemTemplate={StaticResource SimpleLayerBrushDescriptorTemplate},
|
SelectedItemTemplate={StaticResource SimpleLayerBrushDescriptorTemplate},
|
||||||
DropdownItemsTemplate={StaticResource ExtendedLayerBrushDescriptorTemplate}}" />
|
DropdownItemsTemplate={StaticResource ExtendedLayerBrushDescriptorTemplate}}" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -10,14 +10,14 @@
|
|||||||
d:DesignHeight="25" d:DesignWidth="800"
|
d:DesignHeight="25" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance propertyInput:ColorGradientPropertyInputViewModel}">
|
d:DataContext="{d:DesignInstance propertyInput:ColorGradientPropertyInputViewModel}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<shared:GradientPicker Width="132"
|
<shared:GradientPicker Width="132"
|
||||||
Margin="0 2"
|
Margin="0 2"
|
||||||
Padding="0 -1"
|
Padding="0 -1"
|
||||||
ColorGradient="{Binding InputValue}"
|
ColorGradient="{Binding InputValue}"
|
||||||
DialogClosed="{s:Action DialogClosed}"
|
DialogClosed="{s:Action DialogClosed}"
|
||||||
DialogHost="PropertyTreeDialogHost"
|
DialogHost="PropertyTreeDialogHost"
|
||||||
ToolTip="Click to edit gradient colors"/>
|
ToolTip="Click to edit gradient colors" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -7,7 +7,7 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<ComboBox Width="132"
|
<ComboBox Width="132"
|
||||||
Margin="0 2"
|
Margin="0 2"
|
||||||
Padding="0 -1"
|
Padding="0 -1"
|
||||||
@ -19,6 +19,6 @@
|
|||||||
SelectedValuePath="Value"
|
SelectedValuePath="Value"
|
||||||
DisplayMemberPath="Description"
|
DisplayMemberPath="Description"
|
||||||
SelectedValue="{Binding Path=InputValue}" />
|
SelectedValue="{Binding Path=InputValue}" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance propertyInput:FloatPropertyInputViewModel}">
|
d:DataContext="{d:DesignInstance propertyInput:FloatPropertyInputViewModel}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<shared:DraggableFloat Value="{Binding InputValue}"
|
<shared:DraggableFloat Value="{Binding InputValue}"
|
||||||
materialDesign:ValidationAssist.UsePopup="True"
|
materialDesign:ValidationAssist.UsePopup="True"
|
||||||
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||||
@ -19,7 +19,7 @@
|
|||||||
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsEnabled}"/>
|
IsEnabled="{Binding IsEnabled}" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -5,11 +5,12 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
|
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance local:FloatRangePropertyInputViewModel}">
|
d:DataContext="{d:DesignInstance propertyInput:FloatRangePropertyInputViewModel}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<shared:DraggableFloat ToolTip="Start"
|
<shared:DraggableFloat ToolTip="Start"
|
||||||
Value="{Binding Start}"
|
Value="{Binding Start}"
|
||||||
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||||
@ -17,7 +18,7 @@
|
|||||||
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsStartEnabled}"/>
|
IsEnabled="{Binding IsStartEnabled}" />
|
||||||
<TextBlock Margin="5 0" VerticalAlignment="Bottom">-</TextBlock>
|
<TextBlock Margin="5 0" VerticalAlignment="Bottom">-</TextBlock>
|
||||||
<shared:DraggableFloat ToolTip="End"
|
<shared:DraggableFloat ToolTip="End"
|
||||||
Value="{Binding End}"
|
Value="{Binding End}"
|
||||||
@ -26,7 +27,7 @@
|
|||||||
Min="{Binding Start}"
|
Min="{Binding Start}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsEndEnabled}"/>
|
IsEnabled="{Binding IsEndEnabled}" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -6,11 +6,12 @@
|
|||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance propertyInput:IntPropertyInputViewModel}">
|
d:DataContext="{d:DesignInstance propertyInput:IntPropertyInputViewModel}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<shared:DraggableFloat Value="{Binding InputValue}"
|
<shared:DraggableFloat Value="{Binding InputValue}"
|
||||||
materialDesign:ValidationAssist.UsePopup="True"
|
materialDesign:ValidationAssist.UsePopup="True"
|
||||||
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||||
@ -18,7 +19,7 @@
|
|||||||
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsEnabled}"/>
|
IsEnabled="{Binding IsEnabled}" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -5,11 +5,12 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
|
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance local:IntRangePropertyInputViewModel}">
|
d:DataContext="{d:DesignInstance propertyInput:IntRangePropertyInputViewModel}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<shared:DraggableFloat ToolTip="Start"
|
<shared:DraggableFloat ToolTip="Start"
|
||||||
Value="{Binding Start}"
|
Value="{Binding Start}"
|
||||||
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||||
@ -17,7 +18,7 @@
|
|||||||
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsStartEnabled}"/>
|
IsEnabled="{Binding IsStartEnabled}" />
|
||||||
<TextBlock Margin="5 0" VerticalAlignment="Bottom">-</TextBlock>
|
<TextBlock Margin="5 0" VerticalAlignment="Bottom">-</TextBlock>
|
||||||
<shared:DraggableFloat ToolTip="End"
|
<shared:DraggableFloat ToolTip="End"
|
||||||
Value="{Binding End}"
|
Value="{Binding End}"
|
||||||
@ -26,7 +27,7 @@
|
|||||||
Min="{Binding Start}"
|
Min="{Binding Start}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsEndEnabled}"/>
|
IsEnabled="{Binding IsEndEnabled}" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -5,6 +5,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:artemis="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:artemis="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
|
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="25" d:DesignWidth="800"
|
d:DesignHeight="25" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance propertyInput:SKColorPropertyInputViewModel}">
|
d:DataContext="{d:DesignInstance propertyInput:SKColorPropertyInputViewModel}">
|
||||||
@ -12,7 +13,7 @@
|
|||||||
<artemis:SKColorToColorConverter x:Key="SKColorToColorConverter" />
|
<artemis:SKColorToColorConverter x:Key="SKColorToColorConverter" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<artemis:ColorPicker Width="132"
|
<artemis:ColorPicker Width="132"
|
||||||
Margin="0 -2 0 3"
|
Margin="0 -2 0 3"
|
||||||
Padding="0 -1"
|
Padding="0 -1"
|
||||||
@ -20,6 +21,6 @@
|
|||||||
IsEnabled="{Binding IsEnabled}"
|
IsEnabled="{Binding IsEnabled}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"/>
|
DragEnded="{s:Action InputDragEnded}"/>
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -5,11 +5,12 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
|
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="25" d:DesignWidth="800"
|
d:DesignHeight="25" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance propertyInput:SKPointPropertyInputViewModel}">
|
d:DataContext="{d:DesignInstance propertyInput:SKPointPropertyInputViewModel}">
|
||||||
<StackPanel Orientation="Horizontal" KeyboardNavigation.IsTabStop="True">
|
<StackPanel Orientation="Horizontal" KeyboardNavigation.IsTabStop="True">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<shared:DraggableFloat ToolTip="X-coordinate (horizontal)"
|
<shared:DraggableFloat ToolTip="X-coordinate (horizontal)"
|
||||||
Value="{Binding X}"
|
Value="{Binding X}"
|
||||||
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||||
@ -17,7 +18,7 @@
|
|||||||
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsXEnabled}"/>
|
IsEnabled="{Binding IsXEnabled}" />
|
||||||
<TextBlock Margin="5 0" VerticalAlignment="Bottom">,</TextBlock>
|
<TextBlock Margin="5 0" VerticalAlignment="Bottom">,</TextBlock>
|
||||||
<shared:DraggableFloat ToolTip="Y-coordinate (vertical)"
|
<shared:DraggableFloat ToolTip="Y-coordinate (vertical)"
|
||||||
Value="{Binding Y}"
|
Value="{Binding Y}"
|
||||||
@ -26,7 +27,7 @@
|
|||||||
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsYEnabled}"/>
|
IsEnabled="{Binding IsYEnabled}" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -5,11 +5,12 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
|
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance local:SKSizePropertyInputViewModel}">
|
d:DataContext="{d:DesignInstance propertyInput:SKSizePropertyInputViewModel}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||||
<shared:DraggableFloat ToolTip="Height"
|
<shared:DraggableFloat ToolTip="Height"
|
||||||
Value="{Binding Height}"
|
Value="{Binding Height}"
|
||||||
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
StepSize="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||||
@ -17,7 +18,7 @@
|
|||||||
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsHeightEnabled}"/>
|
IsEnabled="{Binding IsHeightEnabled}" />
|
||||||
<TextBlock Margin="5 0" VerticalAlignment="Bottom">,</TextBlock>
|
<TextBlock Margin="5 0" VerticalAlignment="Bottom">,</TextBlock>
|
||||||
<shared:DraggableFloat ToolTip="Width"
|
<shared:DraggableFloat ToolTip="Width"
|
||||||
Value="{Binding Width}"
|
Value="{Binding Width}"
|
||||||
@ -26,7 +27,7 @@
|
|||||||
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
Min="{Binding LayerProperty.PropertyDescription.MinInputValue}"
|
||||||
DragStarted="{s:Action InputDragStarted}"
|
DragStarted="{s:Action InputDragStarted}"
|
||||||
DragEnded="{s:Action InputDragEnded}"
|
DragEnded="{s:Action InputDragEnded}"
|
||||||
IsEnabled="{Binding IsWidthEnabled}"/>
|
IsEnabled="{Binding IsWidthEnabled}" />
|
||||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" />
|
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -1,19 +1,19 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:treeItem1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem"
|
xmlns:treeItem1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem"
|
||||||
xmlns:Converters="clr-namespace:Artemis.UI.Converters"
|
xmlns:Converters="clr-namespace:Artemis.UI.Converters"
|
||||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem.LayerView"
|
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem.LayerView"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance {x:Type treeItem1:LayerViewModel}}">
|
d:DataContext="{d:DesignInstance {x:Type treeItem1:LayerViewModel}}">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
|
<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<!-- Capture clicks on full tree view item -->
|
<!-- Capture clicks on full tree view item -->
|
||||||
<StackPanel Margin="-10" Background="Transparent" ContextMenuOpening="{s:Action ContextMenuOpening}">
|
<StackPanel Margin="-10" Background="Transparent" ContextMenuOpening="{s:Action ContextMenuOpening}">
|
||||||
@ -72,12 +72,17 @@
|
|||||||
<TextBlock Grid.Column="2" Text="{Binding Layer.Name}" VerticalAlignment="Center" Margin="5 0 0 0" />
|
<TextBlock Grid.Column="2" Text="{Binding Layer.Name}" VerticalAlignment="Center" Margin="5 0 0 0" />
|
||||||
<ToggleButton Grid.Column="3"
|
<ToggleButton Grid.Column="3"
|
||||||
Style="{StaticResource MaterialDesignFlatToggleButton}"
|
Style="{StaticResource MaterialDesignFlatToggleButton}"
|
||||||
ToolTip="Toggle suspended state"
|
|
||||||
Width="18"
|
Width="18"
|
||||||
Height="18"
|
Height="18"
|
||||||
IsChecked="{Binding ProfileElement.Suspended, Converter={StaticResource InverseBooleanConverter}}"
|
IsChecked="{Binding ProfileElement.Suspended, Converter={StaticResource InverseBooleanConverter}}"
|
||||||
Command="{s:Action SuspendedToggled}"
|
Command="{s:Action SuspendedToggled}"
|
||||||
VerticalAlignment="Center" Padding="-25">
|
VerticalAlignment="Center" Padding="-25">
|
||||||
|
<ToggleButton.ToolTip>
|
||||||
|
<TextBlock>
|
||||||
|
Toggle suspended state <LineBreak />
|
||||||
|
<Bold>Shift+click</Bold> to toggle focus
|
||||||
|
</TextBlock>
|
||||||
|
</ToggleButton.ToolTip>
|
||||||
<materialDesign:PackIcon Kind="Eye" Height="13" Width="13" />
|
<materialDesign:PackIcon Kind="Eye" Height="13" Width="13" />
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Input;
|
||||||
using Artemis.Core;
|
using Artemis.Core;
|
||||||
using Artemis.Core.LayerBrushes;
|
using Artemis.Core.LayerBrushes;
|
||||||
using Artemis.Core.Services;
|
using Artemis.Core.Services;
|
||||||
@ -18,9 +19,9 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
|
|||||||
{
|
{
|
||||||
private readonly IDialogService _dialogService;
|
private readonly IDialogService _dialogService;
|
||||||
private readonly ILayerBrushService _layerBrushService;
|
private readonly ILayerBrushService _layerBrushService;
|
||||||
private readonly IRgbService _rgbService;
|
|
||||||
private readonly IProfileEditorService _profileEditorService;
|
private readonly IProfileEditorService _profileEditorService;
|
||||||
private readonly IProfileTreeVmFactory _profileTreeVmFactory;
|
private readonly IProfileTreeVmFactory _profileTreeVmFactory;
|
||||||
|
private readonly IRgbService _rgbService;
|
||||||
private ProfileElement _profileElement;
|
private ProfileElement _profileElement;
|
||||||
|
|
||||||
protected TreeItemViewModel(ProfileElement profileElement,
|
protected TreeItemViewModel(ProfileElement profileElement,
|
||||||
@ -243,6 +244,39 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
|
|||||||
|
|
||||||
public void SuspendedToggled()
|
public void SuspendedToggled()
|
||||||
{
|
{
|
||||||
|
// If shift is held toggle focus state
|
||||||
|
if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
|
||||||
|
{
|
||||||
|
// Get all profile elements
|
||||||
|
List<ProfileElement> elements = ProfileElement.Profile.GetAllFolders().Cast<ProfileElement>().ToList();
|
||||||
|
elements.AddRange(ProfileElement.Profile.GetAllLayers().Cast<ProfileElement>().ToList());
|
||||||
|
|
||||||
|
// Separate out the targets of the focus state, the current profile element and all its parents
|
||||||
|
List<ProfileElement> targets = ProfileElement.GetAllFolders().Cast<ProfileElement>().ToList();
|
||||||
|
targets.AddRange(ProfileElement.GetAllLayers().Cast<ProfileElement>().ToList());
|
||||||
|
ProfileElement target = ProfileElement;
|
||||||
|
while (target != null)
|
||||||
|
{
|
||||||
|
targets.Add(target);
|
||||||
|
target = target.Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If any element is suspended, untoggle focus and unsuspend everything
|
||||||
|
if (elements.Except(targets).Any(e => e.Suspended))
|
||||||
|
{
|
||||||
|
foreach (ProfileElement profileElement in elements)
|
||||||
|
profileElement.Suspended = false;
|
||||||
|
}
|
||||||
|
// Otherwise suspend everything except the targets
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (ProfileElement profileElement in elements.Except(targets))
|
||||||
|
profileElement.Suspended = true;
|
||||||
|
foreach (ProfileElement profileElement in targets)
|
||||||
|
profileElement.Suspended = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_profileEditorService.SaveSelectedProfileConfiguration();
|
_profileEditorService.SaveSelectedProfileConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,58 +23,63 @@
|
|||||||
KeyUp="{s:Action WindowKeyUp}"
|
KeyUp="{s:Action WindowKeyUp}"
|
||||||
MouseDown="{s:Action WindowMouseDown}"
|
MouseDown="{s:Action WindowMouseDown}"
|
||||||
MouseUp="{s:Action WindowMouseUp}"
|
MouseUp="{s:Action WindowMouseUp}"
|
||||||
d:DesignHeight="640" d:DesignWidth="1200"
|
d:DesignHeight="640" d:DesignWidth="1200"
|
||||||
d:DataContext="{d:DesignInstance screens:RootViewModel}">
|
d:DataContext="{d:DesignInstance screens:RootViewModel}">
|
||||||
<materialDesign:DialogHost IsTabStop="False" Focusable="False" Identifier="RootDialog" DialogTheme="Inherit" SnackbarMessageQueue="{Binding MainMessageQueue}">
|
<materialDesign:DialogHost IsTabStop="False" Focusable="False" Identifier="RootDialog" DialogTheme="Inherit" SnackbarMessageQueue="{Binding MainMessageQueue}">
|
||||||
<DockPanel>
|
<Grid>
|
||||||
<Border DockPanel.Dock="Left" DockPanel.ZIndex="2" ClipToBounds="True" Background="{DynamicResource MaterialDesignToolBarBackground}">
|
<Grid.ColumnDefinitions>
|
||||||
<Grid>
|
<ColumnDefinition Width="{Binding SidebarWidth.Value, Mode=TwoWay}" MinWidth="175" MaxWidth="400" />
|
||||||
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition />
|
</Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<Border Grid.Column="0" ClipToBounds="True" Background="{DynamicResource MaterialDesignToolBarBackground}">
|
||||||
</Grid.ColumnDefinitions>
|
<ContentControl s:View.Model="{Binding SidebarViewModel}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False" />
|
||||||
<ContentControl Grid.Column="0" s:View.Model="{Binding SidebarViewModel}" Width="240" />
|
|
||||||
<Rectangle Grid.Column="1" Fill="DarkGray" Width="1" Margin="0 0 -1 0">
|
|
||||||
<Rectangle.Effect>
|
|
||||||
<DropShadowEffect ShadowDepth="0" BlurRadius="10" Color="{StaticResource MaterialDesignShadow}" />
|
|
||||||
</Rectangle.Effect>
|
|
||||||
</Rectangle>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<materialDesign:ColorZone Mode="PrimaryMid" DockPanel.Dock="Top" DockPanel.ZIndex="1" Height="42">
|
<GridSplitter Grid.Column="0" Width="8" Margin="0 0 -4 0" Background="Transparent" />
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Grid.Column="0"
|
|
||||||
Text="{Binding SidebarViewModel.SelectedScreen.DisplayName}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
FontSize="20"
|
|
||||||
Margin="15 0" />
|
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
||||||
<TextBlock Text="{Binding FrameTime}" VerticalAlignment="Center" FontSize="14" Margin="10 0" ToolTip="The time the last frame took to render" />
|
|
||||||
|
|
||||||
<!-- Bug: materialDesign:RippleAssist.RippleOnTop doesn't look as nice but otherwise it doesn't work at all, not sure why -->
|
<Grid Grid.Column="1">
|
||||||
<Button Style="{StaticResource MaterialDesignIconForegroundButton}"
|
<Grid.RowDefinitions>
|
||||||
VerticalAlignment="Center"
|
<RowDefinition Height="Auto" />
|
||||||
ToolTip="Open debugger"
|
<RowDefinition Height="*" />
|
||||||
Command="{s:Action ShowDebugger}"
|
</Grid.RowDefinitions>
|
||||||
materialDesign:RippleAssist.RippleOnTop="True">
|
<materialDesign:ColorZone Grid.Row="0" Mode="PrimaryMid" DockPanel.Dock="Top" DockPanel.ZIndex="1" Height="42">
|
||||||
<materialDesign:PackIcon Kind="Matrix" />
|
<Grid>
|
||||||
</Button>
|
<Grid.ColumnDefinitions>
|
||||||
</StackPanel>
|
<ColumnDefinition Width="*" />
|
||||||
</Grid>
|
<ColumnDefinition Width="Auto" />
|
||||||
</materialDesign:ColorZone>
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0"
|
||||||
|
Text="{Binding SidebarViewModel.SelectedScreen.DisplayName}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="20"
|
||||||
|
Margin="15 0" />
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding FrameTime}" VerticalAlignment="Center" FontSize="14" Margin="10 0" ToolTip="The time the last frame took to render" />
|
||||||
|
|
||||||
<Grid>
|
<!-- Bug: materialDesign:RippleAssist.RippleOnTop doesn't look as nice but otherwise it doesn't work at all, not sure why -->
|
||||||
<ContentControl s:View.Model="{Binding SidebarViewModel.SelectedScreen}" />
|
<Button Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||||
<materialDesign:Snackbar x:Name="MainSnackbar"
|
VerticalAlignment="Center"
|
||||||
|
ToolTip="Open debugger"
|
||||||
|
Command="{s:Action ShowDebugger}"
|
||||||
|
materialDesign:RippleAssist.RippleOnTop="True">
|
||||||
|
<materialDesign:PackIcon Kind="Matrix" />
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</materialDesign:ColorZone>
|
||||||
|
|
||||||
|
<ContentControl Grid.Row="1"
|
||||||
|
s:View.Model="{Binding SidebarViewModel.SelectedScreen}"
|
||||||
|
VerticalContentAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
IsTabStop="False" />
|
||||||
|
<materialDesign:Snackbar Grid.Row="0"
|
||||||
|
Grid.RowSpan="2"
|
||||||
|
x:Name="MainSnackbar"
|
||||||
MessageQueue="{Binding MainMessageQueue}"
|
MessageQueue="{Binding MainMessageQueue}"
|
||||||
materialDesign:SnackbarMessage.InlineActionButtonMaxHeight="80"
|
materialDesign:SnackbarMessage.InlineActionButtonMaxHeight="80"
|
||||||
materialDesign:SnackbarMessage.ContentMaxHeight="200" />
|
materialDesign:SnackbarMessage.ContentMaxHeight="200" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</DockPanel>
|
</Grid>
|
||||||
</materialDesign:DialogHost>
|
</materialDesign:DialogHost>
|
||||||
</mde:MaterialWindow>
|
</mde:MaterialWindow>
|
||||||
@ -61,6 +61,7 @@ namespace Artemis.UI.Screens
|
|||||||
_frameTimeUpdateTimer = new Timer(500);
|
_frameTimeUpdateTimer = new Timer(500);
|
||||||
_windowSize = _settingsService.GetSetting<WindowSize>("UI.RootWindowSize");
|
_windowSize = _settingsService.GetSetting<WindowSize>("UI.RootWindowSize");
|
||||||
|
|
||||||
|
SidebarWidth = _settingsService.GetSetting("UI.SidebarWidth", new GridLength(240, GridUnitType.Star));
|
||||||
SidebarViewModel = sidebarViewModel;
|
SidebarViewModel = sidebarViewModel;
|
||||||
SidebarViewModel.ConductWith(this);
|
SidebarViewModel.ConductWith(this);
|
||||||
|
|
||||||
@ -68,6 +69,7 @@ namespace Artemis.UI.Screens
|
|||||||
WindowTitle = $"Artemis {versionAttribute?.InformationalVersion} build {Constants.BuildInfo.BuildNumberDisplay}";
|
WindowTitle = $"Artemis {versionAttribute?.InformationalVersion} build {Constants.BuildInfo.BuildNumberDisplay}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PluginSetting<GridLength> SidebarWidth { get; }
|
||||||
public SidebarViewModel SidebarViewModel { get; }
|
public SidebarViewModel SidebarViewModel { get; }
|
||||||
|
|
||||||
public ISnackbarMessageQueue MainMessageQueue
|
public ISnackbarMessageQueue MainMessageQueue
|
||||||
@ -75,7 +77,7 @@ namespace Artemis.UI.Screens
|
|||||||
get => _mainMessageQueue;
|
get => _mainMessageQueue;
|
||||||
set => SetAndNotify(ref _mainMessageQueue, value);
|
set => SetAndNotify(ref _mainMessageQueue, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string WindowTitle
|
public string WindowTitle
|
||||||
{
|
{
|
||||||
get => _windowTitle;
|
get => _windowTitle;
|
||||||
@ -210,7 +212,7 @@ namespace Artemis.UI.Screens
|
|||||||
_frameTimeUpdateTimer.Stop();
|
_frameTimeUpdateTimer.Stop();
|
||||||
|
|
||||||
SidebarViewModel.SelectedScreenChanged -= SidebarViewModelOnSelectedScreenChanged;
|
SidebarViewModel.SelectedScreenChanged -= SidebarViewModelOnSelectedScreenChanged;
|
||||||
|
SidebarWidth.Save();
|
||||||
_windowSize.Value ??= new WindowSize();
|
_windowSize.Value ??= new WindowSize();
|
||||||
_windowSize.Value.ApplyFromWindow(_window);
|
_windowSize.Value.ApplyFromWindow(_window);
|
||||||
_windowSize.Save();
|
_windowSize.Save();
|
||||||
|
|||||||
@ -6,10 +6,8 @@
|
|||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
||||||
xmlns:dialogs="clr-namespace:Artemis.UI.Screens.Sidebar.Dialogs"
|
|
||||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
xmlns:profileEdit="clr-namespace:Artemis.UI.Screens.Sidebar.Dialogs.ProfileEdit"
|
xmlns:profileEdit="clr-namespace:Artemis.UI.Screens.Sidebar.Dialogs.ProfileEdit"
|
||||||
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
|
|
||||||
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
|
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="280"
|
d:DesignHeight="450" d:DesignWidth="280"
|
||||||
@ -17,9 +15,10 @@
|
|||||||
Width="800">
|
Width="800">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||||
<shared:StreamToBitmapImageConverter x:Key="StreamToBitmapImageConverter"/>
|
|
||||||
<shared:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
|
|
||||||
<shared:BindingProxy x:Key="DataContextProxy" Data="{Binding}" />
|
<shared:BindingProxy x:Key="DataContextProxy" Data="{Binding}" />
|
||||||
|
<shared:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
|
||||||
|
<shared:StreamToBitmapImageConverter x:Key="StreamToBitmapImageConverter" />
|
||||||
|
<shared:StreamToSvgImageConverter x:Key="StreamToSvgImageConverter" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid Margin="16">
|
<Grid Margin="16">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@ -112,9 +111,9 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<materialDesign:PackIcon Grid.Column="0"
|
<materialDesign:PackIcon Grid.Column="0"
|
||||||
Kind="{Binding DataContext.SelectedIcon.Icon, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Mode=OneWay}"
|
Kind="{Binding DataContext.SelectedIcon.Icon, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Mode=OneWay}"
|
||||||
Width="45"
|
Width="45"
|
||||||
Height="45"
|
Height="45"
|
||||||
Margin="0 0 10 0"
|
Margin="0 0 10 0"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
@ -154,14 +153,14 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Grid.Column="0"
|
<Image Grid.Column="0"
|
||||||
Source="{Binding DataContext.SelectedImage, Converter={StaticResource StreamToBitmapImageConverter}, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
Source="{Binding DataContext.SelectedImage, Converter={StaticResource StreamToBitmapImageConverter}, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||||
RenderOptions.BitmapScalingMode="HighQuality"
|
|
||||||
Margin="0 0 10 0"
|
Margin="0 0 10 0"
|
||||||
Width="45"
|
Width="45"
|
||||||
Height="45"
|
Height="45"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center"
|
||||||
<Button Grid.Column="1"
|
RenderOptions.BitmapScalingMode="HighQuality" />
|
||||||
|
<Button Grid.Column="1"
|
||||||
Command="{s:Action SelectBitmapFile}"
|
Command="{s:Action SelectBitmapFile}"
|
||||||
Style="{StaticResource MaterialDesignRaisedButton}"
|
Style="{StaticResource MaterialDesignRaisedButton}"
|
||||||
ToolTip="Select an image">
|
ToolTip="Select an image">
|
||||||
@ -185,13 +184,14 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<svgc:SvgViewbox Grid.Column="0"
|
<Image Grid.Column="0"
|
||||||
StreamSource="{Binding DataContext.SelectedImage, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
Source="{Binding DataContext.SelectedImage, Converter={StaticResource StreamToSvgImageConverter}, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||||
Margin="0 0 10 0"
|
Margin="0 0 10 0"
|
||||||
Width="45"
|
Width="45"
|
||||||
Height="45"
|
Height="45"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center"
|
||||||
<Button Grid.Column="1"
|
RenderOptions.BitmapScalingMode="HighQuality" />
|
||||||
|
<Button Grid.Column="1"
|
||||||
Command="{s:Action SelectSvgFile}"
|
Command="{s:Action SelectSvgFile}"
|
||||||
Style="{StaticResource MaterialDesignRaisedButton}"
|
Style="{StaticResource MaterialDesignRaisedButton}"
|
||||||
ToolTip="Select an image">
|
ToolTip="Select an image">
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
Padding="8">
|
Padding="8">
|
||||||
<!-- Above is a dumb hack to get the context menu to cover the entire item -->
|
<!-- Above is a dumb hack to get the context menu to cover the entire item -->
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<shared:StreamToBitmapImageConverter x:Key="StreamToBitmapImageConverter" />
|
<converters:ValuesAdditionConverter x:Key="ValuesAddition" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<UserControl.ContextMenu>
|
<UserControl.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
@ -52,17 +52,17 @@
|
|||||||
<materialDesign:PackIcon Kind="Export" />
|
<materialDesign:PackIcon Kind="Export" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Duplicate" Command="{s:Action Duplicate}" >
|
<MenuItem Header="Duplicate" Command="{s:Action Duplicate}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<materialDesign:PackIcon Kind="ContentDuplicate" />
|
<materialDesign:PackIcon Kind="ContentDuplicate" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Copy" Command="{s:Action Copy}" >
|
<MenuItem Header="Copy" Command="{s:Action Copy}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<materialDesign:PackIcon Kind="ContentCopy" />
|
<materialDesign:PackIcon Kind="ContentCopy" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Paste" Command="{s:Action Paste}" >
|
<MenuItem Header="Paste" Command="{s:Action Paste}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<materialDesign:PackIcon Kind="ContentPaste" />
|
<materialDesign:PackIcon Kind="ContentPaste" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
@ -77,12 +77,17 @@
|
|||||||
</UserControl.ContextMenu>
|
</UserControl.ContextMenu>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<shared:ProfileConfigurationIcon Grid.Column="0" VerticalAlignment="Center" ConfigurationIcon="{Binding ProfileConfiguration.Icon}" Width="20" Height="20">
|
<shared:ProfileConfigurationIcon Grid.Column="0"
|
||||||
|
x:Name="ProfileIcon"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
ConfigurationIcon="{Binding ProfileConfiguration.Icon}"
|
||||||
|
Width="20"
|
||||||
|
Height="20">
|
||||||
<shared:ProfileConfigurationIcon.Style>
|
<shared:ProfileConfigurationIcon.Style>
|
||||||
<Style>
|
<Style>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
@ -107,15 +112,22 @@
|
|||||||
</shared:ProfileConfigurationIcon.Style>
|
</shared:ProfileConfigurationIcon.Style>
|
||||||
</shared:ProfileConfigurationIcon>
|
</shared:ProfileConfigurationIcon>
|
||||||
|
|
||||||
<TextBlock Grid.Column="1" FontSize="12" Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding ProfileConfiguration.Name}">
|
<TextBlock Grid.Column="1"
|
||||||
|
x:Name="ProfileName"
|
||||||
|
FontSize="12"
|
||||||
|
Margin="10 0 0 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Text="{Binding ProfileConfiguration.Name}"
|
||||||
|
TextTrimming="CharacterEllipsis">
|
||||||
<TextBlock.Style>
|
<TextBlock.Style>
|
||||||
<Style>
|
<Style TargetType="TextBlock">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding IsProfileActive}" Value="False">
|
<DataTrigger Binding="{Binding IsProfileActive}" Value="False">
|
||||||
<DataTrigger.EnterActions>
|
<DataTrigger.EnterActions>
|
||||||
<BeginStoryboard>
|
<BeginStoryboard>
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.33" Duration="0:0:0.25" />
|
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.33" />
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</BeginStoryboard>
|
</BeginStoryboard>
|
||||||
</DataTrigger.EnterActions>
|
</DataTrigger.EnterActions>
|
||||||
@ -132,7 +144,21 @@
|
|||||||
</TextBlock.Style>
|
</TextBlock.Style>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<Border Grid.Column="0" Grid.ColumnSpan="2" BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignBody}" Height="1" Opacity="0">
|
<Border Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
BorderThickness="1"
|
||||||
|
BorderBrush="{DynamicResource MaterialDesignBody}"
|
||||||
|
Height="1"
|
||||||
|
Opacity="0"
|
||||||
|
HorizontalAlignment="Left">
|
||||||
|
<!-- Ensure the line covers the profile and the text but not the full two columns -->
|
||||||
|
<Border.Width>
|
||||||
|
<MultiBinding Converter="{StaticResource ValuesAddition}">
|
||||||
|
<Binding Path="ActualWidth" ElementName="ProfileIcon" />
|
||||||
|
<Binding Path="ActualWidth" ElementName="ProfileName" />
|
||||||
|
<Binding Path="Margin.Left" ElementName="ProfileName" />
|
||||||
|
</MultiBinding>
|
||||||
|
</Border.Width>
|
||||||
<Border.Style>
|
<Border.Style>
|
||||||
<Style>
|
<Style>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
@ -160,7 +186,7 @@
|
|||||||
<Button Grid.Column="2" ToolTip="View properties" Width="20" Height="20" Command="{s:Action ViewProperties}" HorizontalAlignment="Right">
|
<Button Grid.Column="2" ToolTip="View properties" Width="20" Height="20" Command="{s:Action ViewProperties}" HorizontalAlignment="Right">
|
||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignIconForegroundButton}">
|
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignIconForegroundButton}">
|
||||||
<Setter Property="Visibility" Value="Hidden" />
|
<Setter Property="Visibility" Value="Collapsed" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}, Mode=FindAncestor}}" Value="True">
|
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}, Mode=FindAncestor}}" Value="True">
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
@ -173,7 +199,7 @@
|
|||||||
<ToggleButton Grid.Column="3" ToolTip="Suspend profile" Width="18" Height="18" Margin="2 0 0 0" IsChecked="{Binding IsSuspended}">
|
<ToggleButton Grid.Column="3" ToolTip="Suspend profile" Width="18" Height="18" Margin="2 0 0 0" IsChecked="{Binding IsSuspended}">
|
||||||
<ToggleButton.Style>
|
<ToggleButton.Style>
|
||||||
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MaterialDesignFlatToggleButton}">
|
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MaterialDesignFlatToggleButton}">
|
||||||
<Setter Property="Visibility" Value="Hidden" />
|
<Setter Property="Visibility" Value="Collapsed" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}, Mode=FindAncestor}}" Value="True">
|
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}, Mode=FindAncestor}}" Value="True">
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
@ -183,6 +209,5 @@
|
|||||||
</ToggleButton.Style>
|
</ToggleButton.Style>
|
||||||
<materialDesign:PackIcon Kind="Pause" Height="14" Width="14" />
|
<materialDesign:PackIcon Kind="Pause" Height="14" Width="14" />
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
<!-- Bottom buttons -->
|
<!-- Bottom buttons -->
|
||||||
<Separator Grid.Row="4" Margin="8" />
|
<Separator Grid.Row="4" Margin="8" />
|
||||||
<StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Center" Margin="5 0 5 5">
|
<WrapPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Left" Margin="5 0 5 5">
|
||||||
<Button Style="{StaticResource MaterialDesignIconForegroundButton}"
|
<Button Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||||
Width="44"
|
Width="44"
|
||||||
Height="44"
|
Height="44"
|
||||||
@ -160,7 +160,7 @@
|
|||||||
CommandParameter="https://wiki.artemis-rgb.com/en/donating">
|
CommandParameter="https://wiki.artemis-rgb.com/en/donating">
|
||||||
<materialDesign:PackIcon Kind="Gift" Width="20" Height="20" />
|
<materialDesign:PackIcon Kind="Gift" Width="20" Height="20" />
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</WrapPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</materialDesign:DialogHost>
|
</materialDesign:DialogHost>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
@ -129,8 +130,10 @@ namespace Artemis.UI.Screens
|
|||||||
_eventAggregator.Publish(new RequestSelectSidebarItemEvent(sidebarItem));
|
_eventAggregator.Publish(new RequestSelectSidebarItemEvent(sidebarItem));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TrayExit()
|
public async Task TrayExit()
|
||||||
{
|
{
|
||||||
|
// Don't freeze the UI right after clicking
|
||||||
|
await Task.Delay(200);
|
||||||
Core.Utilities.Shutdown();
|
Core.Utilities.Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user