1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-31 17:53:32 +00:00

Yes! I Love it when not all files are saved!

This commit is contained in:
Robert 2019-11-13 20:21:42 +01:00
parent 5340e6c6d4
commit 6a5304c3e3
5 changed files with 78 additions and 74 deletions

View File

@ -31,7 +31,7 @@
Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Teal.xaml" /> Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Teal.xaml" />
<!-- Include the Dragablz Material Design style --> <!-- Include the Dragablz Material Design style -->
<ResourceDictionary Source="pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml"/> <ResourceDictionary Source="pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<!-- MahApps Brushes --> <!-- MahApps Brushes -->
@ -59,7 +59,8 @@
Color="{DynamicResource Primary500Foreground}" /> Color="{DynamicResource Primary500Foreground}" />
<!-- tell Dragablz tab control to use the Material Design theme --> <!-- tell Dragablz tab control to use the Material Design theme -->
<Style TargetType="{x:Type dragablz:TabablzControl}" BasedOn="{StaticResource MaterialDesignTabablzControlStyle}" /> <Style TargetType="{x:Type dragablz:TabablzControl}"
BasedOn="{StaticResource MaterialDesignTabablzControlStyle}" />
<!-- Some general convertes etc. --> <!-- Some general convertes etc. -->
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" /> <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
@ -68,7 +69,7 @@
<DrawingImage.Drawing> <DrawingImage.Drawing>
<DrawingGroup> <DrawingGroup>
<GeometryDrawing Brush="{DynamicResource IdealForegroundColorBrush}" <GeometryDrawing Brush="{DynamicResource IdealForegroundColorBrush}"
Geometry="M1518 3378 c-48 -63 -61 -101 -66 -184 -4 -70 -1 -91 27 Geometry="M1518 3378 c-48 -63 -61 -101 -66 -184 -4 -70 -1 -91 27
-170 l31 -89 -27 -20 c-32 -24 -849 -601 -981 -693 l-93 -64 -87 40 -170 l31 -89 -27 -20 c-32 -24 -849 -601 -981 -693 l-93 -64 -87 40
c-48 22 -91 37 -95 32 -5 -4 9 -41 29 -83 l37 -75 -28 -24 c-23 -20 c-48 22 -91 37 -95 32 -5 -4 9 -41 29 -83 l37 -75 -28 -24 c-23 -20
-29 -35 -33 -81 l-4 -56 -82 -19 c-109 -25 -109 -41 4 -91 l85 -38 7 -29 -35 -33 -81 l-4 -56 -82 -19 c-109 -25 -109 -41 4 -91 l85 -38 7

View File

@ -36,7 +36,7 @@ namespace Artemis.UI.ViewModels.Screens
public ObservableCollection<Surface> SurfaceConfigurations { get; set; } public ObservableCollection<Surface> SurfaceConfigurations { get; set; }
public RectangleGeometry SelectionRectangle { get; set; } public RectangleGeometry SelectionRectangle { get; set; }
public PanZoomViewModel PanZoomViewModel { get; set; } public PanZoomViewModel PanZoomViewModel { get; set; }
public Surface SelectedSurface public Surface SelectedSurface
{ {
get => _selectedSurface; get => _selectedSurface;

View File

@ -10,12 +10,12 @@
d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileDeviceViewModel}}" d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileDeviceViewModel}}"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources> <UserControl.Resources>
<converters:NullToImageConverter x:Key="NullToImageConverter"/> <converters:NullToImageConverter x:Key="NullToImageConverter" />
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" /> <converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid>
<!-- Device image with fallback --> <!-- Device image with fallback -->
<Image Source="{Binding Device.RgbDevice.DeviceInfo.Image, Converter={StaticResource NullToImageConverter}}"/> <Image Source="{Binding Device.RgbDevice.DeviceInfo.Image, Converter={StaticResource NullToImageConverter}}" />
<Rectangle Fill="{DynamicResource ControlBackgroundBrush}" <Rectangle Fill="{DynamicResource ControlBackgroundBrush}"
Stroke="{DynamicResource ControlBorderBrush}" Stroke="{DynamicResource ControlBorderBrush}"

View File

