Mesen2/UI/Views/GbaControllerView.axaml
Sour d208fdc6a7 UI: Support for NativeAOT
Added Windows & Linux builds using AOT compilation
2024-06-05 20:23:31 +09:00

74 lines
4.1 KiB
XML

<UserControl
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:Mesen.ViewModels"
xmlns:l="using:Mesen.Localization"
xmlns:c="using:Mesen.Controls"
xmlns:cfg="using:Mesen.Config"
mc:Ignorable="d" d:DesignWidth="610" d:DesignHeight="280"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
x:Name="root"
x:DataType="vm:KeyMappingViewModel"
x:Class="Mesen.Views.GbaControllerView"
>
<Design.DataContext>
<vm:KeyMappingViewModel />
</Design.DataContext>
<Border BorderBrush="{StaticResource MesenGrayBorderColor}" BorderThickness="2" Padding="3" Width="610" Height="280" HorizontalAlignment="Left" VerticalAlignment="Top">
<Canvas>
<Grid ColumnDefinitions="Auto,Auto,*,Auto,Auto" RowDefinitions="Auto,Auto" Width="580" Canvas.Left="10">
<c:KeyBindingButton Grid.Column="0" Width="120" KeyBinding="{Binding Mapping.L}" />
<TextBlock Grid.Column="0" Grid.Row="1" Text="L" FontSize="18 " HorizontalAlignment="Center" />
<c:KeyBindingButton Grid.Column="1" Width="70" KeyBinding="{Binding Mapping.TurboL}" />
<TextBlock Grid.Column="1" Grid.Row="1" Text="Turbo L" FontSize="14" HorizontalAlignment="Center" />
<c:KeyBindingButton Grid.Column="3" Width="120" KeyBinding="{Binding Mapping.R}" />
<TextBlock Grid.Column="3" Grid.Row="1" Text="R" FontSize="18" HorizontalAlignment="Center" />
<c:KeyBindingButton Grid.Column="4" Width="70" KeyBinding="{Binding Mapping.TurboR}" />
<TextBlock Grid.Column="4" Grid.Row="1" Text="Turbo R" FontSize="14" HorizontalAlignment="Center" />
</Grid>
<Panel Canvas.Top="60" >
<Ellipse Width="200" Height="200" Stroke="{StaticResource MesenGrayBorderColor}" StrokeThickness="2" />
<Grid ColumnDefinitions="*,*" RowDefinitions="*,*,*" Width="200" Height="200">
<c:KeyBindingButton KeyBinding="{Binding Mapping.Up}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Width="80" Height="40" HorizontalAlignment="Center" />
<c:KeyBindingButton KeyBinding="{Binding Mapping.Left}" Grid.Row="1" Grid.Column="0" Width="80" Height="40" HorizontalAlignment="Center" />
<c:KeyBindingButton KeyBinding="{Binding Mapping.Right}" Grid.Row="1" Grid.Column="1" Width="80" Height="40" HorizontalAlignment="Center" />
<c:KeyBindingButton KeyBinding="{Binding Mapping.Down}" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Width="80" Height="40" HorizontalAlignment="Center" />
</Grid>
</Panel>
<Panel Canvas.Top="60" Canvas.Right="5">
<Rectangle Width="200" Height="110" Fill="{StaticResource MesenGrayBackgroundColor}" />
<StackPanel Orientation="Horizontal" Width="195" Height="220">
<StackPanel VerticalAlignment="Center" Margin="10 0 0 0">
<TextBlock Text="B" FontSize="18" HorizontalAlignment="Center" Margin="0 0 0 0" />
<c:KeyBindingButton KeyBinding="{Binding Mapping.B}" Width="60" Height="40" />
<c:KeyBindingButton KeyBinding="{Binding Mapping.TurboB}" Width="60" Height="20" />
<TextBlock Text="Turbo B" FontSize="14" HorizontalAlignment="Center" />
</StackPanel>
<StackPanel VerticalAlignment="Center" Margin="55 0 0 0">
<TextBlock Text="A" FontSize="18" HorizontalAlignment="Center" Margin="0 0 0 0" />
<c:KeyBindingButton KeyBinding="{Binding Mapping.A}" Width="60" Height="40" />
<c:KeyBindingButton KeyBinding="{Binding Mapping.TurboA}" Width="60" Height="20" />
<TextBlock Text="Turbo A" FontSize="14" HorizontalAlignment="Center" />
</StackPanel>
</StackPanel>
</Panel>
<Grid ColumnDefinitions="*,Auto,Auto,*" RowDefinitions="Auto,Auto" Width="580" Canvas.Bottom="30">
<c:KeyBindingButton KeyBinding="{Binding Mapping.Select}" Grid.Column="1" Width="80" />
<TextBlock Grid.Column="1" Grid.Row="1" Text="Select" FontSize="14" HorizontalAlignment="Center" />
<c:KeyBindingButton KeyBinding="{Binding Mapping.Start}" Grid.Column="2" Width="80" />
<TextBlock Grid.Column="2" Grid.Row="1" Text="Start" FontSize="14" HorizontalAlignment="Center" />
</Grid>
</Canvas>
</Border>
</UserControl>