Skip to content

Commit

Permalink
optimize Timer Layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Apr 6, 2024
1 parent 2863e75 commit b06e669
Show file tree
Hide file tree
Showing 3 changed files with 210 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
<xctk:ColorPicker SelectedColor="{Binding Properties._SecondaryColor, Converter={StaticResource DrawingToMediaColorConv}}" ColorMode="ColorCanvas" UsingAlphaChannel="True" Grid.Row="1" Grid.Column="1" Margin="4,2" />

<Label Content="Duration (ms):" Grid.Row="2" HorizontalAlignment="Right" />
<xctk:IntegerUpDown Value="{Binding Properties._Duration}" Grid.Row="2" Grid.Column="1" Margin="4,2" />
<xctk:IntegerUpDown Value="{Binding Properties.Duration}" Grid.Row="2" Grid.Column="1" Margin="4,2" />

<Label Content="Animation type:" Grid.Row="3" HorizontalAlignment="Right" />
<ComboBox SelectedValue="{Binding Properties._AnimationType}" ItemsSource="{utils:EnumToItemsSource {x:Type layers:TimerLayerAnimationType}}" DisplayMemberPath="Text" SelectedValuePath="Value" Grid.Row="3" Grid.Column="1" Margin="4,2" />
<ComboBox SelectedValue="{Binding Properties.AnimationType}" ItemsSource="{utils:EnumToItemsSource {x:Type layers:TimerLayerAnimationType}}" DisplayMemberPath="Text" SelectedValuePath="Value" Grid.Row="3" Grid.Column="1" Margin="4,2" />

<Label Content="Repeat action:" Grid.Row="4" HorizontalAlignment="Right" />
<ComboBox SelectedValue="{Binding Properties._RepeatAction}" ItemsSource="{utils:EnumToItemsSource {x:Type layers:TimerLayerRepeatPressAction}}" DisplayMemberPath="Text" SelectedValuePath="Value" Grid.Row="4" Grid.Column="1" Margin="4,2" />
<ComboBox SelectedValue="{Binding Properties.RepeatAction}" ItemsSource="{utils:EnumToItemsSource {x:Type layers:TimerLayerRepeatPressAction}}" DisplayMemberPath="Text" SelectedValuePath="Value" Grid.Row="4" Grid.Column="1" Margin="4,2" />

<Label Content="Trigger Keys:" Grid.Row="5" HorizontalAlignment="Right" />
<controls:KeyBindList x:Name="triggerKeyList" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Margin="4,2" KeybindsChanged="triggerKeyList_KeybindsChanged" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
using System.Windows.Controls;
using AuroraRgb.Controls;
using AuroraRgb.Controls;

namespace AuroraRgb.Settings.Layers.Controls {
namespace AuroraRgb.Settings.Layers.Controls;

public partial class Control_TimerLayer : UserControl {
public partial class Control_TimerLayer
{
public Control_TimerLayer(TimerLayerHandler context) {
InitializeComponent();
DataContext = context;

public Control_TimerLayer(TimerLayerHandler context) {
InitializeComponent();
DataContext = context;

triggerKeyList.Keybinds = context.Properties._TriggerKeys;
}
triggerKeyList.Keybinds = context.Properties.TriggerKeys;
}

private void triggerKeyList_KeybindsChanged(object? sender) {
if (sender is KeyBindList kbl)
(DataContext as TimerLayerHandler).Properties._TriggerKeys = kbl.Keybinds;
}
private void triggerKeyList_KeybindsChanged(object? sender) {
if (sender is KeyBindList kbl && DataContext is TimerLayerHandler timerLayerHandler)
timerLayerHandler.Properties.TriggerKeys = kbl.Keybinds;
}
}
}
Loading

0 comments on commit b06e669

Please sign in to comment.