diff --git a/src/Artemis.UI.Shared/Controls/ColorPicker.xaml b/src/Artemis.UI.Shared/Controls/ColorPicker.xaml index e4ce9f773..0717700b2 100644 --- a/src/Artemis.UI.Shared/Controls/ColorPicker.xaml +++ b/src/Artemis.UI.Shared/Controls/ColorPicker.xaml @@ -117,14 +117,14 @@ Maximum="255" /> - + Preview on devices - + diff --git a/src/Artemis.UI.Shared/Controls/TreeViewPopupCompatibleCheckBox.cs b/src/Artemis.UI.Shared/Controls/TreeViewPopupCompatibleCheckBox.cs deleted file mode 100644 index 42952c013..000000000 --- a/src/Artemis.UI.Shared/Controls/TreeViewPopupCompatibleCheckBox.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Windows.Controls; -using System.Windows.Input; - -namespace Artemis.UI.Shared -{ - // Workaround for https://developercommunity.visualstudio.com/content/problem/190202/button-controls-hosted-in-popup-windows-do-not-wor.html - /// - public class TreeViewPopupCompatibleCheckBox : CheckBox - { - /// - protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e) - { - base.OnMouseLeftButtonDown(e); - } - - /// - protected override void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e) - { - base.OnMouseLeftButtonUp(e); - } - } -} \ No newline at end of file diff --git a/src/Artemis.UI.Shared/DataModelVisualization/DataModelInputViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/DataModelInputViewModel.cs index f0b2b2a02..c9ec085a4 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/DataModelInputViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/DataModelInputViewModel.cs @@ -84,7 +84,7 @@ namespace Artemis.UI.Shared // After the animation finishes attempt to focus the input field Task.Run(async () => { - await Task.Delay(400); + await Task.Delay(50); await Execute.OnUIThreadAsync(() => View.MoveFocus(new TraversalRequest(FocusNavigationDirection.First))); }); } diff --git a/src/Artemis.UI.Shared/DataModelVisualization/Input/DataModelStaticView.xaml b/src/Artemis.UI.Shared/DataModelVisualization/Input/DataModelStaticView.xaml index 67446972a..e11580842 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/Input/DataModelStaticView.xaml +++ b/src/Artemis.UI.Shared/DataModelVisualization/Input/DataModelStaticView.xaml @@ -21,14 +21,15 @@ - + @@ -116,7 +116,7 @@ - + - - - - - - - + diff --git a/src/Artemis.UI/Screens/ProfileEditor/Conditions/DataModelConditionListView.xaml b/src/Artemis.UI/Screens/ProfileEditor/Conditions/DataModelConditionListView.xaml index 1b6bd4a81..7ad1e3265 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Conditions/DataModelConditionListView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Conditions/DataModelConditionListView.xaml @@ -39,10 +39,10 @@ - @@ -58,23 +58,23 @@ ToolTip="Change the list operator, determining how the list contents should match"> - - - + + - + ToolTip="None of the list items should evaluate to true" /> + @@ -82,13 +82,7 @@ - - - - - - - + diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/LayerPropertiesView.xaml b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/LayerPropertiesView.xaml index 63d83a3a2..e43278cf1 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/LayerPropertiesView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/LayerPropertiesView.xaml @@ -61,6 +61,7 @@ + @@ -120,14 +121,14 @@ Click="{s:Action CycleRepeating}"> - + Don't repeat the timeline - This setting only applies to the editor and affect the repeat mode during profile use + This setting only applies to the editor and affect the repeat mode during profile use @@ -317,13 +318,14 @@ Margin="0 -2 5 -2" Padding="10 0" Height="20" - Width="110" + Width="115" ToolTip="Select an effect to add" VerticalAlignment="Center" Visibility="{Binding PropertyTreeVisible, Converter={x:Static s:BoolToVisibilityConverter.Instance}}" - IsEnabled="{Binding SelectedProfileElement, Converter={StaticResource NullToBooleanConverter}}" Command="{x:Static materialDesign:Transitioner.MoveLastCommand}" - CommandTarget="{Binding ElementName=TransitionCommandAnchor}"> + CommandTarget="{Binding ElementName=TransitionCommandAnchor}" + Click="{s:Action ToggleEffectsViewModel}" + IsEnabled="{Binding CanToggleEffectsViewModel}"> ADD EFFECT @@ -333,13 +335,15 @@ Margin="0 -2 5 -2" Padding="10 0" Height="20" - Width="110" + Width="115" ToolTip="Show the layer/folder properties" VerticalAlignment="Center" Visibility="{Binding PropertyTreeVisible, Converter={x:Static s:BoolToVisibilityConverter.InverseInstance}}" Command="{x:Static materialDesign:Transitioner.MoveFirstCommand}" - CommandTarget="{Binding ElementName=TransitionCommandAnchor}"> - + CommandTarget="{Binding ElementName=TransitionCommandAnchor}" + Click="{s:Action ToggleEffectsViewModel}" + IsEnabled="{Binding CanToggleEffectsViewModel}"> + SHOW PROPERTIES @@ -363,7 +367,6 @@ Width="110" ToolTip="Add a new segment to the timeline" VerticalAlignment="Center" - Visibility="{Binding PropertyTreeVisible, Converter={x:Static s:BoolToVisibilityConverter.Instance}}" IsEnabled="{Binding SelectedProfileElement, Converter={StaticResource NullToBooleanConverter}}"> - - + + + + + + + - - - - - - - General - - - - - - - - - Transform - - - - - - - - - - - - - - - - Brush -  - - - - - - - - - - - - - - - - - - - - - - Effect - - - - - - - - - - - - - - - - - - - + HorizontalAlignment="Left" + Margin="3 5 0 5"> + + + + + + + + + + + + General + + + + + + + + + Transform + + + + + + + + + + + + + + + + Brush -  + + + + + + + + + + + + + + + + + + + + + + Effect + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeGroupViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeGroupViewModel.cs index 67dbc1956..4c7b82e33 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeGroupViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeGroupViewModel.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Artemis.Core; using Artemis.Core.LayerBrushes; @@ -36,6 +37,8 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree LayerPropertyGroupViewModel = layerPropertyGroupViewModel; LayerPropertyGroup = LayerPropertyGroupViewModel.LayerPropertyGroup; + LayerPropertyGroupViewModel.PropertyChanged += LayerPropertyGroupViewModelOnPropertyChanged; + DetermineGroupType(); } @@ -43,6 +46,11 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree public LayerPropertyGroup LayerPropertyGroup { get; } public LayerPropertyGroupType GroupType { get; set; } + public BindableCollection Children => + LayerPropertyGroupViewModel.IsExpanded && LayerPropertyGroupViewModel.IsVisible + ? LayerPropertyGroupViewModel.Children + : null; + public void OpenBrushSettings() { var layerBrush = LayerPropertyGroup.LayerBrush; @@ -128,6 +136,25 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree _profileEditorService.UpdateSelectedProfile(); } + public double GetDepth() + { + var depth = 0; + var current = LayerPropertyGroup.Parent; + while (current != null) + { + depth++; + current = current.Parent; + } + + return depth; + } + + private void LayerPropertyGroupViewModelOnPropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(LayerPropertyGroupViewModel.IsExpanded) || e.PropertyName == nameof(LayerPropertyGroupViewModel.IsVisible)) + NotifyOfPropertyChange(nameof(Children)); + } + private void DetermineGroupType() { if (LayerPropertyGroup is LayerGeneralProperties) diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyView.xaml b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyView.xaml index dc3ff8719..b21a4f2f5 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyView.xaml @@ -6,55 +6,67 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:s="https://github.com/canton7/Stylet" xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" + xmlns:converters="clr-namespace:Artemis.UI.Converters" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - - - - - - - - - - + + + + - + + + + + + + + + + + - - - - - + - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyViewModel.cs index ffb12a669..44cd7b1b5 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyViewModel.cs @@ -37,6 +37,18 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree } public bool HasDataBinding => LayerProperty.HasDataBinding; + public double GetDepth() + { + var depth = 0; + var current = LayerProperty.LayerPropertyGroup; + while (current != null) + { + depth++; + current = current.Parent; + } + + return depth; + } public bool HasPropertyInputViewModel => PropertyInputViewModel != null; @@ -112,5 +124,6 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree { bool HasPropertyInputViewModel { get; } bool HasDataBinding { get; } + double GetDepth(); } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeView.xaml b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeView.xaml index 1d2d9aaee..e4dec13ce 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeView.xaml @@ -11,104 +11,19 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance {x:Type tree:TreeViewModel}}"> - - - - - - - - + + - - - - - + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeViewModel.cs index 5c84fa57f..25c9bc682 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreeViewModel.cs @@ -1,7 +1,10 @@ using System.Windows; -using System.Windows.Controls; +using System.Windows.Forms; using System.Windows.Input; using Stylet; +using Control = System.Windows.Controls.Control; +using KeyEventArgs = System.Windows.Input.KeyEventArgs; +using Screen = Stylet.Screen; namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree { diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileView.xaml b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileView.xaml index 8e56456c9..52c232a23 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileView.xaml @@ -26,8 +26,8 @@ - - + +