Skip to content

Commit

Permalink
CycleControllers: Localized "Player X", fixed button vertical padding
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneIsWorking committed Dec 22, 2024
1 parent 6703cba commit b969e37
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
14 changes: 13 additions & 1 deletion src/Ryujinx/UI/ViewModels/CycleController.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Common.Configuration.Hid;

namespace Ryujinx.Ava.UI.ViewModels
Expand Down Expand Up @@ -29,7 +30,18 @@ public Key Hotkey

public CycleController(int v, Key x)
{
Player = $"Player {v}";
Player = v switch
{
1 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer1],
2 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer2],
3 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer3],
4 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer4],
5 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer5],
6 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer6],
7 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer7],
8 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer8],
_ => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer] + " " + v
};
Hotkey = x;
}
}
Expand Down
22 changes: 12 additions & 10 deletions src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<Style Selector="ToggleButton, Button">
<Setter Property="Width" Value="90" />
<Setter Property="Height" Value="27" />
<Setter Property="Padding" Value="0,5,0,5" /> <!-- Added vertical padding -->
</Style>
<Style Selector="ToggleButton > TextBlock">
<Setter Property="TextAlignment" Value="Center" />
Expand Down Expand Up @@ -114,15 +115,16 @@
<TextBlock
Classes="h1"
Text="{ext:Locale SettingsTabHotkeysCycleControllers}" />
<Button
Margin="10,0,0,0"
Content="+"
Command="{Binding KeyboardHotkey.AddCycleController}" />
<Button
Margin="10,0,0,0"
Content="-"
IsEnabled="{Binding KeyboardHotkey.CanRemoveCycleController}"
Command="{Binding KeyboardHotkey.RemoveCycleController}" />
<StackPanel Orientation="Horizontal" Spacing="10">
<Button
Content="{ext:Locale SettingsTabGeneralAdd}"
Margin="10,0,0,0"
Command="{Binding KeyboardHotkey.AddCycleController}" />
<Button
Content="{ext:Locale SettingsTabGeneralRemove}"
IsEnabled="{Binding KeyboardHotkey.CanRemoveCycleController}"
Command="{Binding KeyboardHotkey.RemoveCycleController}" />
</StackPanel>
</StackPanel>
<StackPanel>
<TextBlock Text="{ext:Locale SettingsTabHotkeysIncrementCustomVSyncIntervalHotkey}" />
Expand All @@ -141,7 +143,7 @@
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
Margin="0"
Margin="10,0,0,0"
Orientation="Vertical"
Spacing="10" />
</ItemsPanelTemplate>
Expand Down

0 comments on commit b969e37

Please sign in to comment.