diff options
| author | Emmanuel Hansen <emmausssss@gmail.com> | 2022-07-24 17:38:38 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-24 14:38:38 -0300 |
| commit | 6e02cac952f1a9a34d2777199dde657eba0784e6 (patch) | |
| tree | bfdf6ebc5c5fb062910ffb2feaec56e1240c0596 /Ryujinx.Ava/Ui/Controls/UserSelector.axaml | |
| parent | 3a3380fa2578bf1731c6cd7cebdca7b7cc5681b0 (diff) | |
Avalonia - Use content dialog for user profile manager (#3455)
* remove content dialog placeholder from all windows
* remove redundant window argument
* redesign user profile window
* wip
* use avalonia auto name generator
* add edit and new user options
* move profile image selection to content dialog
* remove usings
* fix updater
* address review
* adjust avatar dialog size
* add validation for user editor
* fix typo
* Shorten some labels
Diffstat (limited to 'Ryujinx.Ava/Ui/Controls/UserSelector.axaml')
| -rw-r--r-- | Ryujinx.Ava/Ui/Controls/UserSelector.axaml | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/Ryujinx.Ava/Ui/Controls/UserSelector.axaml b/Ryujinx.Ava/Ui/Controls/UserSelector.axaml new file mode 100644 index 00000000..3bca7d7d --- /dev/null +++ b/Ryujinx.Ava/Ui/Controls/UserSelector.axaml @@ -0,0 +1,90 @@ +<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:flex="clr-namespace:Avalonia.Flexbox;assembly=Avalonia.Flexbox" + xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels" + xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls" + xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + x:Class="Ryujinx.Ava.Ui.Controls.UserSelector"> + <UserControl.Resources> + <controls:BitmapArrayValueConverter x:Key="ByteImage" /> + </UserControl.Resources> + <Design.DataContext> + <viewModels:UserProfileViewModel /> + </Design.DataContext> + <Grid HorizontalAlignment="Stretch" + VerticalAlignment="Stretch"> + <Grid.RowDefinitions> + <RowDefinition /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <ListBox HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="5" Items="{Binding Profiles}" + DoubleTapped="ProfilesList_DoubleTapped" + SelectionChanged="SelectingItemsControl_SelectionChanged"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <flex:FlexPanel + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + AlignContent="FlexStart" + JustifyContent="Center" /> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid> + <Border + Margin="2" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + ClipToBounds="True" + CornerRadius="5"> + <Grid Margin="0"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Image + Grid.Row="0" + Margin="0" + HorizontalAlignment="Stretch" + VerticalAlignment="Top" + Height="96" Width="96" + Source="{Binding Image, Converter={StaticResource ByteImage}}" /> + <StackPanel + Grid.Row="1" + Height="30" + Margin="5" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch"> + <TextBlock + HorizontalAlignment="Stretch" + Text="{Binding Name}" + TextAlignment="Center" + TextWrapping="Wrap" /> + </StackPanel> + </Grid> + </Border> + <Border HorizontalAlignment="Left" VerticalAlignment="Top" + IsVisible="{Binding IsOpened}" + Background="LimeGreen" + Width="10" + Height="10" + Margin="5" + CornerRadius="5" /> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0" Spacing="10" HorizontalAlignment="Center"> + <Button Content="{Locale:Locale UserProfilesAddNewProfile}" Command="{Binding AddUser}" /> + <Button IsEnabled="{Binding IsSelectedProfiledEditable}" + Content="{Locale:Locale UserProfilesEditProfile}" Command="{Binding EditUser}" /> + <Button IsEnabled="{Binding IsSelectedProfileDeletable}" + Content="{Locale:Locale UserProfilesDeleteSelectedProfile}" Command="{Binding DeleteUser}" /> + </StackPanel> + </Grid> +</UserControl>
\ No newline at end of file |
