Files
community/Ink Canvas/Windows/HistoryRollbackWindow.xaml
T

239 lines
14 KiB
XML
Raw Normal View History

2025-07-22 17:07:27 +08:00
<Window x:Class="Ink_Canvas.HistoryRollbackWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml"
mc:Ignorable="d"
2025-09-20 22:20:13 +08:00
ui:WindowHelper.UseModernWindowStyle="False"
ui:WindowHelper.SystemBackdropType="Mica"
2025-09-27 17:52:25 +08:00
Title="历史版本回滚" Height="650" Width="900" ResizeMode="NoResize"
WindowStartupLocation="CenterScreen" WindowStyle="None"
2025-09-20 22:20:13 +08:00
Background="Transparent" MinHeight="550" MinWidth="800">
<Window.Template>
<ControlTemplate TargetType="Window">
2025-09-27 17:52:25 +08:00
<Border Background="{DynamicResource SettingsPageBackground}"
CornerRadius="8"
BorderBrush="{DynamicResource SettingsPageBorderBrush}"
BorderThickness="1">
2025-09-20 22:20:13 +08:00
<Border.Effect>
2025-09-27 17:52:25 +08:00
<DropShadowEffect Color="#000000" BlurRadius="20" ShadowDepth="0" Opacity="0.1"/>
2025-09-20 22:20:13 +08:00
</Border.Effect>
2025-12-20 17:45:35 +08:00
<AdornerDecorator>
<Grid>
<!-- 标题栏 -->
<Border Background="{DynamicResource SettingsPageBackground}" Height="48" VerticalAlignment="Top">
<Grid>
<TextBlock Text="{TemplateBinding Title}"
FontSize="14" FontWeight="SemiBold"
Foreground="{DynamicResource SettingsPageForeground}"
VerticalAlignment="Center"
Margin="16,0,0,0"/>
<!-- 最小化按钮 -->
<Button Name="MinimizeButton"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,8,40,0"
Width="32" Height="32"
Background="Transparent"
BorderThickness="0"
Click="MinimizeButton_Click"
Cursor="Hand"
ToolTip="最小化">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}">
<TextBlock Text="" FontSize="14"
Foreground="{DynamicResource SettingsPageForeground}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#FF2563eb" Opacity="0.1"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#FF2563eb" Opacity="0.2"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<!-- 关闭按钮 -->
<Button Name="CloseButton"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,8,8,0"
Width="32" Height="32"
Background="Transparent"
BorderThickness="0"
Click="CloseButton_Click"
Cursor="Hand"
ToolTip="关闭">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}">
<TextBlock Text="×" FontSize="14"
Foreground="{DynamicResource SettingsPageForeground}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#ef4444" Opacity="0.1"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#ef4444" Opacity="0.2"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</Border>
<!-- 内容区域 -->
<ContentPresenter Margin="0,48,0,0"/>
</Grid>
</AdornerDecorator>
2025-09-20 22:20:13 +08:00
</Border>
</ControlTemplate>
</Window.Template>
<Window.Resources>
2025-09-27 17:52:25 +08:00
<!-- 主题相关颜色资源 -->
<SolidColorBrush x:Key="PrimaryBrush" Color="#FF2563eb"/>
<SolidColorBrush x:Key="TextPrimaryBrush" Color="#FF1f2937"/>
<SolidColorBrush x:Key="TextSecondaryBrush" Color="#FF6b7280"/>
2025-09-20 22:20:13 +08:00
</Window.Resources>
2025-09-27 17:52:25 +08:00
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<Grid Background="Transparent">
<!-- 主内容区域 -->
<ui:SimpleStackPanel VerticalAlignment="Stretch" Spacing="0" Margin="20">
<!-- 标题区域 -->
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="12" Margin="0,0,0,16">
<Border Background="{DynamicResource PrimaryBrush}" CornerRadius="16" Padding="12" Margin="0,0,0,0">
<ui:SymbolIcon Symbol="Undo" FontSize="20" Foreground="White"
VerticalAlignment="Center"/>
</Border>
<ui:SimpleStackPanel VerticalAlignment="Center" Spacing="4">
<TextBlock Text="历史版本回滚" FontSize="22" FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"/>
<TextBlock Text="选择要回滚到的历史版本" FontSize="14"
Foreground="{DynamicResource TextSecondaryBrush}"/>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
2025-09-20 22:20:13 +08:00
2025-09-27 17:52:25 +08:00
<!-- 版本选择卡片 -->
<Border Background="{DynamicResource SettingsPageBackground}"
BorderBrush="{DynamicResource SettingsPageBorderBrush}"
BorderThickness="1"
CornerRadius="12"
Margin="0,0,0,16"
Padding="20">
<Border.Effect>
<DropShadowEffect Color="#000000" BlurRadius="8" ShadowDepth="0" Opacity="0.05"/>
</Border.Effect>
<ui:SimpleStackPanel Spacing="16">
<TextBlock Text="选择版本" FontSize="16" FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"/>
<ComboBox x:Name="VersionComboBox"
Width="300" Height="40"
DisplayMemberPath="Version"
SelectionChanged="VersionComboBox_SelectionChanged"/>
</ui:SimpleStackPanel>
</Border>
<!-- 发布说明卡片 -->
<Border Background="{DynamicResource SettingsPageBackground}"
BorderBrush="{DynamicResource SettingsPageBorderBrush}"
BorderThickness="1"
CornerRadius="12"
Margin="0,0,0,16"
Padding="20">
<Border.Effect>
<DropShadowEffect Color="#000000" BlurRadius="8" ShadowDepth="0" Opacity="0.05"/>
</Border.Effect>
<ui:SimpleStackPanel Spacing="16">
<TextBlock Text="版本更新说明" FontSize="16" FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"/>
<Border Background="{DynamicResource SettingsPageBackground}"
BorderBrush="{DynamicResource SettingsPageBorderBrush}"
BorderThickness="1"
CornerRadius="8"
MinHeight="150" MaxHeight="250">
<Border.Effect>
<DropShadowEffect Color="#000000" BlurRadius="4" ShadowDepth="0" Opacity="0.03"/>
</Border.Effect>
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled"
Padding="16">
<mdxam:MarkdownScrollViewer x:Name="ReleaseNotesViewer"
Foreground="{DynamicResource TextPrimaryBrush}"
MarkdownStyleName="GithubLike"/>
</ScrollViewer>
2025-09-20 22:20:13 +08:00
</Border>
</ui:SimpleStackPanel>
2025-09-27 17:52:25 +08:00
</Border>
<!-- 操作按钮区域 -->
<ui:SimpleStackPanel Spacing="16" Margin="0,0,0,16">
<Button x:Name="RollbackButton"
Content="回滚到此版本"
HorizontalAlignment="Center"
Click="RollbackButton_Click"
Style="{DynamicResource AccentButtonStyle}"
Width="200" Height="48"
FontSize="16" FontWeight="SemiBold"/>
2025-09-20 22:20:13 +08:00
2025-09-27 17:52:25 +08:00
<!-- 下载进度面板 -->
<Border x:Name="DownloadProgressPanel"
Background="{DynamicResource SettingsPageBackground}"
BorderBrush="{DynamicResource SettingsPageBorderBrush}"
BorderThickness="1"
CornerRadius="12"
Visibility="Collapsed"
Margin="0,8,0,0"
Padding="24">
2025-09-20 22:20:13 +08:00
<Border.Effect>
<DropShadowEffect Color="#000000" BlurRadius="8" ShadowDepth="0" Opacity="0.05"/>
</Border.Effect>
<ui:SimpleStackPanel Spacing="12">
2025-09-27 17:52:25 +08:00
<ProgressBar x:Name="DownloadProgressBar"
Width="300" Height="8"
Minimum="0" Maximum="100" Value="0"/>
<TextBlock x:Name="DownloadProgressText"
Text="正在下载..."
FontSize="14"
Foreground="{DynamicResource TextPrimaryBrush}"
HorizontalAlignment="Center"/>
2025-09-20 22:20:13 +08:00
</ui:SimpleStackPanel>
</Border>
2025-09-27 17:52:25 +08:00
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</Grid>
</ScrollViewer>
2025-09-20 22:20:13 +08:00
</Window>