Fix LedInputView

This commit is contained in:
KeatonTheBot
2026-02-06 18:54:35 -06:00
parent 4072ae423b
commit 706daddece
2 changed files with 8 additions and 14 deletions

View File

@@ -47,18 +47,13 @@
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" IsEnabled="{Binding ShowLedColorPicker}"> <StackPanel Orientation="Horizontal" IsEnabled="{Binding ShowLedColorPicker}">
<TextBlock MinWidth="75" MaxWidth="200" Text="{ext:Locale ControllerSettingsLedColor}" /> <TextBlock MinWidth="75" MaxWidth="200" Text="{ext:Locale ControllerSettingsLedColor}" />
<ui:ColorPickerButton <ColorPicker
Margin="5" Margin="5"
IsMoreButtonVisible="False"
UseColorPalette="False"
UseColorTriangle="False"
UseColorWheel="False"
ShowAcceptDismissButtons="False"
IsAlphaEnabled="False" IsAlphaEnabled="False"
AttachedToVisualTree="ColorPickerButton_OnAttachedToVisualTree" AttachedToVisualTree="ColorPicker_OnAttachedToVisualTree"
ColorChanged="ColorPickerButton_OnColorChanged" ColorChanged="ColorPicker_OnColorChanged"
Color="{Binding LedColor, Mode=TwoWay}"> Color="{Binding LedColor, Mode=TwoWay}">
</ui:ColorPickerButton> </ColorPicker>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@@ -1,4 +1,5 @@
using Avalonia; using Avalonia;
using Avalonia.Controls;
using FluentAvalonia.UI.Controls; using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Controls; using Ryujinx.Ava.UI.Controls;
@@ -30,19 +31,17 @@ namespace Ryujinx.UI.Views.Input
InitializeComponent(); InitializeComponent();
} }
private void ColorPickerButton_OnColorChanged(ColorPickerButton sender, ColorButtonColorChangedEventArgs args) private void ColorPicker_OnColorChanged(object sender, ColorChangedEventArgs args)
{ {
if (!args.NewColor.HasValue)
return;
if (!ViewModel.EnableLedChanging) if (!ViewModel.EnableLedChanging)
return; return;
if (ViewModel.TurnOffLed) if (ViewModel.TurnOffLed)
return; return;
ViewModel.ParentModel.SelectedGamepad.SetLed(args.NewColor.Value.ToUInt32()); ViewModel.ParentModel.SelectedGamepad.SetLed(args.NewColor.ToUInt32());
} }
private void ColorPickerButton_OnAttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e) private void ColorPicker_OnAttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e)
{ {
if (!ViewModel.EnableLedChanging) if (!ViewModel.EnableLedChanging)
return; return;