mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Conditions - Removed animations that made the UI feel sluggish
Profile editor - Fixed effects toggle sometimes dissapearing Property tree - Replaced TreeView with custom implementation Property tree - Fixed minus/plus numpad keys collapsing the tree
This commit is contained in:
1 parent
fa329a9048
commit
a5455c26d6
17 files changed
+430
-447
No files matched your search
@@ -117,14 +117,14 @@
|
||||
Maximum="255" />
|
||||
|
||||
<!-- Checkboxes don't work inside popups inside tree views, which is where the color picker is regularly used -->
|
||||
<shared:TreeViewPopupCompatibleCheckBox Grid.Row="2"
|
||||
x:Name="PreviewCheckBox"
|
||||
Margin="10 0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource MaterialDesignCheckBox}"
|
||||
Click="PreviewCheckBoxClick">
|
||||
<CheckBox Grid.Row="2"
|
||||
x:Name="PreviewCheckBox"
|
||||
Margin="10 0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource MaterialDesignCheckBox}"
|
||||
Click="PreviewCheckBoxClick">
|
||||
Preview on devices
|
||||
</shared:TreeViewPopupCompatibleCheckBox>
|
||||
</CheckBox>
|
||||
|
||||
</Grid>
|
||||
</materialDesign:Card>
|
||||
|
||||
@@ -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
|
||||
/// <inheritdoc />
|
||||
public class TreeViewPopupCompatibleCheckBox : CheckBox
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonDown(e);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonUp(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,14 +21,15 @@
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<materialDesign:Transitioner SelectedIndex="{Binding TransitionIndex}" DefaultTransitionOrigin="0.5, 0.5" Margin="3 -4">
|
||||
<Grid Margin="3 -4">
|
||||
<Button Style="{StaticResource DataModelConditionButton}"
|
||||
Background="{Binding ButtonBrush}"
|
||||
BorderBrush="{Binding ButtonBrush}"
|
||||
Margin="0 4"
|
||||
Command="{s:Action ActivateInputViewModel}"
|
||||
HorizontalAlignment="Left"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Visibility="{Binding InputViewModel, Converter={StaticResource NullToVisibilityConverter}, ConverterParameter=Inverted}">
|
||||
<Grid>
|
||||
<StackPanel Visibility="{Binding Value, Converter={StaticResource NullToVisibilityConverter}}" Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Light"
|
||||
@@ -47,11 +48,12 @@
|
||||
</Button>
|
||||
<Border BorderBrush="{Binding ButtonBrush}"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
Visibility="{Binding InputViewModel, Converter={StaticResource NullToVisibilityConverter}}"
|
||||
CornerRadius="3"
|
||||
Padding="3"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="140">
|
||||
<ContentControl s:View.Model="{Binding InputViewModel}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
|
||||
</Border>
|
||||
</materialDesign:Transitioner>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -20,7 +20,6 @@ namespace Artemis.UI.Shared.Input
|
||||
private string _placeholder = "Enter a value";
|
||||
private DataModelPropertyAttribute _targetDescription;
|
||||
private Type _targetType;
|
||||
private int _transitionIndex;
|
||||
private object _value;
|
||||
private bool _isEnabled;
|
||||
|
||||
@@ -45,13 +44,7 @@ namespace Artemis.UI.Shared.Input
|
||||
get => _buttonBrush;
|
||||
set => SetAndNotify(ref _buttonBrush, value);
|
||||
}
|
||||
|
||||
public int TransitionIndex
|
||||
{
|
||||
get => _transitionIndex;
|
||||
set => SetAndNotify(ref _transitionIndex, value);
|
||||
}
|
||||
|
||||
|
||||
public DataModelDisplayViewModel DisplayViewModel
|
||||
{
|
||||
get => _displayViewModel;
|
||||
@@ -113,7 +106,6 @@ namespace Artemis.UI.Shared.Input
|
||||
|
||||
public void ActivateInputViewModel()
|
||||
{
|
||||
TransitionIndex = 1;
|
||||
InputViewModel = _dataModelUIService.GetDataModelInputViewModel(
|
||||
TargetType,
|
||||
TargetDescription,
|
||||
@@ -149,7 +141,6 @@ namespace Artemis.UI.Shared.Input
|
||||
if (submitted)
|
||||
OnValueUpdated(new DataModelInputStaticEventArgs(value));
|
||||
|
||||
TransitionIndex = 0;
|
||||
InputViewModel = null;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user