112 lines
5.8 KiB
XML
112 lines
5.8 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:loc="using:GC.Services"
|
|
xmlns:controls="using:GC.Controls"
|
|
x:Class="GC.Views.HomeView">
|
|
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
<StackPanel Margin="26,24,26,28" Spacing="18">
|
|
|
|
<!-- 主视觉 -->
|
|
<Border Classes="hero" Padding="26,24">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
|
|
<StackPanel Spacing="9" MaxWidth="560">
|
|
<TextBlock Classes="h1 onDark" Text="{loc:Loc home.title}" />
|
|
<TextBlock Text="{loc:Loc home.subtitle}" Foreground="#A9BEDF" FontSize="12.5"
|
|
TextWrapping="Wrap" MaxWidth="500" />
|
|
<StackPanel Orientation="Horizontal" Spacing="10" Margin="0,12,0,0">
|
|
<Button Classes="primary" Content="{loc:Loc home.launch}" Command="{Binding LaunchCommand}" />
|
|
<Button Classes="onDark" Content="{loc:Loc home.download}" Command="{Binding OpenDownloadCommand}" />
|
|
<Button Classes="onDark" Content="{loc:Loc home.settings}" Command="{Binding OpenSettingsCommand}" />
|
|
</StackPanel>
|
|
<TextBlock Text="{Binding SelectedHint}" Foreground="#7E93B8" FontSize="11" Margin="2,2,0,0" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="10" VerticalAlignment="Center">
|
|
<Border Background="#16233C" CornerRadius="14" Padding="16,12" Width="96">
|
|
<StackPanel Spacing="2">
|
|
<TextBlock Text="{Binding Models.Count}" Foreground="#FFFFFF" FontSize="22" FontWeight="SemiBold" />
|
|
<TextBlock Text="{loc:Loc home.stats.models}" Foreground="#7E93B8" FontSize="10.5" />
|
|
</StackPanel>
|
|
</Border>
|
|
<Border Background="#16233C" CornerRadius="14" Padding="16,12" Width="96">
|
|
<StackPanel Spacing="2">
|
|
<TextBlock Text="{Binding SourceCountText}" Foreground="#FFFFFF" FontSize="22" FontWeight="SemiBold" />
|
|
<TextBlock Text="{loc:Loc home.stats.sources}" Foreground="#7E93B8" FontSize="10.5" />
|
|
</StackPanel>
|
|
</Border>
|
|
<Border Background="#16233C" CornerRadius="14" Padding="16,12" Width="112">
|
|
<StackPanel Spacing="2">
|
|
<TextBlock Text="{Binding MemoryText}" Foreground="#FFFFFF" FontSize="16" FontWeight="SemiBold" />
|
|
<TextBlock Text="{loc:Loc home.stats.memory}" Foreground="#7E93B8" FontSize="10.5" />
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 列表标题 -->
|
|
<Grid ColumnDefinitions="*,Auto" Margin="2,4,2,0">
|
|
<TextBlock Classes="h2" Text="{loc:Loc home.installed}" />
|
|
<TextBlock Grid.Column="1" Classes="muted" Text="{Binding CountText}" VerticalAlignment="Center" />
|
|
</Grid>
|
|
|
|
<!-- 模型卡片 -->
|
|
<ItemsControl ItemsSource="{Binding Models}" IsVisible="{Binding !IsEmpty}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Classes="card" Width="336" Margin="0,0,16,16" ClipToBounds="True">
|
|
<StackPanel>
|
|
<Border Height="138" Background="#0B1226" ClipToBounds="True">
|
|
<Panel>
|
|
<TextBlock Text="◎" FontSize="34" Foreground="#1B2A47"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
<Image Source="{Binding Preview}" Stretch="UniformToFill" />
|
|
</Panel>
|
|
</Border>
|
|
<StackPanel Margin="16,13,16,15" Spacing="7">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<TextBlock Classes="h3" Text="{Binding Name}" TextTrimming="CharacterEllipsis" />
|
|
<TextBlock Grid.Column="1" Classes="faint" Text="{Binding MetaText}"
|
|
VerticalAlignment="Center" Margin="8,0,0,0" />
|
|
</Grid>
|
|
<TextBlock Classes="muted" Text="{Binding Description}" TextWrapping="Wrap"
|
|
MaxLines="2" Height="32" TextTrimming="CharacterEllipsis" />
|
|
<TextBlock Classes="faint" Text="{Binding TagsText}" IsVisible="{Binding HasTags}" />
|
|
<Grid ColumnDefinitions="Auto,*,Auto,Auto" Margin="0,6,0,0">
|
|
<Button Classes="primary small" Content="{loc:Loc home.launch}"
|
|
Command="{Binding LaunchCommand}" />
|
|
<Button Grid.Column="2" Classes="ghost small" Content="{loc:Loc home.open}"
|
|
Command="{Binding OpenFolderCommand}" Margin="0,0,4,0" />
|
|
<Button Grid.Column="3" Classes="ghost small danger" Content="{loc:Loc home.delete}"
|
|
Command="{Binding DeleteCommand}" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<!-- 空状态 -->
|
|
<Border Classes="card" Padding="30,34" IsVisible="{Binding IsEmpty}">
|
|
<StackPanel Spacing="10" HorizontalAlignment="Center">
|
|
<TextBlock Classes="h2" Text="{loc:Loc home.empty}" HorizontalAlignment="Center" />
|
|
<TextBlock Classes="muted" Text="{loc:Loc home.emptyHint}" TextWrapping="Wrap"
|
|
MaxWidth="420" TextAlignment="Center" />
|
|
<Button Classes="primary" Content="{loc:Loc home.emptyAction}"
|
|
Command="{Binding OpenDownloadCommand}" HorizontalAlignment="Center" Margin="0,6,0,0" />
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</UserControl>
|