Some fixes

Alignment, sizing, and selection indicator
This commit is contained in:
_Neo_ 2026-01-05 17:30:16 +02:00
parent af59454e19
commit 925ae1652b
4 changed files with 30 additions and 39 deletions

View file

@ -17,21 +17,16 @@
<viewModels:ProfileSelectorDialogViewModel />
</Design.DataContext>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RowDefinitions="*,Auto">
<StackPanel>
<Border BorderThickness="0" Padding="-3">
<ListBox
MaxHeight="300"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="-3"
Background="Transparent"
ItemsSource="{Binding Profiles}"
SelectionChanged="ProfilesList_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal" />
<UniformGrid Columns="5" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Styles>
@ -82,6 +77,6 @@
</DataTemplate>
</ListBox.DataTemplates>
</ListBox>
</StackPanel>
</Border>
</Grid>
</UserControl>

View file

@ -46,17 +46,15 @@ namespace Ryujinx.Ava.UI.ViewModels
};
}
private int _selectedIndex = -1;
public int SelectedIndex
{
get;
get => _selectedIndex;
set
{
field = value;
SelectedImage = field == -1
? null
: Images[field].Data;
_selectedIndex = value;
SelectedImage = value == -1 ? null : Images[value].Data;
OnPropertyChanged();
OnPropertyChanged(nameof(SelectedImage));
}

View file

@ -29,22 +29,27 @@
IsReadOnly="True"
Text="{Binding UserIdString}" />
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Right">
<Grid Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Stretch">
<Border
Name="ImageBox"
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
BorderThickness="1">
<Panel>
BorderThickness="1"
VerticalAlignment="Stretch">
<Grid>
<ui:SymbolIcon
FontSize="70"
Width="120"
Height="120"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource AppListHoverBackgroundColor}"
Symbol="Camera" />
<Image
Name="ProfileImage"
Width="120"
Height="120"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Source="{Binding Image, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
<Border
Margin="2"
@ -65,21 +70,19 @@
<ui:SymbolIcon Symbol="Edit" />
<Button.Flyout>
<MenuFlyout Placement="Bottom">
<MenuItem
Header="{ext:Locale UserProfiles_ProfileImage_Import}"
Icon="{ext:Icon fa-solid fa-image}"
Click="Import_OnClick" />
<MenuItem
Header="{ext:Locale UserProfiles_ProfileImage_SelectAvatar}"
Icon="{ext:Icon fa-solid fa-floppy-disk}"
Click="SelectFirmwareImage_OnClick" />
<MenuItem Header="{ext:Locale UserProfiles_ProfileImage_Import}"
Icon="{ext:Icon fa-solid fa-image}"
Click="Import_OnClick" />
<MenuItem Header="{ext:Locale UserProfiles_ProfileImage_SelectAvatar}"
Icon="{ext:Icon fa-solid fa-floppy-disk}"
Click="SelectFirmwareImage_OnClick" />
</MenuFlyout>
</Button.Flyout>
</Button>
</Border>
</Panel>
</Grid>
</Border>
</StackPanel>
</Grid>
<StackPanel
Grid.Row="1"
Grid.ColumnSpan="2"

View file

@ -19,21 +19,16 @@
<viewModels:UserProfileViewModel />
</Design.DataContext>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RowDefinitions="*,Auto">
<StackPanel>
<Border BorderThickness="0" Padding="-3">
<ListBox
MaxHeight="300"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="-3"
SelectionChanged="ProfilesList_SelectionChanged"
Background="Transparent"
ItemsSource="{Binding Profiles}">
ItemsSource="{Binding Profiles}"
SelectionChanged="ProfilesList_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal"/>
<UniformGrid Columns="5" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Styles>
@ -106,7 +101,7 @@
DataType="viewModels:BaseModel">
<Panel
Height="120"
Width="100">
Width="106">
<Button
MinWidth="50"
MinHeight="50"
@ -124,7 +119,7 @@
</DataTemplate>
</ListBox.DataTemplates>
</ListBox>
</StackPanel>
</Border>
<StackPanel
Grid.Row="1"
Margin="0,30,0,0"