1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-01-02 10:43:31 +00:00

Enabled pulse on profile editor glow effect and fixed slide animations

This commit is contained in:
SpoinkyNL 2016-06-02 00:45:28 +02:00
parent 73017e8091
commit 2c748ca5d1
4 changed files with 21 additions and 2 deletions

View File

@ -17,11 +17,13 @@ namespace Artemis.Utilities.Layers
case LayerAnimation.SlideLeft:
if (progress + 1 >= animateProperties.Width*scale)
progress = 0;
progress = progress + animateProperties.AnimationSpeed * 2;
break;
case LayerAnimation.SlideDown:
case LayerAnimation.SlideUp:
if (progress + 1 >= animateProperties.Height*scale)
progress = 0;
progress = progress + animateProperties.AnimationSpeed * 2;
break;
case LayerAnimation.Pulse:
if (progress > 2)

View File

@ -608,6 +608,7 @@ namespace Artemis.ViewModels.Profiles
return;
profile.KeyboardName = _mainManager.DeviceManager.ActiveKeyboard.Name;
profile.IsDefault = false;
profile.FixBoundaries(_mainManager.DeviceManager.ActiveKeyboard.KeyboardRectangle(1));
}

View File

@ -19,6 +19,8 @@ namespace Artemis.ViewModels.Profiles
public class ProfileViewModel : PropertyChangedBase, IHandle<ActiveKeyboardChanged>
{
private readonly DeviceManager _deviceManager;
private double _blurProgress;
private double _blurRadius;
private DateTime _downTime;
private LayerModel _draggingLayer;
private Point? _draggingLayerOffset;
@ -61,6 +63,16 @@ namespace Artemis.ViewModels.Profiles
}
}
public double BlurRadius
{
get { return _blurRadius; }
set
{
if (value.Equals(_blurRadius)) return;
_blurRadius = value;
NotifyOfPropertyChange(() => BlurRadius);
}
}
public ImageSource KeyboardImage
{
@ -98,6 +110,11 @@ namespace Artemis.ViewModels.Profiles
/// </summary>
public void UpdateKeyboardPreview()
{
if (_blurProgress > 2)
_blurProgress = 0;
_blurProgress = _blurProgress + 0.025;
BlurRadius = (Math.Sin(_blurProgress*Math.PI) + 1)*10 + 10;
if (SelectedProfile == null || _deviceManager.ActiveKeyboard == null)
{
KeyboardPreview = new DrawingImage();

View File

@ -30,9 +30,8 @@
BorderThickness="3" Width="800" Height="400">
<Border>
<Border.Effect>
<!-- TODO: Pulse 10-20 -->
<DropShadowEffect ShadowDepth="0" Color="{DynamicResource HighlightColor}" Opacity="1"
BlurRadius="20" />
BlurRadius="{Binding Path=ProfileViewModel.BlurRadius, Mode=OneWay}" />
</Border.Effect>
<Grid>
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardImage}" Margin="50" />