Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
5.5 KiB

<controls:UserControlBase 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:dialogs="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Dialogs"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages"
d:DataContext="{x:Static mocks:DesignData.SelectDataDirectoryViewModel}"
x:DataType="dialogs:SelectDataDirectoryViewModel"
x:CompileBindings="True"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="550"
x:Class="StabilityMatrix.Avalonia.Views.Dialogs.SelectDataDirectoryDialog">
<Grid RowDefinitions="Auto,Auto,Auto,*,*"
Margin="16,0,16,16"
MinHeight="450"
MaxWidth="700" >
<StackPanel Orientation="Vertical">
<TextBlock Text="{x:Static lang:Resources.Text_WelcomeToStabilityMatrix}"
TextWrapping="Wrap"
Margin="8,0,8,0"
VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="36" FontWeight="Light" />
<TextBlock Text="{x:Static lang:Resources.Label_PleaseSelectDataDirectory}"
TextWrapping="Wrap"
Margin="8,4,8,0"
VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="20" FontWeight="Light" />
<TextBlock
Text="{x:Static lang:Resources.Label_DataDirectoryExplanation}"
TextWrapping="Wrap"
Foreground="LightGray"
FontSize="14"
FontWeight="Light"
TextAlignment="Center"
Margin="0,8,0,0" />
</StackPanel>
<StackPanel Grid.Row="1" Margin="0,0,0,16">
<Label
Content="{x:Static lang:Resources.Label_DataDirectory}"
FontSize="13"
Margin="0,16,0,0" />
<Grid ColumnDefinitions="*,Auto">
<TextBox
Height="36"
IsEnabled="{Binding !IsPortableMode}"
Margin="0,0,8,0"
Watermark="{Binding DefaultInstallLocation}"
Text="{Binding DataDirectory}"
VerticalAlignment="Stretch" />
<Button
Command="{Binding ShowFolderBrowserDialogCommand}"
Grid.Column="1"
Height="36"
HorizontalAlignment="Stretch"
IsEnabled="{Binding !IsPortableMode}">
<ui:SymbolIcon Symbol="OpenFolder" />
</Button>
</Grid>
<TextBlock
Text="{x:Static lang:Resources.Label_FatWarning}"
TextWrapping="Wrap"
Foreground="Yellow"
IsVisible="{Binding ShowFatWarning}"
FontSize="14"
Margin="0,8,0,0" />
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Vertical">
<CheckBox
Content="{x:Static lang:Resources.Label_PortableMode}"
IsChecked="{Binding IsPortableMode, Mode=TwoWay}"
Margin="0,8,0,0" />
<ui:InfoBar
IsClosable="False"
IsOpen="True"
FontSize="13"
Margin="0,8,0,0"
Padding="16"
Title="{x:Static lang:Resources.Label_PortableModeExplanation}" />
</StackPanel>
<!-- Indicator of existing or new data directory -->
<StackPanel
Grid.Row="3"
HorizontalAlignment="Center"
Margin="8,0,8,0"
Orientation="Horizontal"
IsVisible="{Binding IsStatusBadgeVisible}">
<controls:RefreshBadge DataContext="{Binding ValidatorRefreshBadge}" />
<TextBlock
FontSize="14"
Text="{Binding DirectoryStatusText}"
VerticalAlignment="Center" />
</StackPanel>
<UniformGrid Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Bottom"
Margin="0,8,0,0">
<Button
Content="{x:Static lang:Resources.Action_Cancel}"
IsDefault="True"
Command="{Binding OnCloseButtonClick}"
FontSize="16"
HorizontalAlignment="Center"
IsEnabled="{Binding IsDirectoryValid}"
Padding="16,8" />
<Button
Content="{x:Static lang:Resources.Action_Continue}"
IsDefault="True"
Command="{Binding OnPrimaryButtonClick}"
FontSize="16"
Classes="success"
HorizontalAlignment="Center"
IsEnabled="{Binding IsDirectoryValid}"
Padding="16,8" />
</UniformGrid>
</Grid>
</controls:UserControlBase>