[feature] 新更新窗口

This commit is contained in:
Dubi906w 2024-05-04 19:46:20 +08:00
parent 3a8d6b640f
commit 00249b45e6
8 changed files with 112 additions and 112 deletions

View File

@ -19,7 +19,7 @@ namespace Ink_Canvas.Helpers
{
string localVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
string remoteAddress = proxy;
remoteAddress += "https://raw.githubusercontent.com/ChangSakura/Ink-Canvas/master/AutomaticUpdateVersionControl.txt";
remoteAddress += "https://gitea.bliemhax.com/kriastans/InkCanvasForClass/raw/branch/master/AutomaticUpdateVersionControl.txt";
string remoteVersion = await GetRemoteVersion(remoteAddress);
if (remoteVersion != null)

View File

@ -178,8 +178,8 @@
<Compile Include="MainWindow_cs\MW_Timer.cs" />
<Compile Include="MainWindow_cs\MW_TimeMachine.cs" />
<Compile Include="MainWindow_cs\MW_ShapeDrawing.cs" />
<Compile Include="Windows\ChangeLogWindow.xaml.cs">
<DependentUpon>ChangeLogWindow.xaml</DependentUpon>
<Compile Include="Windows\HasNewUpdateWindow.xaml.cs">
<DependentUpon>HasNewUpdateWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\OperatingGuideWindow.xaml.cs">
<DependentUpon>OperatingGuideWindow.xaml</DependentUpon>
@ -208,7 +208,7 @@
<Compile Include="Windows\CountdownTimerWindow.xaml.cs">
<DependentUpon>CountdownTimerWindow.xaml</DependentUpon>
</Compile>
<Page Include="Windows\ChangeLogWindow.xaml">
<Page Include="Windows\HasNewUpdateWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -302,6 +302,9 @@
<PackageReference Include="iNKORE.UI.WPF.Modern">
<Version>0.9.26.3</Version>
</PackageReference>
<PackageReference Include="MdXaml">
<Version>1.27.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Office.Interop.PowerPoint">
<Version>15.0.4420.1018</Version>
</PackageReference>
@ -626,5 +629,8 @@
<ItemGroup>
<Resource Include="Resources\hatsune-miku1.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Icons-Fluent\party.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -10,6 +10,8 @@ using System.Windows.Media;
using System.Diagnostics;
using File = System.IO.File;
using MessageBox = System.Windows.MessageBox;
using System.Runtime.InteropServices;
using System.Windows.Interop;
namespace Ink_Canvas {
public partial class MainWindow : Window {
@ -149,10 +151,23 @@ namespace Ink_Canvas {
public static string settingsFileName = "Settings.json";
bool isLoaded = false;
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
private const int GWL_EX_STYLE = -20;
private const int WS_EX_APPWINDOW = 0x00040000, WS_EX_TOOLWINDOW = 0x00000080;
private void Window_Loaded(object sender, RoutedEventArgs e) {
var helper = new WindowInteropHelper(this).Handle;
//Performing some magic to hide the form from Alt+Tab
SetWindowLong(helper, GWL_EX_STYLE, (GetWindowLong(helper, GWL_EX_STYLE) | WS_EX_TOOLWINDOW) & ~WS_EX_APPWINDOW);
loadPenCanvas();
//加载设置
LoadSettings(true);
HasNewUpdateWindow hasNewUpdateWindow = new HasNewUpdateWindow();
if (Environment.Is64BitProcess) {
GroupBoxInkRecognition.Visibility = Visibility.Collapsed;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

View File

@ -1,51 +0,0 @@
<Window x:Class="Ink_Canvas.ChangeLogWindow"
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:local="clr-namespace:Ink_Canvas" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" ShowInTaskbar="False"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" FontFamily="Microsoft YaHei UI" Topmost="True"
mc:Ignorable="d" ui:WindowHelper.UseModernWindowStyle="True" Loaded="Window_Loaded" Closed="Window_Closed"
Title="" Height="390" Width="600">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="130"/>
<RowDefinition/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<Label Content="Ink Canvas 画板功能更新!" FontFamily="Microsoft YaHei UI" FontSize="26" Margin="20,0"/>
<StackPanel Grid.Row="1" Visibility="Collapsed">
<TextBlock Name="TextBlockChangeLogTitle" Text="更新日志" FontSize="18" FontWeight="Bold" Margin="35,10,35,0"/>
<TextBlock Name="TextBlockChangeLog" Text="修复一堆 Bug。" TextWrapping="Wrap" FontSize="14" Margin="55,5"/>
<TextBlock Name="TextBlockChangeLog1" Visibility="Collapsed" Text="修复墨迹识别功能中部分误识别问题。" TextWrapping="Wrap" FontSize="14" Margin="55,5"/>
<TextBlock Name="TextBlockSuggestionTitle" Text="建议" FontSize="18" FontWeight="Bold" Margin="35,10,35,0"/>
<TextBlock Name="TextBlockSuggestion" Text="建议配置屏幕为3840×2160 (缩放: 250%)或1920×1080 (缩放: 125%),以获得最佳体验。" TextWrapping="Wrap" FontSize="14" Margin="55,5"/>
</StackPanel>
<Grid Grid.Row="1" Margin="50,0,50,0" Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="Resources/InkCanvas.ico"/>
<Viewbox Grid.Column="1" Margin="20">
<ui:SymbolIcon Symbol="Emoji2" Foreground="#0865B5"/>
</Viewbox>
<Viewbox Grid.Column="2" Margin="20">
<ui:SymbolIcon Symbol="Emoji" Foreground="#169141"/>
</Viewbox>
</Grid>
<ui:SimpleStackPanel VerticalAlignment="Bottom" Grid.Row="2" Margin="50,0">
<TextBlock Text="更新日志" FontSize="18" FontWeight="Bold" Margin="0,10,0,0"/>
<TextBlock Text="1. 支持多步撤销/重做" TextWrapping="Wrap" FontSize="14" Margin="25,5,0,0"/>
<TextBlock Text="2. 添加 PowerPoint 相关功能" TextWrapping="Wrap" FontSize="14" Margin="25,5,0,0"/>
<TextBlock Text="3. 提供白板选项" TextWrapping="Wrap" FontSize="14" Margin="25,5,0,0"/>
<TextBlock Text="4. 增加双曲线渐近线选项" TextWrapping="Wrap" FontSize="14" Margin="25,5,0,0"/>
<!--<TextBlock Text="建议" FontSize="18" FontWeight="Bold" Margin="0,10,0,0"/>
<TextBlock Text="建议配置屏幕为3840×2160 (缩放: 250%)或1920×1080 (缩放: 125%),以获得最佳体验(否则可能造成橡皮大小过大或过小等问题,可在设置中调整)。" TextWrapping="Wrap" FontSize="14" Margin="25,5,-10,0"/>-->
</ui:SimpleStackPanel>
<Label Name="LabelVersion" Grid.Row="3" VerticalContentAlignment="Center" FontSize="12" Margin="20,0"/>
<Button Content="确定" Grid.Row="3" HorizontalAlignment="Right" Margin="10" Width="100" FontFamily="Microsoft YaHei UI" Click="Button_Click"/>
</Grid>
</Window>

View File

@ -1,57 +0,0 @@
using System;
using System.Reflection;
using System.Windows;
namespace Ink_Canvas
{
/// <summary>
/// Interaction logic for ChangeLogWindow.xaml
/// </summary>
public partial class ChangeLogWindow : Window
{
public ChangeLogWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//Version 2.1.0-beta
//TextBlockChangeLog.Text = "" +
// "1. 修复使用画板时无法使用翻页笔的问题\n" +
// "2. 支持修改画笔粗细,支持显示画笔指针\n" +
// "3. 支持双指缩放和拖动手势\n" +
// "4. 添加“选择墨迹”功能,选中后可以对墨迹进行拖动,拉伸等操作\n" +
// "5. 添加画图功能(直线、箭头、矩形、椭圆)";
//TextBlockSuggestion.Text = "打开设置,点击“重置”中的“重置设置为推荐设置”,以提升教学体验!";
//Version 2.1.1-release
//TextBlockChangeLog.Text = "" +
// "1. 修复部分情况下幻灯片放映翻页时墨迹保留的问题\n" +
// "2. 支持选中后的缩放和拖动\n" +
// "3. 修复部分模式下自动橡皮失效的问题\n" +
// "4. 修复幻灯片放映时的部分问题";
//TextBlockSuggestion.Text = "打开设置,点击“重置”中的“重置设置为推荐设置”,以提升教学体验!";
//Version 2.1.2-release
//TextBlockChangeLog.Text = "" +
// "1. 添加“墨迹识别”功能,目前可实现智能识别圆、三角形、特殊四边形,并自动转换为规范图形。可自动识别同心圆,相切圆,可自动识别球的截面圆。\n" +
// "2. 优化“抽奖”中的“名单导入”功能\n";
TextBlockSuggestionTitle.Visibility = Visibility.Collapsed;
//TextBlockSuggestion.Text = "老师讲评试卷可以点击右侧的背景和深色按钮,即可启动黑板功能(同样支持用笔来擦除),\n双指可以缩放和拖动左边也会有工具栏方便画图形。";
Version version = Assembly.GetExecutingAssembly().GetName().Version;
LabelVersion.Content = "Version: " + version.ToString();
}
private void Window_Closed(object sender, EventArgs e)
{
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}

View File

@ -0,0 +1,56 @@
<Window x:Class="Ink_Canvas.HasNewUpdateWindow"
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:local="clr-namespace:Ink_Canvas"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml"
mc:Ignorable="d"
ui:WindowHelper.UseModernWindowStyle = "True"
ui:WindowHelper.SystemBackdropType="Mica"
ui:TitleBar.Height="36"
Title="InkCanvasForClass有新版本可用" Height="475" Width="800" ResizeMode="NoResize">
<Grid>
<ui:SimpleStackPanel VerticalAlignment="Stretch" Spacing="0">
<ui:SimpleStackPanel Orientation="Horizontal">
<ui:SimpleStackPanel Orientation="Vertical" Width="685" Margin="24,18,0,0" Spacing="2">
<TextBlock Text="InkCanvasForClass 新版本来了!" FontSize="24" FontWeight="Bold" TextAlignment="Left"/>
<TextBlock Text="希望您能喜欢我们的新版本 :-)" FontSize="20" TextAlignment="Left"/>
</ui:SimpleStackPanel>
<Image Source="/Resources/Icons-fluent/party.png" Width="72" Height="72"/>
</ui:SimpleStackPanel>
<Border BorderBrush="#3f3f46" BorderThickness="1" CornerRadius="4" Margin="24,12,24,0">
<ui:ScrollViewerEx Margin="0" VerticalScrollBarVisibility="Auto" Height="256" PanningMode="VerticalOnly" ui:ThemeManager.RequestedTheme="Light">
<mdxam:MarkdownScrollViewer xml:space="preserve">
# sample title
* document1
* two
* three
* document2
helloworld
helloworld
helloworld
helloworld
helloworld
helloworld
helloworld
</mdxam:MarkdownScrollViewer>
</ui:ScrollViewerEx>
</Border>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="12" Margin="0,8,0,0">
<TextBlock Text="本次更新: 4.9.1 -> 5.9.1" FontWeight="Bold" FontSize="14" TextAlignment="Center"/>
<TextBlock Text="2024年8月4日发布更新" FontSize="14" TextAlignment="Center"/>
</ui:SimpleStackPanel>
<Button Content="跳过该版本" HorizontalAlignment="Center" Margin="0,10,0,0"/>
</ui:SimpleStackPanel>
</Grid>
</Window>

View File

@ -0,0 +1,31 @@
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Ink_Canvas
{
/// <summary>
/// HasNewUpdateWindow.xaml 的交互逻辑
/// </summary>
public partial class HasNewUpdateWindow : Window
{
public HasNewUpdateWindow()
{
InitializeComponent();
AnimationsHelper.ShowWithFadeIn(this, 0.25);
}
}
}