Skip to content

Commit

Permalink
Merge pull request #126 from NotYoojun/master
Browse files Browse the repository at this point in the history
使用 Windows 11 Fluent 风格并修复了一个崩溃问题
  • Loading branch information
Raspberry-Monster authored Mar 3, 2024
2 parents 80c57dc + be7a3c5 commit 9a50c6f
Show file tree
Hide file tree
Showing 21 changed files with 455 additions and 674 deletions.
20 changes: 17 additions & 3 deletions Ink Canvas/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,35 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Ink_Canvas"
StartupUri="MainWindow.xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern">
<Application.Resources>
<ResourceDictionary>
<Style TargetType="ScrollViewer">
<Style TargetType="ui:ScrollViewerEx">

<EventSetter Event="PreviewMouseWheel" Handler="ScrollViewer_PreviewMouseWheel"/>

</Style>

<Style TargetType="ui:FontIcon">
<Setter Property="FontSize" Value="20"/>
</Style>
<Style TargetType="ui:SymbolIcon">
<Setter Property="FontSize" Value="20"/>
</Style>


<ResourceDictionary.MergedDictionaries>

<ui:ThemeResources RequestedTheme="Light"/>
<ui:XamlControlsResources />


<ui:XamlControlsResources/>

<ResourceDictionary Source="Resources/SeewoImageDictionary.xaml"/>
<ResourceDictionary Source="Resources/DrawShapeImageDictionary.xaml"/>
<ResourceDictionary Source="Resources/IconImageDictionary.xaml"/>
<ResourceDictionary Source="Resources/Styles/Light.xaml"/>

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
4 changes: 3 additions & 1 deletion Ink Canvas/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using AutoUpdaterDotNET;
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Controls;
using System;
using System.Linq;
using System.Reflection;
using System.Windows;
using MessageBox = System.Windows.MessageBox;

namespace Ink_Canvas
{
Expand Down Expand Up @@ -68,7 +70,7 @@ private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.
else
try
{
System.Windows.Controls.ScrollViewer SenderScrollViewer = (System.Windows.Controls.ScrollViewer)sender;
ScrollViewerEx SenderScrollViewer = (ScrollViewerEx)sender;
SenderScrollViewer.ScrollToVerticalOffset(SenderScrollViewer.VerticalOffset - e.Delta * 10 * System.Windows.Forms.SystemInformation.MouseWheelScrollLines / (double)120);
e.Handled = true;
}
Expand Down
2 changes: 1 addition & 1 deletion Ink Canvas/ChangeLogWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.modernwpf.com/2019" FontFamily="Microsoft YaHei UI" Topmost="True"
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>
Expand Down
2 changes: 1 addition & 1 deletion Ink Canvas/CountdownTimerWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.modernwpf.com/2019"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:processbars="clr-namespace:Ink_Canvas.ProcessBars"
ui:ThemeManager.RequestedTheme="Light" Topmost="True" Background="Transparent"
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
Expand Down
14 changes: 7 additions & 7 deletions Ink Canvas/CountdownTimerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void Timer_Elapsed(object sender, ElapsedEventArgs e)
TextBlockSecond.Text = "00";
timer.Stop();
isTimerRunning = false;
SymbolIconStart.Symbol = ModernWpf.Controls.Symbol.Play;
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
BtnStartCover.Visibility = Visibility.Visible;
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
BorderStopTime.Visibility = Visibility.Collapsed;
Expand Down Expand Up @@ -199,12 +199,12 @@ private void BtnFullscreen_MouseUp(object sender, MouseButtonEventArgs e)
if (WindowState == WindowState.Normal)
{
WindowState = WindowState.Maximized;
SymbolIconFullscreen.Symbol = ModernWpf.Controls.Symbol.BackToWindow;
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.BackToWindow;
}
else
{
WindowState = WindowState.Normal;
SymbolIconFullscreen.Symbol = ModernWpf.Controls.Symbol.FullScreen;
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.FullScreen;
}
}

Expand All @@ -230,7 +230,7 @@ private void BtnReset_MouseUp(object sender, MouseButtonEventArgs e)
BtnStartCover.Visibility = Visibility.Collapsed;
BorderStopTime.Visibility = Visibility.Collapsed;
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
SymbolIconStart.Symbol = ModernWpf.Controls.Symbol.Play;
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
isTimerRunning = false;
timer.Stop();
isPaused = false;
Expand Down Expand Up @@ -280,7 +280,7 @@ private void BtnStart_MouseUp(object sender, MouseButtonEventArgs e)
startTime += DateTime.Now - pauseTime;
ProcessBarTime.IsPaused = false;
TextBlockHour.Foreground = Brushes.Black;
SymbolIconStart.Symbol = ModernWpf.Controls.Symbol.Pause;
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Pause;
isPaused = false;
timer.Start();
UpdateStopTime();
Expand All @@ -292,7 +292,7 @@ private void BtnStart_MouseUp(object sender, MouseButtonEventArgs e)
pauseTime = DateTime.Now;
ProcessBarTime.IsPaused = true;
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
SymbolIconStart.Symbol = ModernWpf.Controls.Symbol.Play;
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
BorderStopTime.Visibility = Visibility.Collapsed;
isPaused = true;
timer.Stop();
Expand All @@ -304,7 +304,7 @@ private void BtnStart_MouseUp(object sender, MouseButtonEventArgs e)
totalSeconds = ((hour * 60) + minute) * 60 + second;
ProcessBarTime.IsPaused = false;
TextBlockHour.Foreground = Brushes.Black;
SymbolIconStart.Symbol = ModernWpf.Controls.Symbol.Pause;
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Pause;
BtnResetCover.Visibility = Visibility.Collapsed;

if (totalSeconds <= 10)
Expand Down
Loading

0 comments on commit 9a50c6f

Please sign in to comment.