120 lines
6.4 KiB
XML
120 lines
6.4 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:loc="using:GC.Services"
|
|
x:Class="GC.Views.MainWindow"
|
|
Title="{loc:Loc app.name}"
|
|
Width="1220" Height="800"
|
|
MinWidth="1040" MinHeight="700"
|
|
Background="Transparent"
|
|
TransparencyLevelHint="Transparent"
|
|
SystemDecorations="None"
|
|
WindowStartupLocation="CenterScreen">
|
|
|
|
<!-- 禁用系统标题栏,改用自建标题栏。
|
|
窗口本身透明(四角露出桌面 => 圆角可见),内容 Border 自己不透明并
|
|
用 CornerRadius + ClipToBounds 裁出圆角;AcrylicBlur 会引入系统白色,
|
|
所以这里用纯 Transparent 避免白边。 -->
|
|
<Border CornerRadius="16" ClipToBounds="True"
|
|
Background="{DynamicResource AppBg}"
|
|
BorderBrush="#1B2740" BorderThickness="1"
|
|
BoxShadow="0 18 50 0 #400A1226">
|
|
<Grid RowDefinitions="44,*">
|
|
<!-- 自建标题栏 -->
|
|
<Border x:Name="TitleBar" Grid.Row="0" Background="{DynamicResource TitleBarBg}"
|
|
PointerPressed="OnTitleBarPointerPressed">
|
|
<Grid ColumnDefinitions="*,Auto,Auto,Auto" Margin="16,0,10,0">
|
|
<StackPanel Orientation="Horizontal" Spacing="10" VerticalAlignment="Center">
|
|
<Border Width="22" Height="22" CornerRadius="7" Background="#1C2C4C">
|
|
<TextBlock Text="◎" FontSize="13" Foreground="#8FB6FF"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Border>
|
|
<TextBlock Text="{loc:Loc app.name}" Foreground="#F2F6FF" FontSize="12.5"
|
|
FontWeight="SemiBold" VerticalAlignment="Center" />
|
|
</StackPanel>
|
|
<!-- 与模型窗口一致的纯矢量图标:无圆圈 -->
|
|
<Button x:Name="MinimizeButton" Grid.Column="1" Classes="titlebtn"
|
|
Click="OnMinimizeClick">
|
|
<Path Data="M1.5,5 L8.5,5" Stroke="#A9B8D4" StrokeThickness="1.5"
|
|
StrokeLineCap="Round" Stretch="None" Width="10" Height="10"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Button>
|
|
<Button x:Name="MaximizeButton" Grid.Column="2" Classes="titlebtn"
|
|
Click="OnMaximizeClick">
|
|
<Path x:Name="MaximizeGlyph" Data="M2.2,2.2 L7.8,2.2 L7.8,7.8 L2.2,7.8 Z"
|
|
Stroke="#A9B8D4" StrokeThickness="1.5" StrokeLineCap="Round"
|
|
StrokeJoin="Round" Stretch="None" Width="10" Height="10"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Button>
|
|
<Button x:Name="CloseButton" Grid.Column="3" Classes="titlebtn close"
|
|
Click="OnCloseClick">
|
|
<Path Data="M2,2 L8,8 M8,2 L2,8" Stroke="#A9B8D4" StrokeThickness="1.5"
|
|
StrokeLineCap="Round" Stretch="None" Width="10" Height="10"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Button>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 原内容整体下移一行 -->
|
|
<Grid Grid.Row="1" ColumnDefinitions="236,*" RowDefinitions="*,Auto">
|
|
|
|
<!-- 侧栏:品牌已在标题栏展示,这里只留一句副标题,避免重复 -->
|
|
<Border Grid.Column="0" Grid.RowSpan="2" Background="{DynamicResource SideBgBrush}">
|
|
<Grid RowDefinitions="Auto,*,Auto" Margin="16,20,16,18">
|
|
|
|
<StackPanel Spacing="3" Margin="2,0,0,0">
|
|
<TextBlock Text="{loc:Loc app.tagline}" Foreground="#7C90B4" FontSize="10.5"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="1" Margin="0,26,0,0" Spacing="6">
|
|
<TextBlock Text="MENU" Foreground="#4C5F80" FontSize="9.5" FontWeight="SemiBold" Margin="14,0,0,4" />
|
|
<Button Classes="nav" Classes.active="{Binding IsHomeActive}"
|
|
Command="{Binding GoHomeCommand}" Content="{loc:Loc nav.home}" />
|
|
<Button Classes="nav" Classes.active="{Binding IsDownloadActive}"
|
|
Command="{Binding GoDownloadCommand}" Content="{loc:Loc nav.download}" />
|
|
<Button Classes="nav" Classes.active="{Binding IsSettingsActive}"
|
|
Command="{Binding GoSettingsCommand}" Content="{loc:Loc nav.settings}" />
|
|
<Button Classes="nav" Classes.active="{Binding IsAboutActive}"
|
|
Command="{Binding GoAboutCommand}" Content="{loc:Loc nav.about}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="2" Spacing="4">
|
|
<Border Height="1" Background="{DynamicResource SideLine}" Margin="0,0,0,10" />
|
|
<TextBlock Text="{Binding VersionText}" Foreground="#6F82A6" FontSize="10.5" Margin="14,0,0,0" />
|
|
<TextBlock Text="{Binding PlatformText}" Foreground="#4F6080" FontSize="10" Margin="14,0,0,0" />
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 内容:页面切换由 MainWindow 做淡入过渡,避免硬切 -->
|
|
<ContentControl x:Name="PageHost" Grid.Column="1" Grid.Row="0" Content="{Binding Current}" />
|
|
|
|
<!-- 启动更新状态条:模型立即生效,启动器下次启动生效 -->
|
|
<Border Grid.Column="1" Grid.Row="1"
|
|
Background="{DynamicResource Surface}"
|
|
BorderBrush="{DynamicResource Line}" BorderThickness="0,1,0,0"
|
|
Padding="20,9" IsVisible="{Binding UpdateBarVisible}">
|
|
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
|
<TextBlock Grid.Column="0" Text="⟳" FontSize="16" Foreground="{DynamicResource Accent}"
|
|
VerticalAlignment="Center" Margin="0,0,12,0" />
|
|
<StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
|
|
<TextBlock Text="{Binding UpdateStatus}" FontSize="12.5" FontWeight="SemiBold"
|
|
Foreground="{DynamicResource Ink}" TextTrimming="CharacterEllipsis" />
|
|
<TextBlock Text="{Binding UpdateDetail}" Classes="faint" TextTrimming="CharacterEllipsis" />
|
|
<TextBlock Text="{Binding LauncherNotice}" FontSize="11" Foreground="{DynamicResource Warn}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
<ProgressBar Grid.Column="2" Width="130" Minimum="0" Maximum="1"
|
|
Value="{Binding UpdateProgress}" IsVisible="{Binding UpdateBusy}"
|
|
VerticalAlignment="Center" Margin="14,0" />
|
|
<Button Grid.Column="3" Classes="ghost small" Content="{loc:Loc update.checkNow}"
|
|
Command="{Binding CheckUpdateCommand}" IsEnabled="{Binding !UpdateBusy}"
|
|
VerticalAlignment="Center" />
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Window>
|