@ -1,14 +1,14 @@
<UserControl x:Class="Artemis.UI.Views.Controls.ProfileEditor.ProfileEditorView" <UserControl x:Class="Artemis.UI.Views.Controls.ProfileEditor.ProfileEditorView"
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:local="clr-namespace:Artemis.UI.Views.Controls.ProfileEditor" xmlns:local="clr-namespace:Artemis.UI.Views.Controls.ProfileEditor"
xmlns:profileEditor="clr-namespace:Artemis.UI.ViewModels.Controls.ProfileEditor" xmlns:profileEditor="clr-namespace:Artemis.UI.ViewModels.Controls.ProfileEditor"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet" xmlns:s="https://github.com/canton7/Stylet"
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" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileEditorViewModel}}"> d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileEditorViewModel}}">
<UserControl.Resources> <UserControl.Resources>
@ -86,71 +86,72 @@
</BeginStoryboard> </BeginStoryboard>
</EventTrigger> </EventTrigger>
</Grid.Triggers> </Grid.Triggers>
<Grid Name="EditorDisplayGrid"> <Grid Name="EditorDisplayGrid">
<Grid.RenderTransform> <Grid.RenderTransform>
<TransformGroup> <TransformGroup>
<ScaleTransform ScaleX="{Binding PanZoomViewModel.Zoom}" <ScaleTransform ScaleX="{Binding PanZoomViewModel.Zoom}"
ScaleY="{Binding PanZoomViewModel.Zoom}" /> ScaleY="{Binding PanZoomViewModel.Zoom}" />
<TranslateTransform X="{Binding PanZoomViewModel.PanX}" Y="{Binding PanZoomViewModel.PanY}" /> <TranslateTransform X="{Binding PanZoomViewModel.PanX}" Y="{Binding PanZoomViewModel.PanY}" />
</TransformGroup> </TransformGroup>
</Grid.RenderTransform> </Grid.RenderTransform>
<ItemsControl ItemsSource="{Binding Devices}"> <ItemsControl ItemsSource="{Binding Devices}">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<Canvas /> <Canvas />
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle> <ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter"> <Style TargetType="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding X}" /> <Setter Property="Canvas.Left" Value="{Binding X}" />
<Setter Property="Canvas.Top" Value="{Binding Y}" /> <Setter Property="Canvas.Top" Value="{Binding Y}" />
</Style> </Style>
</ItemsControl.ItemContainerStyle> </ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<ContentControl Width="{Binding Device.RgbDevice.Size.Width}" <ContentControl Width="{Binding Device.RgbDevice.Size.Width}"
Height="{Binding Device.RgbDevice.Size.Height}" Height="{Binding Device.RgbDevice.Size.Height}"
s:View.Model="{Binding}"> s:View.Model="{Binding}" />
</ContentControl> </DataTemplate>
</DataTemplate> </ItemsControl.ItemTemplate>
</ItemsControl.ItemTemplate> </ItemsControl>
</ItemsControl> </Grid>
</Grid>
<!-- Multi-selection rectangle -->
<!-- Multi-selection rectangle --> <Path Data="{Binding SelectionRectangle}" Opacity="0"
<Path Data="{Binding SelectionRectangle}" Opacity="0" Stroke="{DynamicResource PrimaryHueLightBrush}"
Stroke="{DynamicResource PrimaryHueLightBrush}" StrokeThickness="1"
StrokeThickness="1" Name="MultiSelectionPath"
Name="MultiSelectionPath" IsHitTestVisible="False">
IsHitTestVisible="False"> <Path.Fill>
<Path.Fill> <SolidColorBrush Color="{DynamicResource Primary400}" Opacity="0.25" />
<SolidColorBrush Color="{DynamicResource Primary400}" Opacity="0.25" /> </Path.Fill>
</Path.Fill> </Path>
</Path>
<StackPanel Orientation="Vertical" VerticalAlignment="Bottom" HorizontalAlignment="Right"
<StackPanel Orientation="Vertical" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0, 0, 15, 15">
Margin="0, 0, 15, 15"> <Slider Margin="0,0,14,0"
<Slider Margin="0,0,14,0" Orientation="Vertical"
Orientation="Vertical" Minimum="10"
Minimum="10" Maximum="400"
Maximum="400" Height="100"
Height="100" FocusVisualStyle="{x:Null}"
FocusVisualStyle="{x:Null}" Value="{Binding PanZoomViewModel.ZoomPercentage}"
Value="{Binding PanZoomViewModel.ZoomPercentage}" Style="{StaticResource MaterialDesignDiscreteSlider}" />
Style="{StaticResource MaterialDesignDiscreteSlider}" /> <Button Command="{s:Action ResetZoomAndPan}"
<Button Command="{s:Action ResetZoomAndPan}" Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
Style="{StaticResource MaterialDesignFloatingActionMiniButton}" HorizontalAlignment="Right"
HorizontalAlignment="Right" ToolTip="Reset zoom &amp; position">
ToolTip="Reset zoom &amp; position"> <materialDesign:PackIcon Kind="ImageFilterCenterFocus" Height="24" Width="24" />
<materialDesign:PackIcon Kind="ImageFilterCenterFocus" Height="24" Width="24" /> </Button>
</Button> </StackPanel>
</StackPanel>
</Grid> </Grid>
</materialDesign:Card> </materialDesign:Card>
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch" Margin="5,0,0,0"> <materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="2" Grid.Column="1"
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True" UseLayoutRounding="True"> VerticalAlignment="Stretch" Margin="5,0,0,0">
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True"
UseLayoutRounding="True">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*" /> <RowDefinition Height="*" />
@ -169,4 +170,4 @@
<Run Text="and drag." /> <Run Text="and drag." />
</TextBlock> </TextBlock>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -4,7 +4,8 @@
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:profileEditor="clr-namespace:Artemis.UI.ViewModels.Controls.ProfileEditor" xmlns:profileEditor="clr-namespace:Artemis.UI.ViewModels.Controls.ProfileEditor"
xmlns:Converters="clr-namespace:Artemis.UI.Converters" x:Class="Artemis.UI.Views.Controls.ProfileEditor.ProfileLedView" xmlns:Converters="clr-namespace:Artemis.UI.Converters"
x:Class="Artemis.UI.Views.Controls.ProfileEditor.ProfileLedView"
mc:Ignorable="d" mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileLedViewModel}}" d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileLedViewModel}}"
d:DesignHeight="25" d:DesignWidth="25" d:DesignHeight="25" d:DesignWidth="25"
@ -14,7 +15,8 @@
</UserControl.Resources> </UserControl.Resources>
<Canvas Width="{Binding Width}" Height="{Binding Height}"> <Canvas Width="{Binding Width}" Height="{Binding Height}">
<Canvas.Background> <Canvas.Background>
<ImageBrush AlignmentX="Center" AlignmentY="Center" Stretch="Fill" ImageSource="{Binding Led.Image, Converter={StaticResource NullToImageConverter}}" /> <ImageBrush AlignmentX="Center" AlignmentY="Center" Stretch="Fill"
ImageSource="{Binding Led.Image, Converter={StaticResource NullToImageConverter}}" />
</Canvas.Background> </Canvas.Background>
<Path Data="{Binding DisplayGeometry}" ClipToBounds="False"> <Path Data="{Binding DisplayGeometry}" ClipToBounds="False">