aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Ava/Ui/Controls/UserSelector.axaml
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2022-07-28 19:16:23 +0200
committerGitHub <noreply@github.com>2022-07-28 14:16:23 -0300
commit8cfec5de4bde7087734beb2f7203f0d930e1b2d8 (patch)
tree1305b1e5a345f8e7d9a0f6d464948aa064749c30 /Ryujinx.Ava/Ui/Controls/UserSelector.axaml
parent37b6e081da6acb6d0ecbe34385d4e09b1ffca5b7 (diff)
Avalonia: Cleanup UserEditor a bit (#3492)
This PR cleanup the UserEditor code a bit, 2 texts are added for "Name" and "User Id", because when you create a new profile, the textbox is empty without any hints. `axaml` files are autoformated too.
Diffstat (limited to 'Ryujinx.Ava/Ui/Controls/UserSelector.axaml')
-rw-r--r--Ryujinx.Ava/Ui/Controls/UserSelector.axaml78
1 files changed, 48 insertions, 30 deletions
diff --git a/Ryujinx.Ava/Ui/Controls/UserSelector.axaml b/Ryujinx.Ava/Ui/Controls/UserSelector.axaml
index 3bca7d7d..c06bce23 100644
--- a/Ryujinx.Ava/Ui/Controls/UserSelector.axaml
+++ b/Ryujinx.Ava/Ui/Controls/UserSelector.axaml
@@ -1,29 +1,35 @@
-<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
+ x:Class="Ryujinx.Ava.Ui.Controls.UserSelector"
+ xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale"
+ xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:flex="clr-namespace:Avalonia.Flexbox;assembly=Avalonia.Flexbox"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
+ xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels"
+ d:DesignHeight="450"
+ d:DesignWidth="800"
+ mc:Ignorable="d">
<UserControl.Resources>
<controls:BitmapArrayValueConverter x:Key="ByteImage" />
</UserControl.Resources>
<Design.DataContext>
<viewModels:UserProfileViewModel />
</Design.DataContext>
- <Grid HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
+ <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
+ Margin="5"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Center"
+ DoubleTapped="ProfilesList_DoubleTapped"
+ Items="{Binding Profiles}"
+ SelectionChanged="SelectingItemsControl_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<flex:FlexPanel
@@ -49,10 +55,11 @@
</Grid.RowDefinitions>
<Image
Grid.Row="0"
+ Width="96"
+ Height="96"
Margin="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
- Height="96" Width="96"
Source="{Binding Image, Converter={StaticResource ByteImage}}" />
<StackPanel
Grid.Row="1"
@@ -68,23 +75,34 @@
</StackPanel>
</Grid>
</Border>
- <Border HorizontalAlignment="Left" VerticalAlignment="Top"
- IsVisible="{Binding IsOpened}"
- Background="LimeGreen"
- Width="10"
- Height="10"
- Margin="5"
- CornerRadius="5" />
+ <Border
+ Width="10"
+ Height="10"
+ Margin="5"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Top"
+ Background="LimeGreen"
+ CornerRadius="5"
+ IsVisible="{Binding IsOpened}" />
</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.Row="1"
+ Margin="10,0"
+ HorizontalAlignment="Center"
+ Orientation="Horizontal"
+ Spacing="10">
+ <Button Command="{Binding AddUser}" Content="{Locale:Locale UserProfilesAddNewProfile}" />
+ <Button
+ Command="{Binding EditUser}"
+ Content="{Locale:Locale UserProfilesEditProfile}"
+ IsEnabled="{Binding IsSelectedProfiledEditable}" />
+ <Button
+ Command="{Binding DeleteUser}"
+ Content="{Locale:Locale UserProfilesDeleteSelectedProfile}"
+ IsEnabled="{Binding IsSelectedProfileDeletable}" />
</StackPanel>
</Grid>
</UserControl> \ No newline at end of file