clean_ryujinx/src/Ryujinx/UI/Views/User/UserEditorView.axaml
2025-12-29 12:36:37 +02:00

108 lines
4.6 KiB
XML

<UserControl
x:Class="Ryujinx.Ava.UI.Views.User.UserEditorView"
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"
MinWidth="500"
mc:Ignorable="d"
Focusable="True"
x:DataType="models:TempProfile">
<Grid Margin="0,10,0,0" ColumnDefinitions="Auto,*" RowDefinitions="*,Auto">
<StackPanel Spacing="10">
<TextBlock Text="{ext:Locale UserProfilesName}" />
<TextBox
Name="NameBox"
Margin="0,0,0,5"
Width="300"
MaxLength="{Binding MaxProfileNameLength}"
Watermark="{ext:Locale ProfileNameSelectionWatermark}"
Text="{Binding Name}" />
<TextBlock Name="IdText" Text="{ext:Locale UserProfilesUserId}" />
<TextBox
Name="IdLabel"
Width="300"
IsReadOnly="True"
Text="{Binding UserIdString}" />
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Right">
<Border
Name="ImageBox"
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
BorderThickness="1">
<Panel>
<ui:SymbolIcon
FontSize="70"
Width="120"
Height="120"
Foreground="{DynamicResource AppListHoverBackgroundColor}"
Symbol="Camera" />
<Image
Name="ProfileImage"
Width="120"
Height="120"
Source="{Binding Image, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
<Border
Margin="2"
Height="27"
Width="27"
CornerRadius="17"
VerticalAlignment="Top"
HorizontalAlignment="Right"
Background="{DynamicResource ThemeContentBackgroundColor}">
<Button
Name="ProfileImageButton"
MaxHeight="27"
MaxWidth="27"
MinWidth="27"
MinHeight="27"
CornerRadius="17"
Padding="0">
<ui:SymbolIcon Symbol="Edit" />
<Button.Flyout>
<MenuFlyout Placement="Bottom">
<MenuItem
Header="{ext:Locale ProfileImageSelectionImportImage}"
Icon="{ext:Icon fa-solid fa-image}"
Click="Import_OnClick" />
<MenuItem
Header="{ext:Locale ProfileImageSelectionSelectAvatar}"
Icon="{ext:Icon fa-solid fa-floppy-disk}"
Click="SelectFirmwareImage_OnClick" />
</MenuFlyout>
</Button.Flyout>
</Button>
</Border>
</Panel>
</Border>
</StackPanel>
<StackPanel
Grid.Row="1"
Grid.ColumnSpan="2"
Orientation="Horizontal"
Margin="0,30,0,0"
Spacing="10">
<Button MinWidth="50" Width="50" Click="BackButton_Click">
<ui:SymbolIcon Symbol="Back" />
</Button>
</StackPanel>
<StackPanel
Grid.Row="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Right"
Orientation="Horizontal"
Margin="0,30,0,0"
Spacing="10">
<Button Name="DeleteButton" Click="DeleteButton_Click">
<TextBlock Text="{ext:Locale UserProfilesDelete}" />
</Button>
<Button Name="SaveButton" Click="SaveButton_Click">
<TextBlock Text="{ext:Locale Save}" />
</Button>
</StackPanel>
</Grid>
</UserControl>