1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-01-01 18:23:32 +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: case LayerAnimation.SlideLeft:
if (progress + 1 >= animateProperties.Width*scale) if (progress + 1 >= animateProperties.Width*scale)
progress = 0; progress = 0;
progress = progress + animateProperties.AnimationSpeed * 2;
break; break;
case LayerAnimation.SlideDown: case LayerAnimation.SlideDown:
case LayerAnimation.SlideUp: case LayerAnimation.SlideUp:
if (progress + 1 >= animateProperties.Height*scale) if (progress + 1 >= animateProperties.Height*scale)
progress = 0; progress = 0;
progress = progress + animateProperties.AnimationSpeed * 2;
break; break;
case LayerAnimation.Pulse: case LayerAnimation.Pulse:
if (progress > 2) if (progress > 2)

View File

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

View File

@ -19,6 +19,8 @@ namespace Artemis.ViewModels.Profiles
public class ProfileViewModel : PropertyChangedBase, IHandle<ActiveKeyboardChanged> public class ProfileViewModel : PropertyChangedBase, IHandle<ActiveKeyboardChanged>
{ {
private readonly DeviceManager _deviceManager; private readonly DeviceManager _deviceManager;
private double _blurProgress;
private double _blurRadius;
private DateTime _downTime; private DateTime _downTime;
private LayerModel _draggingLayer; private LayerModel _draggingLayer;
private Point? _draggingLayerOffset; 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 public ImageSource KeyboardImage
{ {
@ -98,6 +110,11 @@ namespace Artemis.ViewModels.Profiles
/// </summary> /// </summary>
public void UpdateKeyboardPreview() 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) if (SelectedProfile == null || _deviceManager.ActiveKeyboard == null)
{ {
KeyboardPreview = new DrawingImage(); KeyboardPreview = new DrawingImage();

View File

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