1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Finished profile editor panels structure

This commit is contained in:
SpoinkyNL 2019-11-26 20:20:15 +01:00
parent 06f014a294
commit 8c9144a136
2 changed files with 47 additions and 48 deletions

View File

@ -8,7 +8,7 @@
xmlns:profileEditor="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{x:Type profileEditor:ProfileEditorViewModel}">
d:DataContext="{d:DesignInstance Type=profileEditor:ProfileEditorViewModel, IsDesignTimeCreatable=False}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@ -20,37 +20,36 @@
</ResourceDictionary>
</UserControl.Resources>
<!-- Blue -->
<Grid Margin="16">
<Grid.ColumnDefinitions>
<!-- Left side -->
<ColumnDefinition Width="*" MinWidth="100" />
<!-- Side panels resize -->
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="{Binding ProfileElementsWidth.Value, Mode=TwoWay}" MinWidth="100" />
<!-- Side panels -->
<ColumnDefinition Width="{Binding SidePanelsWidth.Value, Mode=TwoWay}" MinWidth="100" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="100" />
<RowDefinition Height="Auto" />
<RowDefinition Height="{Binding LayerElementsHeight.Value, Mode=TwoWay}" MinHeight="100" />
</Grid.RowDefinitions>
<!-- Left side -->
<!-- Left side (orange) -->
<Grid Grid.Row="0" Grid.Column="0">
<Grid.RowDefinitions>
<!-- Introduction -->
<RowDefinition Height="Auto"/>
<RowDefinition Height="35" />
<!-- Design area -->
<RowDefinition Height="*" MinHeight="200"/>
<RowDefinition Height="*" MinHeight="200" />
<!-- Bottom panels resize -->
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" />
<!-- Bottom panels -->
<RowDefinition Height="{Binding BottomPanelsHeight.Value, Mode=TwoWay}" MinHeight="100"/>
<RowDefinition Height="{Binding BottomPanelsHeight.Value, Mode=TwoWay}" MinHeight="100" />
</Grid.RowDefinitions>
<!-- Introduction -->
<StackPanel Grid.Row="0" Margin="0 0 15 0">
<StackPanel Grid.Row="0">
<TextBlock>
<materialDesign:PackIcon Kind="AboutOutline" Margin="0 0 0 -4" /> The profile defines what colors the LEDs will have. Multiple groups of LEDs are defined into layers. On these layers you can apply effects.
<materialDesign:PackIcon Kind="AboutOutline" /> The profile defines what colors the LEDs will have. Multiple groups of LEDs are defined into layers. On these layers you can apply effects.
</TextBlock>
<Separator Style="{StaticResource MaterialDesignDarkSeparator}" />
<Separator Style="{StaticResource MaterialDesignDarkSeparator}" Margin="0 -2.5 0 0" />
</StackPanel>
<!-- Design area -->
@ -61,11 +60,14 @@
<!-- Bottom panels resize -->
<GridSplitter Grid.Row="2" Grid.Column="0" Height="5" HorizontalAlignment="Stretch" Cursor="SizeNS" Margin="0 5" />
<!-- Bottom panels -->
<!-- Bottom panels (green) -->
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<!-- Layer elements -->
<ColumnDefinition Width="*" MinWidth="100" />
<!-- Element properties resize -->
<ColumnDefinition Width="Auto" />
<!-- Element properties -->
<ColumnDefinition Width="{Binding ElementPropertiesWidth.Value, Mode=TwoWay}" MinWidth="100" />
</Grid.ColumnDefinitions>
@ -84,11 +86,22 @@
</Grid>
</Grid>
<!-- Right panels resize -->
<GridSplitter Grid.Row="0" Grid.Column="1" Width="5" HorizontalAlignment="Stretch" Cursor="SizeWE" Margin="5 0" />
<!-- Side panels resize -->
<GridSplitter Grid.Row="0" Grid.Column="1" Width="5" HorizontalAlignment="Stretch" Cursor="SizeWE" Margin="5 35 5 0" />
<!-- Right side -->
<!-- Side panels (orange) -->
<Grid Grid.Row="0" Grid.Column="2">
<Grid.RowDefinitions>
<!-- Profile selection -->
<RowDefinition Height="35" />
<!-- Profile elements -->
<RowDefinition Height="*" MinHeight="100" />
<!-- Conditions resize -->
<RowDefinition Height="Auto" />
<!-- Display conditions -->
<RowDefinition Height="{Binding DisplayConditionsHeight.Value, Mode=TwoWay}" MinHeight="100" />
</Grid.RowDefinitions>
<!-- Profile selection -->
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
@ -127,32 +140,18 @@
</Button>
</Grid>
</Grid>
<GridSplitter Grid.Row="1" Grid.Column="1" Width="5" HorizontalAlignment="Stretch" Cursor="SizeWE" Margin="5 0" />
<!-- Right panels -->
<Grid Grid.Row="1" Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="{Binding DisplayConditionsHeight.Value, Mode=TwoWay}" MinHeight="100" />
</Grid.RowDefinitions>
<materialDesign:Card Grid.Row="0" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch">
<ContentControl s:View.Model="{Binding ProfileElementsViewModel}" />
<!-- Profile elements -->
<materialDesign:Card Grid.Row="1" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch">
<ContentControl s:View.Model="{Binding ProfileElementsViewModel}" Margin="0,-1,-0.2,1" />
</materialDesign:Card>
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" Cursor="SizeNS" Margin="0 5" />
<!-- Conditions resize -->
<GridSplitter Grid.Row="2" Height="5" HorizontalAlignment="Stretch" Cursor="SizeNS" Margin="0 5" />
<materialDesign:Card Grid.Row="2" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch">
<!-- Display conditions -->
<materialDesign:Card Grid.Row="3" materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch">
<ContentControl s:View.Model="{Binding DisplayConditionsViewModel}" />
</materialDesign:Card>
</Grid>
<GridSplitter Grid.Row="2" Grid.Column="0" Height="5" HorizontalAlignment="Stretch" Cursor="SizeNS" Margin="0 5" />
</Grid>
</UserControl>

