Avalonia - Misc changes to UX (#3643)
* Change navbar from compact to default and force text overflow globally * Fix settings window * Fix right stick control alignment * Initialize value and add logging for SDL IDs * Fix alignment of setting text and improve borders * Clean up padding and size of buttons on controller settings * Fix right side trigger alignment and correct styling * Revert axaml alignment * Fix alignment of volume widget * Fix timezone autocompletebox dropdown height * MainWindow: Line up volume status bar item * Remove margins and add padding to volume widget * Make volume text localizable. Co-authored-by: merry <git@mary.rs>
This commit is contained in:
parent
0cb1e926b5
commit
41790aa743
10 changed files with 133 additions and 86 deletions
|
@ -43,6 +43,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
|||
|
||||
private PlayerIndex _playerId;
|
||||
private int _controller;
|
||||
private int _controllerNumber = 0;
|
||||
private string _controllerImage;
|
||||
private int _device;
|
||||
private object _configuration;
|
||||
|
@ -439,6 +440,14 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
|||
return str;
|
||||
}
|
||||
|
||||
private static string GetShortGamepadId(string str)
|
||||
{
|
||||
const string Hyphen = "-";
|
||||
const int Offset = 1;
|
||||
|
||||
return str.Substring(str.IndexOf(Hyphen) + Offset);
|
||||
}
|
||||
|
||||
public void LoadDevices()
|
||||
{
|
||||
lock (Devices)
|
||||
|
@ -451,9 +460,11 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
|||
{
|
||||
using IGamepad gamepad = _mainWindow.InputManager.KeyboardDriver.GetGamepad(id);
|
||||
|
||||
Logger.Info?.Print(LogClass.Configuration, $"{GetShortGamepadName(gamepad.Name)} has been connected with ID: {gamepad.Id}");
|
||||
|
||||
if (gamepad != null)
|
||||
{
|
||||
Devices.Add((DeviceType.Keyboard, id, $"{GetShortGamepadName(gamepad.Name)} ({id})"));
|
||||
Devices.Add((DeviceType.Keyboard, id, $"{GetShortGamepadName(gamepad.Name)}"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -461,12 +472,21 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
|||
{
|
||||
using IGamepad gamepad = _mainWindow.InputManager.GamepadDriver.GetGamepad(id);
|
||||
|
||||
Logger.Info?.Print(LogClass.Configuration, $"{GetShortGamepadName(gamepad.Name)} has been connected with ID: {gamepad.Id}");
|
||||
|
||||
if (gamepad != null)
|
||||
{
|
||||
Devices.Add((DeviceType.Controller, id, $"{GetShortGamepadName(gamepad.Name)} ({id})"));
|
||||
if (Devices.Any(controller => GetShortGamepadId(controller.Id) == GetShortGamepadId(gamepad.Id)))
|
||||
{
|
||||
_controllerNumber++;
|
||||
}
|
||||
|
||||
Devices.Add((DeviceType.Controller, id, $"{GetShortGamepadName(gamepad.Name)} ({_controllerNumber})"));
|
||||
}
|
||||
}
|
||||
|
||||
_controllerNumber = 0;
|
||||
|
||||
DeviceList.AddRange(Devices.Select(x => x.Name));
|
||||
Device = Math.Min(Device, DeviceList.Count);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue