diff options
| author | Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> | 2023-10-21 07:26:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-21 13:26:51 +0200 |
| commit | 49b37550cae6b3c69f59a9c7a44b17e3c12a813b (patch) | |
| tree | 0cc8e6a3bfd65a876270b682effdb8f9505ff929 /src/Ryujinx.Ava/UI/Views/Input/InputView.axaml | |
| parent | a42f0bbb87b890d4f16b1148f9398210a5bfedfa (diff) | |
Ava UI: Input Menu Refactor (#4998)
* So much boilerplate
* Slow and steady
* Restructure + Ack suggestions
* Restructure + Ack suggestions
* Restructure
* Clean
* Propogate those fields i forgot about
* It builds
* Progress
* Almost there
* Fix stupid mistake
* Fix more stupid mistakes
* Actually fix fuck ups
* Start localising
* r/therestofthefuckingowl
* Localise ButtonKeyAssigner
* Are you feeling it now mr krabs
* We’re done at last
* Crimes against code
* Try me in the Hague
* Please be quiet
* Crimes are here to stay
* Dispose stuff
* Cleanup a couple things
* Visual fixes and improvements
One weird bug
* Fix rebase errors
* Fixes
* Ack Suggestions
Remaining ack suggestions
Update src/Ryujinx.Ava/UI/Models/Input/ControllerInputConfig.cs
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Update src/Ryujinx.Ava/UI/Models/Input/ControllerInputConfig.cs
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Formatting and error
More Ava 11-ness
Whoops
* Code style fixes
* Style fixes
* Analyzer fix
* Remove all ReflectionBindings
* Remove ambigious object
* Remove redundant property
* Old man yells at formatter
* r e a d o n l y
* Fix profiles
* Use new Sliders
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Ava/UI/Views/Input/InputView.axaml')
| -rw-r--r-- | src/Ryujinx.Ava/UI/Views/Input/InputView.axaml | 225 |
1 files changed, 225 insertions, 0 deletions
diff --git a/src/Ryujinx.Ava/UI/Views/Input/InputView.axaml b/src/Ryujinx.Ava/UI/Views/Input/InputView.axaml new file mode 100644 index 00000000..b4940941 --- /dev/null +++ b/src/Ryujinx.Ava/UI/Views/Input/InputView.axaml @@ -0,0 +1,225 @@ +<UserControl + xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" + xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models" + xmlns:views="clr-namespace:Ryujinx.Ava.UI.Views.Input" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + d:DesignHeight="800" + d:DesignWidth="800" + x:Class="Ryujinx.Ava.UI.Views.Input.InputView" + x:DataType="viewModels:InputViewModel" + x:CompileBindings="True" + mc:Ignorable="d" + Focusable="True"> + <Design.DataContext> + <viewModels:InputViewModel /> + </Design.DataContext> + <UserControl.Styles> + <Style Selector="ToggleButton"> + <Setter Property="Width" Value="90" /> + <Setter Property="Height" Value="27" /> + <Setter Property="HorizontalAlignment" Value="Stretch" /> + </Style> + </UserControl.Styles> + <StackPanel + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Orientation="Vertical"> + <StackPanel + Margin="0 0 0 5" + Orientation="Vertical" + Spacing="5"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="10" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <!-- Player Selection --> + <Grid + Grid.Column="0" + Margin="2" + HorizontalAlignment="Stretch" + VerticalAlignment="Center"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <TextBlock + Margin="5,0,10,0" + Width="90" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Text="{locale:Locale ControllerSettingsPlayer}" /> + <ComboBox + Grid.Column="1" + Name="PlayerIndexBox" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + SelectionChanged="PlayerIndexBox_OnSelectionChanged" + ItemsSource="{Binding PlayerIndexes}" + SelectedIndex="{Binding PlayerId}"> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock Text="{Binding Name}" /> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + </Grid> + <!-- Profile Selection --> + <Grid + Grid.Column="2" + Margin="2" + HorizontalAlignment="Stretch" + VerticalAlignment="Center"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + <TextBlock + Margin="5,0,10,0" + Width="90" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Text="{locale:Locale ControllerSettingsProfile}" /> + <ui:FAComboBox + Grid.Column="1" + IsEditable="True" + Name="ProfileBox" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + SelectedIndex="0" + ItemsSource="{Binding ProfilesList}" + Text="{Binding ProfileName, Mode=TwoWay}" /> + <Button + Grid.Column="2" + MinWidth="0" + Margin="5,0,0,0" + VerticalAlignment="Center" + ToolTip.Tip="{locale:Locale ControllerSettingsLoadProfileToolTip}" + Command="{Binding LoadProfile}"> + <ui:SymbolIcon + Symbol="Upload" + FontSize="15" + Height="20" /> + </Button> + <Button + Grid.Column="3" + MinWidth="0" + Margin="5,0,0,0" + VerticalAlignment="Center" + ToolTip.Tip="{locale:Locale ControllerSettingsSaveProfileToolTip}" + Command="{Binding SaveProfile}"> + <ui:SymbolIcon + Symbol="Save" + FontSize="15" + Height="20" /> + </Button> + <Button + Grid.Column="4" + MinWidth="0" + Margin="5,0,0,0" + VerticalAlignment="Center" + ToolTip.Tip="{locale:Locale ControllerSettingsRemoveProfileToolTip}" + Command="{Binding RemoveProfile}"> + <ui:SymbolIcon + Symbol="Delete" + FontSize="15" + Height="20" /> + </Button> + </Grid> + </Grid> + <Separator /> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="10" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <!-- Input Device --> + <Grid + Grid.Column="0" + Margin="2" + HorizontalAlignment="Stretch"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <TextBlock + Grid.Column="0" + Margin="5,0,10,0" + Width="90" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Text="{locale:Locale ControllerSettingsInputDevice}" /> + <ComboBox + Grid.Column="1" + Name="DeviceBox" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + ItemsSource="{Binding DeviceList}" + SelectedIndex="{Binding Device}" /> + <Button + Grid.Column="2" + MinWidth="0" + Margin="5,0,0,0" + VerticalAlignment="Center" + Command="{Binding LoadDevices}"> + <ui:SymbolIcon + Symbol="Refresh" + FontSize="15" + Height="20"/> + </Button> + </Grid> + <!-- Controller Type --> + <Grid + Grid.Column="2" + Margin="2" + HorizontalAlignment="Stretch" + VerticalAlignment="Center"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <TextBlock + Margin="5,0,10,0" + Width="90" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Text="{locale:Locale ControllerSettingsControllerType}" /> + <ComboBox + Grid.Column="1" + HorizontalAlignment="Stretch" + ItemsSource="{Binding Controllers}" + SelectedIndex="{Binding Controller}"> + <ComboBox.ItemTemplate> + <DataTemplate DataType="models:ControllerModel"> + <TextBlock Text="{Binding Name}" /> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + </Grid> + </Grid> + </StackPanel> + <ContentControl Content="{Binding ConfigViewModel}" IsVisible="{Binding ShowSettings}"> + <ContentControl.DataTemplates> + <DataTemplate DataType="viewModels:ControllerInputViewModel"> + <views:ControllerInputView /> + </DataTemplate> + <DataTemplate DataType="viewModels:KeyboardInputViewModel"> + <views:KeyboardInputView /> + </DataTemplate> + </ContentControl.DataTemplates> + </ContentControl> + </StackPanel> +</UserControl> |
