Files
ryujinx/src/Ryujinx/UI/Views/User/UserFirmwareAvatarSelectorView.axaml
_Neo_ 5d0fc6d456 Minor cleanup
Going over changed files and adjusting structure and looks
2026-01-17 17:21:37 +02:00

113 lines
4.6 KiB
XML

<UserControl
x:Class="Ryujinx.Ava.UI.Views.User.UserFirmwareAvatarSelectorView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
d:DesignHeight="350"
d:DesignWidth="578"
mc:Ignorable="d"
Width="528"
Focusable="True"
x:DataType="viewModels:UserFirmwareAvatarSelectorViewModel">
<Design.DataContext>
<viewModels:UserFirmwareAvatarSelectorViewModel />
</Design.DataContext>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RowDefinitions="Auto,*,Auto,Auto">
<Border
Grid.Row="1"
Padding="2.5"
BorderThickness="1"
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
CornerRadius="5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<ListBox
Grid.Row="1"
Background="Transparent"
SelectedIndex="{Binding SelectedIndex}"
Height="400"
ItemsSource="{Binding Images}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel
Orientation="Horizontal"
Margin="0"
HorizontalAlignment="Center" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="CornerRadius" Value="4" />
<Setter Property="Width" Value="85" />
<Setter Property="MaxWidth" Value="85" />
<Setter Property="MinWidth" Value="85" />
</Style>
<Style Selector="ListBoxItem /template/ Rectangle#SelectionIndicator">
<Setter Property="MinHeight" Value="70" />
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="ListBoxItem:selected /template/ Rectangle#SelectionIndicator">
<Setter Property="IsVisible" Value="True" />
</Style>
</ListBox.Styles>
<ListBox.ItemTemplate>
<DataTemplate>
<Panel
Background="{Binding BackgroundColor}"
Margin="5">
<Image Source="{Binding Data, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
</Panel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
<StackPanel
Grid.Row="3"
Orientation="Horizontal"
Spacing="10"
Margin="0,30,0,0"
HorizontalAlignment="Left">
<Button
Width="50"
MinWidth="50"
Height="37"
Click="GoBack">
<ui:SymbolIcon Symbol="Back" />
</Button>
</StackPanel>
<StackPanel
Grid.Row="3"
Orientation="Horizontal"
Spacing="10"
Margin="0,30,0,0"
HorizontalAlignment="Right">
<ui:ColorPickerButton
FlyoutPlacement="Top"
IsMoreButtonVisible="False"
UseColorPalette="False"
UseColorTriangle="False"
UseColorWheel="False"
ShowAcceptDismissButtons="False"
IsAlphaEnabled="False"
Color="{Binding BackgroundColor, Mode=TwoWay}"
Name="ColorButton">
<ui:ColorPickerButton.Styles>
<Style Selector="Grid#Root > DockPanel > Grid">
<Setter Property="IsVisible" Value="False" />
</Style>
</ui:ColorPickerButton.Styles>
</ui:ColorPickerButton>
<Button
Height="37"
Click="ChooseButton_OnClick">
<TextBlock Text="{ext:Locale UserProfiles_ButtonChooseAvatar}" />
</Button>
</StackPanel>
</Grid>
</UserControl>