aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx/UI/Views/User/UserFirmwareAvatarSelectorView.axaml
blob: 21dfc90990444ea998e5486d5c9c222a941a1cab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<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:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Width="528"
    d:DesignWidth="578"
    d:DesignHeight="350"
    x:Class="Ryujinx.Ava.UI.Views.User.UserFirmwareAvatarSelectorView"
    xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
    xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
    xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
    x:DataType="viewModels:UserFirmwareAvatarSelectorViewModel"
    Focusable="True">
    <Design.DataContext>
        <viewModels:UserFirmwareAvatarSelectorViewModel />
    </Design.DataContext>
	<UserControl.Resources>
		<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
	</UserControl.Resources>
    <Grid
        Margin="0"
        HorizontalAlignment="Stretch"
        VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ListBox
            Grid.Row="1"
            BorderThickness="0"
            SelectedIndex="{Binding SelectedIndex}"
            Height="400"
            ItemsSource="{Binding Images}"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Center">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel
                        Orientation="Horizontal"
                        Margin="0"
                        HorizontalAlignment="Center" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.Styles>
                <Style Selector="ListBoxItem">
                    <Setter Property="CornerRadius" Value="4" />
                    <Setter Property="Width" Value="85" />
                    <Setter Property="MaxWidth" Value="85" />
                    <Setter Property="MinWidth" Value="85" />
                </Style>
                <Style Selector="ListBoxItem /template/ Rectangle#SelectionIndicator">
                    <Setter Property="MinHeight" Value="70" />
                </Style>
            </ListBox.Styles>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Panel
                        Background="{Binding BackgroundColor}"
                        Margin="5">
                        <Image Source="{Binding Data, Converter={StaticResource ByteImage}}" />
                    </Panel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <StackPanel
            Grid.Row="3"
            Orientation="Horizontal"
            Spacing="10"
            Margin="0 24 0 0"
            HorizontalAlignment="Left">
            <Button
                Width="50"
                MinWidth="50"
                Height="35"
                Click="GoBack">
                <ui:SymbolIcon Symbol="Back" />
            </Button>
        </StackPanel>
        <StackPanel
            Grid.Row="3"
            Orientation="Horizontal"
            Spacing="10"
            Margin="0 24 0 0"
            HorizontalAlignment="Right">
            <ui:ColorPickerButton
                FlyoutPlacement="Top"
                IsMoreButtonVisible="False"
                UseColorPalette="False"
                UseColorTriangle="False"
                UseColorWheel="False"
                ShowAcceptDismissButtons="False"
                IsAlphaEnabled="False"
                Color="{Binding BackgroundColor, Mode=TwoWay}"
                Name="ColorButton">
                <ui:ColorPickerButton.Styles>
                    <Style Selector="Grid#Root > DockPanel > Grid">
                        <Setter Property="IsVisible" Value="False" />
                    </Style>
                </ui:ColorPickerButton.Styles>
            </ui:ColorPickerButton>
            <Button
                Content="{locale:Locale AvatarChoose}"
                Height="35"
                Name="ChooseButton"
                Click="ChooseButton_OnClick" />
        </StackPanel>
    </Grid>
</UserControl>