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

154 lines
7 KiB
XML

<UserControl
x:Class="Ryujinx.Ava.UI.Views.User.UserSelectorViews"
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:models="clr-namespace:Ryujinx.Ava.UI.Models"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"
MinWidth="500"
Focusable="True"
x:DataType="viewModels:UserProfileViewModel">
<Design.DataContext>
<viewModels:UserProfileViewModel />
</Design.DataContext>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RowDefinitions="*,Auto">
<Border Padding="-3" BorderThickness="0">
<ListBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="Transparent"
ItemsSource="{Binding Profiles}"
SelectionChanged="ProfilesList_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="Margin" Value="0" />
<Setter Property="CornerRadius" Value="5" />
</Style>
<Style Selector="Rectangle#SelectionIndicator">
<Setter Property="Opacity" Value="0" />
</Style>
</ListBox.Styles>
<ListBox.DataTemplates>
<DataTemplate
DataType="models:UserProfile">
<Grid
PointerEntered="Grid_PointerEntered"
PointerExited="Grid_OnPointerExited">
<Border
Margin="5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ClipToBounds="True"
CornerRadius="5"
Background="{Binding BackgroundColor}">
<StackPanel
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Image
Width="96"
Height="96"
Margin="0,0,0,10"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Source="{Binding Image, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
<TextBlock
Text="{Binding Name}"
Height="30"
MaxWidth="90"
TextAlignment="Center"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap"
MaxLines="2" />
</StackPanel>
</Border>
<Border
Margin="2"
Height="24"
Width="24"
CornerRadius="12"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="{DynamicResource ThemeContentBackgroundColor}"
IsVisible="{Binding IsPointerOver}">
<Button
MinHeight="24"
MinWidth="24"
MaxHeight="24"
MaxWidth="24"
CornerRadius="12"
Padding="0"
Click="EditUser">
<ui:SymbolIcon Symbol="Edit" />
</Button>
</Border>
</Grid>
</DataTemplate>
<DataTemplate
DataType="viewModels:BaseModel">
<Panel
Height="146"
Width="106">
<Button
MinWidth="50"
MinHeight="50"
MaxWidth="50"
MaxHeight="50"
CornerRadius="25"
Margin="10"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Click="AddUser">
<ui:SymbolIcon Symbol="Add" />
</Button>
</Panel>
</DataTemplate>
</ListBox.DataTemplates>
</ListBox>
</Border>
<StackPanel
Grid.Row="1"
Margin="0,30,0,0"
HorizontalAlignment="Left"
Orientation="Horizontal"
Spacing="10">
<Button
Click="ManageSaves">
<TextBlock Text="{ext:Locale UserProfiles_ManageSaves}" />
</Button>
<Button
Click="RecoverLostAccounts">
<TextBlock
Text="{ext:Locale UserProfiles_RecoverLostProfiles}"
ToolTip.Tip="{ext:Locale UserProfiles_RecoverLostProfiles_ToolTip}" />
</Button>
</StackPanel>
<StackPanel
Grid.Row="1"
Margin="0,30,0,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Click="Close">
<TextBlock Text="{ext:Locale UserProfiles_ButtonClose}" />
</Button>
</StackPanel>
</Grid>
</UserControl>