add:新设置
This commit is contained in:
@@ -77,6 +77,9 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
// 截图和屏幕捕捉
|
||||
new SettingItem { Title = "截图和屏幕捕捉", Category = "截图和屏幕捕捉", ItemName = "SnapshotItem", Type = SettingItemType.Category },
|
||||
|
||||
// 更新中心
|
||||
new SettingItem { Title = "更新中心", Category = "更新中心", ItemName = "UpdateCenterItem", Type = SettingItemType.Category },
|
||||
|
||||
// 关于
|
||||
new SettingItem { Title = "关于 InkCanvasForClass", Category = "关于", ItemName = "AboutItem", Type = SettingItemType.Category },
|
||||
};
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<UserControl x:Class="Ink_Canvas.Windows.SettingsViews.UpdateCenterPanel"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="950" d:DesignWidth="640">
|
||||
<Grid>
|
||||
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="UpdateCenterScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2">
|
||||
<StackPanel Margin="0,12,0,24" HorizontalAlignment="Center" Width="524">
|
||||
<TextBlock Foreground="#2e3436" FontSize="18" FontWeight="Bold" Text="更新中心" Margin="0,0,0,20"/>
|
||||
<TextBlock Name="UpdateStatusText" Foreground="#878787" FontSize="14" Text="正在检查更新..." TextWrapping="Wrap" Margin="0,0,0,20"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using iNKORE.UI.WPF.Helpers;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews
|
||||
{
|
||||
public partial class UpdateCenterPanel : UserControl
|
||||
{
|
||||
public UpdateCenterPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public event EventHandler<RoutedEventArgs> IsTopBarNeedShadowEffect;
|
||||
public event EventHandler<RoutedEventArgs> IsTopBarNeedNoShadowEffect;
|
||||
|
||||
private void ScrollViewerEx_ScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||
{
|
||||
var scrollViewer = (ScrollViewer)sender;
|
||||
if (scrollViewer.VerticalOffset >= 10)
|
||||
{
|
||||
IsTopBarNeedShadowEffect?.Invoke(this, new RoutedEventArgs());
|
||||
}
|
||||
else
|
||||
{
|
||||
IsTopBarNeedNoShadowEffect?.Invoke(this, new RoutedEventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyTheme()
|
||||
{
|
||||
try
|
||||
{
|
||||
ThemeHelper.ApplyThemeToControl(this);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"UpdateCenterPanel 应用主题时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +196,13 @@
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
<DrawingImage x:Key="UpdateCenterIcon">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M8,0C3.58172,0 0,3.58172 0,8 0,12.4183 3.58172,16 8,16 12.4183,16 16,12.4183 16,8 16,3.58172 12.4183,0 8,0z M8,14C4.68629,14 2,11.3137 2,8 2,4.68629 4.68629,2 8,2 11.3137,2 14,4.68629 14,8 14,11.3137 11.3137,14 8,14z M8,4C5.79086,4 4,5.79086 4,8 4,10.2091 5.79086,12 8,12 10.2091,12 12,10.2091 12,8 12,5.79086 10.2091,4 8,4z M8,10C6.89543,10 6,9.10457 6,8 6,6.89543 6.89543,6 8,6 9.10457,6 10,6.89543 10,8 10,9.10457 9.10457,10 8,10z"/>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
<DrawingImage x:Key="AboutIcon">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
|
||||
@@ -742,6 +749,11 @@
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--UpdateCenterPanel-->
|
||||
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="UpdateCenterPane">
|
||||
<settingsViews:UpdateCenterPanel x:Name="UpdateCenterPanel"/>
|
||||
</Grid>
|
||||
|
||||
<!--AboutPanel-->
|
||||
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="AboutPane">
|
||||
<settingsViews:AboutPanel x:Name="SettingsAboutPanel"/>
|
||||
|
||||
@@ -153,6 +153,14 @@ namespace Ink_Canvas.Windows
|
||||
Type = SidebarItemType.Separator
|
||||
});
|
||||
SidebarItems.Add(new SidebarItem()
|
||||
{
|
||||
Type = SidebarItemType.Item,
|
||||
Title = "更新中心",
|
||||
Name = "UpdateCenterItem",
|
||||
IconSource = FindResource("UpdateCenterIcon") as DrawingImage,
|
||||
Selected = false,
|
||||
});
|
||||
SidebarItems.Add(new SidebarItem()
|
||||
{
|
||||
Type = SidebarItemType.Item,
|
||||
Title = "关于 InkCanvasForClass",
|
||||
@@ -161,6 +169,7 @@ namespace Ink_Canvas.Windows
|
||||
Selected = false,
|
||||
});
|
||||
SettingsPanes = new Grid[] {
|
||||
UpdateCenterPane,
|
||||
AboutPane,
|
||||
CanvasAndInkPane,
|
||||
GesturesPane,
|
||||
@@ -177,6 +186,7 @@ namespace Ink_Canvas.Windows
|
||||
};
|
||||
|
||||
SettingsPaneScrollViewers = new ScrollViewer[] {
|
||||
UpdateCenterPanel.UpdateCenterScrollViewerEx,
|
||||
SettingsAboutPanel.AboutScrollViewerEx,
|
||||
CanvasAndInkPanel.ScrollViewerEx,
|
||||
GesturesPanel.ScrollViewerEx,
|
||||
@@ -193,6 +203,7 @@ namespace Ink_Canvas.Windows
|
||||
};
|
||||
|
||||
SettingsPaneTitles = new string[] {
|
||||
"更新中心",
|
||||
"关于",
|
||||
"画板和墨迹",
|
||||
"手势操作",
|
||||
@@ -209,6 +220,7 @@ namespace Ink_Canvas.Windows
|
||||
};
|
||||
|
||||
SettingsPaneNames = new string[] {
|
||||
"UpdateCenterItem",
|
||||
"AboutItem",
|
||||
"CanvasAndInkItem",
|
||||
"GesturesItem",
|
||||
@@ -259,6 +271,8 @@ namespace Ink_Canvas.Windows
|
||||
AdvancedPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
|
||||
SnapshotPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
|
||||
SnapshotPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
|
||||
UpdateCenterPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
|
||||
UpdateCenterPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
|
||||
|
||||
_selectedSidebarItemName = "StartupItem";
|
||||
|
||||
@@ -307,7 +321,7 @@ namespace Ink_Canvas.Windows
|
||||
// 使用反射调用所有面板的 ApplyTheme 方法(如果存在)
|
||||
var panels = new UserControl[]
|
||||
{
|
||||
StartupPanel, CanvasAndInkPanel, GesturesPanel, InkRecognitionPanel,
|
||||
UpdateCenterPanel, StartupPanel, CanvasAndInkPanel, GesturesPanel, InkRecognitionPanel,
|
||||
ThemePanel, ShortcutsPanel, CrashActionPanel, PowerPointPanel,
|
||||
AutomationPanel, LuckyRandomPanel, AdvancedPanel, SnapshotPanel,
|
||||
SettingsAboutPanel, AppearancePanel, SearchPanelControl
|
||||
@@ -754,6 +768,7 @@ namespace Ink_Canvas.Windows
|
||||
LuckyRandomPanel,
|
||||
AdvancedPanel,
|
||||
SnapshotPanel,
|
||||
UpdateCenterPanel,
|
||||
SettingsAboutPanel,
|
||||
AppearancePanel
|
||||
};
|
||||
@@ -947,6 +962,7 @@ namespace Ink_Canvas.Windows
|
||||
{ "LuckyRandomItem", LuckyRandomPanel },
|
||||
{ "AdvancedItem", AdvancedPanel },
|
||||
{ "SnapshotItem", SnapshotPanel },
|
||||
{ "UpdateCenterItem", UpdateCenterPanel },
|
||||
{ "AppearanceItem", AppearancePanel }
|
||||
};
|
||||
|
||||
@@ -964,6 +980,7 @@ namespace Ink_Canvas.Windows
|
||||
if (LuckyRandomPane != null) LuckyRandomPane.Visibility = _selectedSidebarItemName == "LuckyRandomItem" ? Visibility.Visible : Visibility.Collapsed;
|
||||
if (AdvancedPane != null) AdvancedPane.Visibility = _selectedSidebarItemName == "AdvancedItem" ? Visibility.Visible : Visibility.Collapsed;
|
||||
if (SnapshotPane != null) SnapshotPane.Visibility = _selectedSidebarItemName == "SnapshotItem" ? Visibility.Visible : Visibility.Collapsed;
|
||||
if (UpdateCenterPane != null) UpdateCenterPane.Visibility = _selectedSidebarItemName == "UpdateCenterItem" ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
// 为新显示的面板应用主题(延迟执行,确保面板已完全显示)
|
||||
if (panelMappings.ContainsKey(_selectedSidebarItemName))
|
||||
|
||||
Reference in New Issue
Block a user