mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-31 01:42:02 +00:00
Disable delete button on active surface
Resize real-time now that UI FPS is fixed
This commit is contained in:
parent
25f8f1e72f
commit
ff959b6f9c
@ -147,6 +147,7 @@
|
|||||||
<Compile Include="Adorners\BoundingBoxAdorner.cs" />
|
<Compile Include="Adorners\BoundingBoxAdorner.cs" />
|
||||||
<Compile Include="Bootstrapper.cs" />
|
<Compile Include="Bootstrapper.cs" />
|
||||||
<Compile Include="Converters\ColorToSolidColorBrushConverter.cs" />
|
<Compile Include="Converters\ColorToSolidColorBrushConverter.cs" />
|
||||||
|
<Compile Include="Converters\InverseBooleanConverter.cs" />
|
||||||
<Compile Include="Converters\NullToImageConverter.cs" />
|
<Compile Include="Converters\NullToImageConverter.cs" />
|
||||||
<Compile Include="Converters\NullToVisibilityConverter.cs" />
|
<Compile Include="Converters\NullToVisibilityConverter.cs" />
|
||||||
<Compile Include="Extensions\RgbColorExtensions.cs" />
|
<Compile Include="Extensions\RgbColorExtensions.cs" />
|
||||||
|
|||||||
29
src/Artemis.UI/Converters/InverseBooleanConverter.cs
Normal file
29
src/Artemis.UI/Converters/InverseBooleanConverter.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Artemis.UI.Converters
|
||||||
|
{
|
||||||
|
[ValueConversion(typeof(bool), typeof(bool))]
|
||||||
|
public class InverseBooleanConverter : IValueConverter
|
||||||
|
{
|
||||||
|
#region IValueConverter Members
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter,
|
||||||
|
CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (targetType != typeof(bool))
|
||||||
|
throw new InvalidOperationException("The target must be a boolean");
|
||||||
|
|
||||||
|
return !(bool) value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter,
|
||||||
|
CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -81,7 +81,7 @@
|
|||||||
<ContentControl s:View.Model="{Binding ProfileViewModel}" />
|
<ContentControl s:View.Model="{Binding ProfileViewModel}" />
|
||||||
</materialDesign:Card>
|
</materialDesign:Card>
|
||||||
|
|
||||||
<GridSplitter Grid.Row="1" Grid.Column="1" Width="5" HorizontalAlignment="Stretch" ShowsPreview="True" Cursor="SizeWE" Margin="5 0" />
|
<GridSplitter Grid.Row="1" Grid.Column="1" Width="5" HorizontalAlignment="Stretch" Cursor="SizeWE" Margin="5 0" />
|
||||||
|
|
||||||
<!-- Right panels -->
|
<!-- Right panels -->
|
||||||
<Grid Grid.Row="1" Grid.Column="2">
|
<Grid Grid.Row="1" Grid.Column="2">
|
||||||
@ -95,14 +95,14 @@
|
|||||||
<ContentControl s:View.Model="{Binding LayersViewModel}" />
|
<ContentControl s:View.Model="{Binding LayersViewModel}" />
|
||||||
</materialDesign:Card>
|
</materialDesign:Card>
|
||||||
|
|
||||||
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" ShowsPreview="True" Cursor="SizeNS" Margin="0 5" />
|
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" Cursor="SizeNS" Margin="0 5" />
|
||||||
|
|
||||||
<materialDesign:Card Grid.Row="2" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch">
|
<materialDesign:Card Grid.Row="2" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch">
|
||||||
<ContentControl s:View.Model="{Binding DisplayConditionsViewModel}" />
|
<ContentControl s:View.Model="{Binding DisplayConditionsViewModel}" />
|
||||||
</materialDesign:Card>
|
</materialDesign:Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<GridSplitter Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Height="5" HorizontalAlignment="Stretch" ShowsPreview="True" Cursor="SizeNS" Margin="0 5" />
|
<GridSplitter Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Height="5" HorizontalAlignment="Stretch" Cursor="SizeNS" Margin="0 5" />
|
||||||
|
|
||||||
<!-- Bottom panels -->
|
<!-- Bottom panels -->
|
||||||
<Grid Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3">
|
<Grid Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3">
|
||||||
@ -115,7 +115,7 @@
|
|||||||
<ContentControl s:View.Model="{Binding LayerElementsViewModel}" />
|
<ContentControl s:View.Model="{Binding LayerElementsViewModel}" />
|
||||||
</materialDesign:Card>
|
</materialDesign:Card>
|
||||||
|
|
||||||
<GridSplitter Grid.Column="1" Width="5" Margin="5 0" HorizontalAlignment="Stretch" ShowsPreview="True" Cursor="SizeWE" />
|
<GridSplitter Grid.Column="1" Width="5" Margin="5 0" HorizontalAlignment="Stretch" Cursor="SizeWE" />
|
||||||
|
|
||||||
<materialDesign:Card Grid.Column="2" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch">
|
<materialDesign:Card Grid.Column="2" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch">
|
||||||
<ContentControl s:View.Model="{Binding ElementPropertiesViewModel}" />
|
<ContentControl s:View.Model="{Binding ElementPropertiesViewModel}" />
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
<DataTrigger.ExitActions>
|
<DataTrigger.ExitActions>
|
||||||
<BeginStoryboard>
|
<BeginStoryboard>
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0" />
|
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0.4" />
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</BeginStoryboard>
|
</BeginStoryboard>
|
||||||
</DataTrigger.ExitActions>
|
</DataTrigger.ExitActions>
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
<UserControl x:Class="Artemis.UI.Screens.SurfaceEditor.SurfaceEditorView"
|
<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:models="clr-namespace:Artemis.Core.Models.Surface;assembly=Artemis.Core"
|
xmlns:models="clr-namespace:Artemis.Core.Models.Surface;assembly=Artemis.Core"
|
||||||
mc:Ignorable="d"
|
xmlns:Converters="clr-namespace:Artemis.UI.Converters" x:Class="Artemis.UI.Screens.SurfaceEditor.SurfaceEditorView"
|
||||||
d:DesignHeight="600" d:DesignWidth="600">
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="600" d:DesignWidth="600">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@ -16,6 +17,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
|
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid Margin="16">
|
<Grid Margin="16">
|
||||||
@ -32,13 +34,16 @@
|
|||||||
|
|
||||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
|
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
|
||||||
<TextBlock>
|
<TextBlock>
|
||||||
<materialDesign:PackIcon Kind="AboutOutline" Margin="0 0 0 -3" /> The surface is a digital representation of your LED setup. Set this up accurately and effects will seamlessly move from one device to the other.
|
<InlineUIContainer>
|
||||||
|
<materialDesign:PackIcon Kind="AboutOutline" Margin="0 0 0 -3" />
|
||||||
|
</InlineUIContainer>
|
||||||
|
<Run Text=" The surface is a digital representation of your LED setup. Set this up accurately and effects will seamlessly move from one device to the other." />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Border BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="0 0 0 1" Margin="0 10" />
|
<Border BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="0 0 0 1" Margin="0 10" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="1" Grid.Column="0"
|
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="1" Grid.Column="0"
|
||||||
VerticalAlignment="Stretch" Margin="0,0,5,0" >
|
VerticalAlignment="Stretch" Margin="0,0,5,0">
|
||||||
<Grid ClipToBounds="True"
|
<Grid ClipToBounds="True"
|
||||||
Focusable="True"
|
Focusable="True"
|
||||||
FocusVisualStyle="{StaticResource FocusVisual}"
|
FocusVisualStyle="{StaticResource FocusVisual}"
|
||||||
@ -71,23 +76,23 @@
|
|||||||
</Grid.Background>
|
</Grid.Background>
|
||||||
|
|
||||||
<Grid.Triggers>
|
<Grid.Triggers>
|
||||||
<EventTrigger RoutedEvent="Grid.MouseLeftButtonDown">
|
<EventTrigger RoutedEvent="UIElement.MouseLeftButtonDown">
|
||||||
<BeginStoryboard>
|
<BeginStoryboard>
|
||||||
<Storyboard TargetName="MultiSelectionPath" TargetProperty="Opacity">
|
<Storyboard Storyboard.TargetName="MultiSelectionPath" Storyboard.TargetProperty="Opacity">
|
||||||
<DoubleAnimation From="0" To="1" Duration="0:0:0.1" />
|
<DoubleAnimation From="0" To="1" Duration="0:0:0.1" />
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</BeginStoryboard>
|
</BeginStoryboard>
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
<EventTrigger RoutedEvent="Grid.MouseLeftButtonUp">
|
<EventTrigger RoutedEvent="UIElement.MouseLeftButtonUp">
|
||||||
<BeginStoryboard>
|
<BeginStoryboard>
|
||||||
<Storyboard TargetName="MultiSelectionPath" TargetProperty="Opacity">
|
<Storyboard Storyboard.TargetName="MultiSelectionPath" Storyboard.TargetProperty="Opacity">
|
||||||
<DoubleAnimation From="1" To="0" Duration="0:0:0.2" />
|
<DoubleAnimation From="1" To="0" Duration="0:0:0.2" />
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</BeginStoryboard>
|
</BeginStoryboard>
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
</Grid.Triggers>
|
</Grid.Triggers>
|
||||||
|
|
||||||
<Grid Name="EditorDisplayGrid">
|
<Grid x:Name="EditorDisplayGrid">
|
||||||
<Grid.RenderTransform>
|
<Grid.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
<ScaleTransform ScaleX="{Binding PanZoomViewModel.Zoom}" ScaleY="{Binding PanZoomViewModel.Zoom}" />
|
<ScaleTransform ScaleX="{Binding PanZoomViewModel.Zoom}" ScaleY="{Binding PanZoomViewModel.Zoom}" />
|
||||||
@ -101,7 +106,7 @@
|
|||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemContainerStyle>
|
<ItemsControl.ItemContainerStyle>
|
||||||
<Style TargetType="ContentPresenter">
|
<Style TargetType="{x:Type ContentPresenter}">
|
||||||
<Setter Property="Canvas.Left" Value="{Binding Device.X}" />
|
<Setter Property="Canvas.Left" Value="{Binding Device.X}" />
|
||||||
<Setter Property="Canvas.Top" Value="{Binding Device.Y}" />
|
<Setter Property="Canvas.Top" Value="{Binding Device.Y}" />
|
||||||
</Style>
|
</Style>
|
||||||
@ -155,7 +160,7 @@
|
|||||||
<Path Data="{Binding SelectionRectangle}" Opacity="0"
|
<Path Data="{Binding SelectionRectangle}" Opacity="0"
|
||||||
Stroke="{DynamicResource PrimaryHueLightBrush}"
|
Stroke="{DynamicResource PrimaryHueLightBrush}"
|
||||||
StrokeThickness="1"
|
StrokeThickness="1"
|
||||||
Name="MultiSelectionPath"
|
x:Name="MultiSelectionPath"
|
||||||
IsHitTestVisible="False">
|
IsHitTestVisible="False">
|
||||||
<Path.Fill>
|
<Path.Fill>
|
||||||
<SolidColorBrush Color="{DynamicResource Primary400}" Opacity="0.25" />
|
<SolidColorBrush Color="{DynamicResource Primary400}" Opacity="0.25" />
|
||||||
@ -182,30 +187,29 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</materialDesign:Card>
|
</materialDesign:Card>
|
||||||
|
|
||||||
<GridSplitter Grid.Column="1" Grid.Row="1" Width="5" HorizontalAlignment="Stretch" ShowsPreview="True" Cursor="SizeWE" />
|
<GridSplitter Grid.Column="1" Grid.Row="1" Width="5" HorizontalAlignment="Stretch" Cursor="SizeWE" />
|
||||||
|
|
||||||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="1" Grid.Column="2"
|
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="1" Grid.Column="2" VerticalAlignment="Stretch" Margin="5,0,0,0">
|
||||||
VerticalAlignment="Stretch" Margin="5,0,0,0">
|
|
||||||
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True">
|
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True">
|
||||||
<Grid HorizontalAlignment="Stretch">
|
<Grid HorizontalAlignment="Stretch">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<ListBox Grid.Row="0" HorizontalContentAlignment="Stretch"
|
<ListBox Grid.Row="0" HorizontalContentAlignment="Stretch" ItemsSource="{Binding SurfaceConfigurations}" SelectedItem="{Binding SelectedSurface}">
|
||||||
ItemsSource="{Binding SurfaceConfigurations}" SelectedItem="{Binding SelectedSurface}">
|
|
||||||
<ListBox.Resources>
|
<ListBox.Resources>
|
||||||
<DataTemplate DataType="{x:Type models:Surface}">
|
<DataTemplate DataType="{x:Type models:Surface}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="40" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="{Binding Name}" ToolTip="{Binding Name}"
|
<TextBlock Text="{Binding Name}" ToolTip="{Binding Name}"
|
||||||
HorizontalAlignment="Left" VerticalAlignment="Center" />
|
HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||||
<Button Grid.Column="1"
|
<Button Grid.Column="1"
|
||||||
Command="{s:Action DeleteSurfaceConfiguration}"
|
Command="{s:Action DeleteSurfaceConfiguration}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
|
IsEnabled="{Binding IsActive, Converter={StaticResource InverseBooleanConverter}}"
|
||||||
Style="{StaticResource MaterialDesignIconForegroundButton}"
|
Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||||
ToolTip="Delete layout configuration"
|
ToolTip="Delete layout configuration"
|
||||||
HorizontalAlignment="Right">
|
HorizontalAlignment="Right">
|
||||||
@ -230,11 +234,11 @@
|
|||||||
</materialDesign:Card>
|
</materialDesign:Card>
|
||||||
|
|
||||||
<TextBlock Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Style="{StaticResource MaterialDesignCaptionTextBlock}" Margin="0,5,0,0">
|
<TextBlock Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Style="{StaticResource MaterialDesignCaptionTextBlock}" Margin="0,5,0,0">
|
||||||
<materialDesign:PackIcon Kind="Keyboard" Margin="0 0 0 -3" />
|
<InlineUIContainer>
|
||||||
<Run Text="Hold" />
|
<materialDesign:PackIcon Kind="Keyboard" Margin="0 0 0 -3" />
|
||||||
<Run FontWeight="Bold" Text="shift" />
|
</InlineUIContainer>
|
||||||
<Run Text="or click and drag to select multiple devices at once. To move around the surface hold down" />
|
<Run Text=" " /><Run Text="Hold" /><Run Text=" " /><Run FontWeight="Bold" Text="shift" /><Run Text=" " />
|
||||||
<Run FontWeight="Bold" Text="ctrl" />
|
<Run Text="or click and drag to select multiple devices at once. To move around the surface hold down" /><Run Text=" " /><Run FontWeight="Bold" Text="ctrl" /><Run Text=" " />
|
||||||
<Run Text="and drag." />
|
<Run Text="and drag." />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user