From 875fa9c6f0ea0164e39182ebf436d89d2e57ee28 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Thu, 30 Apr 2026 23:33:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?improve:=E6=82=AC=E6=B5=AE=E7=AA=97?= =?UTF-8?q?=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Resources/Settings.cs | 52 ++++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Ink Canvas/Resources/Settings.cs b/Ink Canvas/Resources/Settings.cs index 1717f73d..23fd8a8c 100644 --- a/Ink Canvas/Resources/Settings.cs +++ b/Ink Canvas/Resources/Settings.cs @@ -617,32 +617,32 @@ namespace Ink_Canvas [JsonProperty("interceptRules")] public Dictionary InterceptRules { get; set; } = new Dictionary { - { "SeewoWhiteboard3Floating", true }, - { "SeewoWhiteboard5Floating", true }, - { "SeewoWhiteboard5CFloating", true }, - { "SeewoPincoSideBarFloating", true }, - { "SeewoPincoDrawingFloating", true }, - { "SeewoPincoBoardService", true }, - { "SeewoPPTFloating", true }, - { "AiClassFloating", true }, - { "HiteAnnotationFloating", true }, - { "ChangYanFloating", true }, - { "ChangYanBrushSettings", true }, - { "ChangYanSwipeClear", true }, - { "ChangYanInteraction", true }, - { "ChangYanSubjectApp", true }, - { "ChangYanControl", true }, - { "ChangYanCommonTools", true }, - { "ChangYanSceneToolbar", true }, - { "ChangYanDrawWindow", true }, - { "ChangYanPptFloating", true }, - { "ChangYanPptPageControl", true }, - { "ChangYanPptGoBack", true }, - { "ChangYanPptPreview", true }, - { "IntelligentClassFloating", true }, - { "IntelligentClassPptFloating", true }, - { "SeewoDesktopAnnotationFloating", true }, - { "SeewoDesktopSideBarFloating", true } + { "SeewoWhiteboard3Floating", false }, + { "SeewoWhiteboard5Floating", false }, + { "SeewoWhiteboard5CFloating", false }, + { "SeewoPincoSideBarFloating", false }, + { "SeewoPincoDrawingFloating", false }, + { "SeewoPincoBoardService", false }, + { "SeewoPPTFloating", false }, + { "AiClassFloating", false }, + { "HiteAnnotationFloating", false }, + { "ChangYanFloating", false }, + { "ChangYanBrushSettings", false }, + { "ChangYanSwipeClear", false }, + { "ChangYanInteraction", false }, + { "ChangYanSubjectApp", false }, + { "ChangYanControl", false }, + { "ChangYanCommonTools", false }, + { "ChangYanSceneToolbar", false }, + { "ChangYanDrawWindow", false }, + { "ChangYanPptFloating", false }, + { "ChangYanPptPageControl", false }, + { "ChangYanPptGoBack", false }, + { "ChangYanPptPreview", false }, + { "IntelligentClassFloating", false }, + { "IntelligentClassPptFloating", false }, + { "SeewoDesktopAnnotationFloating", false }, + { "SeewoDesktopSideBarFloating", false } }; } From 6239ac0b88a7b65416656815c6eb5cf1ac5bc035 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Thu, 30 Apr 2026 23:43:13 +0800 Subject: [PATCH 2/3] improve:UI --- .../Windows/SettingsViews/Pages/HomePage.xaml | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Ink Canvas/Windows/SettingsViews/Pages/HomePage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/HomePage.xaml index d1352107..d860c397 100644 --- a/Ink Canvas/Windows/SettingsViews/Pages/HomePage.xaml +++ b/Ink Canvas/Windows/SettingsViews/Pages/HomePage.xaml @@ -93,6 +93,22 @@ + + + + + + + + + + + + + - - - - - - - - - - - - From b0aff1e37879c47dfba83a09a8921b08742b141c Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Fri, 1 May 2026 00:07:18 +0800 Subject: [PATCH 3/3] improve:UI --- Ink Canvas/App.xaml.cs | 2 +- Ink Canvas/MainWindow_cs/MW_PPT.cs | 144 ++++++++++++++++++++++------- 2 files changed, 110 insertions(+), 36 deletions(-) diff --git a/Ink Canvas/App.xaml.cs b/Ink Canvas/App.xaml.cs index d75d8b58..15d72943 100644 --- a/Ink Canvas/App.xaml.cs +++ b/Ink Canvas/App.xaml.cs @@ -283,7 +283,7 @@ namespace Ink_Canvas RegisterMainWindowDestroyHook(); } - catch (Exception ex) + catch (Exception) { } } diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs index 4519f633..06bd1916 100644 --- a/Ink Canvas/MainWindow_cs/MW_PPT.cs +++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs @@ -2436,24 +2436,35 @@ namespace Ink_Canvas if (anchor != null) { _pptEnhancedPreviewPopup.PlacementTarget = anchor; - if (anchor == PPTLBPageButton || anchor == PPTRBPageButton) + _pptEnhancedPreviewPopup.HorizontalOffset = 0; + _pptEnhancedPreviewPopup.VerticalOffset = 0; + + var anchorRef = anchor; + _pptEnhancedPreviewPopup.CustomPopupPlacementCallback = (popupSize, targetSize, _) => { - _pptEnhancedPreviewPopup.Placement = PlacementMode.Top; - _pptEnhancedPreviewPopup.HorizontalOffset = 0; - _pptEnhancedPreviewPopup.VerticalOffset = -10; - } - else if (anchor == PPTRSPageButton) - { - _pptEnhancedPreviewPopup.Placement = PlacementMode.Left; - _pptEnhancedPreviewPopup.HorizontalOffset = -12; - _pptEnhancedPreviewPopup.VerticalOffset = 0; - } - else - { - _pptEnhancedPreviewPopup.Placement = PlacementMode.Right; - _pptEnhancedPreviewPopup.HorizontalOffset = 12; - _pptEnhancedPreviewPopup.VerticalOffset = 0; - } + System.Windows.Point pt; + PopupPrimaryAxis axis; + if (anchorRef == PPTLBPageButton || anchorRef == PPTRBPageButton) + { + // 底部翻页按钮:弹窗位于按钮上方,水平居中 + pt = new System.Windows.Point((targetSize.Width - popupSize.Width) / 2, -popupSize.Height); + axis = PopupPrimaryAxis.Horizontal; + } + else if (anchorRef == PPTRSPageButton) + { + // 右侧翻页按钮:弹窗位于按钮左侧,底边与按钮底边对齐(向上展开) + pt = new System.Windows.Point(-popupSize.Width, targetSize.Height - popupSize.Height); + axis = PopupPrimaryAxis.Vertical; + } + else + { + // 左侧翻页按钮(默认):弹窗位于按钮右侧,底边与按钮底边对齐 + pt = new System.Windows.Point(targetSize.Width, targetSize.Height - popupSize.Height); + axis = PopupPrimaryAxis.Vertical; + } + return new[] { new CustomPopupPlacement(pt, axis) }; + }; + _pptEnhancedPreviewPopup.Placement = PlacementMode.Custom; } _pptEnhancedPreviewPopup.IsOpen = true; @@ -2494,45 +2505,112 @@ namespace Ink_Canvas var listBox = new ListBox { - Width = 220, - Height = 320, + Width = 248, + MaxHeight = 560, Background = Brushes.Transparent, BorderBrush = Brushes.Transparent, BorderThickness = new Thickness(0), + Padding = new Thickness(6, 4, 6, 8), SelectionMode = SelectionMode.Single }; - listBox.SetValue(ScrollViewer.VerticalScrollBarVisibilityProperty, ScrollBarVisibility.Hidden); + listBox.SetValue(ScrollViewer.VerticalScrollBarVisibilityProperty, ScrollBarVisibility.Auto); listBox.SetValue(ScrollViewer.HorizontalScrollBarVisibilityProperty, ScrollBarVisibility.Disabled); listBox.MouseUp += PPTEnhancedPreviewListBox_OnMouseUp; var templateXaml = @" - - - - - - + + + + + + + + + + + + + + + + + + - + "; listBox.ItemTemplate = (DataTemplate)XamlReader.Parse(templateXaml); + var itemStyleXaml = @" "; listBox.ItemContainerStyle = (Style)XamlReader.Parse(itemStyleXaml); + var headerXaml = @" + + + + + +"; + var header = (Border)XamlReader.Parse(headerXaml); + var headerGrid = (Grid)header.Child; + ((TextBlock)headerGrid.Children[0]).Text = "幻灯片预览"; + var countText = (TextBlock)headerGrid.Children[1]; + listBox.Loaded += (s, e) => + { + var items = listBox.ItemsSource as System.Collections.IList; + countText.Text = items != null ? $"共 {items.Count} 页" : string.Empty; + }; + + var rootXaml = @" + + + + + +"; + var rootBorder = (Border)XamlReader.Parse(rootXaml); + var dock = (DockPanel)rootBorder.Child; + DockPanel.SetDock(header, Dock.Top); + dock.Children.Add(header); + dock.Children.Add(listBox); + _pptEnhancedPreviewListBox = listBox; _pptEnhancedPreviewPopup = new Popup { @@ -2540,7 +2618,7 @@ namespace Ink_Canvas StaysOpen = true, Placement = PlacementMode.Right, PopupAnimation = PopupAnimation.Fade, - Child = listBox + Child = rootBorder }; } @@ -2549,11 +2627,7 @@ namespace Ink_Canvas if (_pptEnhancedPreviewListBox?.SelectedItem is not PptEnhancedPreviewItem item) return; try { - if (_pptManager?.TryNavigateToSlide(item.SlideNumber) == true) - { - LogHelper.WriteLogToFile($"PPT增强预览跳转成功:{item.SlideNumber}", LogHelper.LogType.Trace); - } - else + if (_pptManager?.TryNavigateToSlide(item.SlideNumber) != true) { LogHelper.WriteLogToFile($"PPT增强预览跳转失败:{item.SlideNumber}", LogHelper.LogType.Warning); } @@ -2602,7 +2676,7 @@ namespace Ink_Canvas { slide = slides[i]; var imagePath = Path.Combine(tempDir, $"slide_{i:0000}.png"); - slide.Export(imagePath, "PNG", 320, 180); + slide.Export(imagePath, "PNG", 480, 270); var image = LoadBitmapImage(imagePath); if (image == null) continue;