View File

@ -55,9 +55,9 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
public ProfileViewModel ProfileViewModel { get; }
public BindableCollection<Profile> Profiles { get; set; }
public PluginSetting<GridLength> ProfileElementsWidth { get; set; }
public PluginSetting<GridLength> SidePanelsWidth { get; set; }
public PluginSetting<GridLength> DisplayConditionsHeight { get; set; }
public PluginSetting<GridLength> LayerElementsHeight { get; set; }
public PluginSetting<GridLength> BottomPanelsHeight { get; set; }
public PluginSetting<GridLength> ElementPropertiesWidth { get; set; }
public Profile SelectedProfile
@ -157,17 +157,17 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
private void LoadWorkspaceSettings()
{
ProfileElementsWidth = _settingsService.GetSetting("ProfileEditor.ProfileElementsWidth", new GridLength(550));
DisplayConditionsHeight = _settingsService.GetSetting("ProfileEditor.DisplayConditionsHeight", new GridLength(320));
LayerElementsHeight = _settingsService.GetSetting("ProfileEditor.LayerElementsHeight", new GridLength(350));
ElementPropertiesWidth = _settingsService.GetSetting("ProfileEditor.ElementPropertiesWidth", new GridLength(920));
SidePanelsWidth = _settingsService.GetSetting("ProfileEditor.SidePanelsWidth", new GridLength(385));
DisplayConditionsHeight = _settingsService.GetSetting("ProfileEditor.DisplayConditionsHeight", new GridLength(345));
BottomPanelsHeight = _settingsService.GetSetting("ProfileEditor.BottomPanelsHeight", new GridLength(265));
ElementPropertiesWidth = _settingsService.GetSetting("ProfileEditor.ElementPropertiesWidth", new GridLength(545));
}
private void SaveWorkspaceSettings()
{
ProfileElementsWidth.Save();
SidePanelsWidth.Save();
DisplayConditionsHeight.Save();
LayerElementsHeight.Save();
BottomPanelsHeight.Save();
ElementPropertiesWidth.Save();
}