Parcourir la source

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

ZhouJieSheng il y a 2 ans
Parent
commit
93c17da125

BIN
PDF Office/ComPDFKit.Desk.dll


BIN
PDF Office/ComPDFKit.Viewer.dll


+ 0 - 1
PDF Office/Themes/Alias_Light.xaml

@@ -239,5 +239,4 @@
         Opacity=" 0.4"
         ShadowDepth="0"
         Color="#F3465B" />
-
 </ResourceDictionary>

+ 2 - 3
PDF Office/Themes/Generic.xaml

@@ -1,8 +1,7 @@
 <ResourceDictionary
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:cus="clr-namespace:PDF_Master.CustomControl"
-    xmlns:local="clr-namespace:PDF_Master">
+    xmlns:cus="clr-namespace:PDF_Master.CustomControl">
 
     <!--  style for customControl  -->
     <Style TargetType="{x:Type cus:DialogContent}">
@@ -312,4 +311,4 @@
             </Setter.Value>
         </Setter>
     </Style>
-</ResourceDictionary>
+</ResourceDictionary>

+ 0 - 1
PDF Office/Themes/Global.xaml

@@ -344,5 +344,4 @@
         <Setter Property="FontWeight" Value="Semibold" />
         <Setter Property="FontSize" Value="20" />
     </Style>
-
 </ResourceDictionary>

+ 12 - 2
PDF Office/ViewModels/BOTA/OutLineControlViewModel.cs

@@ -179,7 +179,7 @@ namespace PDF_Master.ViewModels.BOTA
                 }
             }
 
-            if (list.Count>0)
+            if (list.Count > 0)
             {
                 //如果是第一条数据不允许点击降级
                 list[0].CanDown = false;
@@ -589,6 +589,12 @@ namespace PDF_Master.ViewModels.BOTA
         public WriteableBitmap LoadPreview(OutlineNode outlineNode,int Width,int Height)
         {
             CPDFPage page = PDFViewer.Document.PageAtIndex(Convert.ToInt32(outlineNode.PageIndex) - 1);
+
+            if (page==null)
+            {
+                return null;
+            }
+
             Size size = PDFViewer.Document.GetPageSize(Convert.ToInt32(outlineNode.PageIndex) - 1);
             //当前对象添加时没创建默认对象,SDK会返回(-1,-1)
             if (outlineNode.PositionX == -1)
@@ -703,7 +709,7 @@ namespace PDF_Master.ViewModels.BOTA
                 }
                 else
                 {
-                    node.CanDown = false;
+                    node.CanDown = true;
                 }
             }
             return node;
@@ -765,6 +771,10 @@ namespace PDF_Master.ViewModels.BOTA
             {
                 return list.Last();
             }
+            if (list.Count<=0)
+            {
+                return null;
+            }
             int index = list.IndexOf(outline);
             if (index >= 0)
             {

+ 5 - 5
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs

@@ -1036,7 +1036,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                 string appUnicode = string.Empty;
                 if (parameters.TryGetValue<string>(ParameterNames.Unicode, out appUnicode))
                 {
-                    this.printEvent.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusNone , Unicode= appUnicode });
+                    this.printEvent.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusNone, Unicode = appUnicode });
                 }
             }
 
@@ -1048,6 +1048,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                 }));
             }
 
+            int currentPage = -1;
             if (PDFViewer != null && PDFViewer.Document != null && result.IsDiscryptied)
             {
                 for (int temp = 0; temp < PDFViewer.Document.PageCount; temp++)
@@ -1088,10 +1089,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                         }
                     }
                 }
-
-
-                int currentPage = -1;
-                if (parameters.TryGetValue<int>(ParameterNames.PrintCurrentPage, out currentPage))
+                else if (parameters.TryGetValue<int>(ParameterNames.PrintCurrentPage, out currentPage))
                 {
                     System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
                     {
@@ -1099,6 +1097,8 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                     }));
                 }
 
+
+
                 System.Windows.Size pageSize = PDFViewer.Document.GetPageSize(0);
 
                 if ((pageSize.Height / pageSize.Width > 1.0 && (double)PrintSettingsInfo.PrintDocument.DefaultPageSettings.PaperSize.Height / PrintSettingsInfo.PrintDocument.DefaultPageSettings.PaperSize.Width < 1.0)

+ 1 - 2
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -509,8 +509,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                             continue;
                         }
                     }
-               
-              
+                
                 mergeObject.DocName = doc.FileName;
                 mergeObject.DocPageCount = doc.PageCount.ToString() + " " + App.MainPageLoader.GetString("Merge_ItemPages");
                 mergeObject.SDKPageCount = doc.PageCount;

+ 55 - 30
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -731,14 +731,14 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             //没有选择注释工具、也不是右键添加注释
             //在阅读页,选择注释后,点击按钮
             //需要设置相关参数
-            if (AnnotAttribEvent.IsAnnotCreateReset == false && propertyPanel.IsAddLink == false)
-            {
-                propertyPanel.IsLocationLink = true;
+            //if (AnnotAttribEvent.IsAnnotCreateReset == false && propertyPanel.IsAddLink == false)
+            //{
+            //    propertyPanel.IsLocationLink = true;
 
-                pdfViewer.SetMouseMode(MouseModes.AnnotCreate);
+            //    pdfViewer.SetMouseMode(MouseModes.AnnotCreate);
 
-                pdfViewer.SetToolParam(LinkAnnotArgs);
-            }
+            //    pdfViewer.SetToolParam(LinkAnnotArgs);
+            //}
 
             historyPageIndex = pdfViewer.CurrentIndex;
 
@@ -779,6 +779,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             //AnnotAttribEvent.IsAnnotCreateReset = true;
         }
 
+        private Rect paintrect;
+
         /// <summary>
         /// 定位目标范围完成时,触发
         /// </summary>
@@ -808,6 +810,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         LinkAnnotArgs.IsPositionSet = true;
                         LinkAnnotArgs.DestIndex = areaInfo.PageIndex;
                         LinkAnnotArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
+                        paintrect = LinkAnnotArgs.GetLinkCreateArea();
 
                         AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
                         AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
@@ -820,6 +823,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         {
                             pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
                         }
+                        Rect rect = LinkAnnotArgs.GetLinkPaintArea();
 
                         BtnLocationIsChecked = false;
 
@@ -831,12 +835,12 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         //没有选择注释工具、也不是右键添加注释
                         //在阅读页,选择注释后,点击按钮
                         //需要设置相关参数
-                        if (propertyPanel.IsLocationLink)
-                        {
-                            pdfViewer.SetMouseMode(MouseModes.PanTool);
-                            propertyPanel.IsLocationLink = false;
-                            pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
-                        }
+                        //if (propertyPanel.IsLocationLink)
+                        //{
+                        //    pdfViewer.SetMouseMode(MouseModes.PanTool);
+                        //    propertyPanel.IsLocationLink = false;
+                        //    pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
+                        //}
                     }
                 }
             }
@@ -941,7 +945,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         {
             int pageIndex = Convert.ToInt32(PageNumTextContent) - 1;
 
-            Rect rect = LinkAnnotArgs.GetLinkCreateArea();
+            //目前只适用于 非定位的链接
+
+            //注释位置
+            Rect rect = LinkAnnotArgs.GetLinkPaintArea();
 
             if (btnGOorBack.Tag.ToString() == "GO")
             {
@@ -966,29 +973,47 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                     double height = 0;
                     CPDFDocument doc = pdfViewer.Document;
                     CPDFPage docPage = doc.PageAtIndex(historyPageIndex, false);
-                    double y = docPage.PageSize.Height - rect.Top;
-                    double zoom = pdfViewer.ZoomFactor;
-                    double y1 = (rect.Y / 2) * zoom;
-                    if (historyPageIndex < pageIndex)
-                    {
-                        if (docPage.PageSize.Height / 2 < rect.Top)
-                        {
-                            //double y1 = (rect.Y / 2) * zoom;
-                            height = vertical + y1 + y * zoom;
-                            height = vertical + (rect.Bottom * zoom);
-                            pdfViewer.ScrollToVerticalOffset(height);
-                        }
-                    }
-                    else
+
+                    if (!rect.IsEmpty)
                     {
+                        //double y = docPage.PageSize.Height - rect.Top;
+                        double zoom = pdfViewer.ZoomFactor;
+                        //double y1 = (rect.Y / 2) * zoom;
                         if (docPage.PageSize.Height / 2 < rect.Top)
                         {
-                            height = vertical + (rect.Y / 2) - y * zoom;
-                            height = vertical + (rect.Top * zoom);
-                            pdfViewer.ScrollToVerticalOffset(height);
+                            if (historyPageIndex < pageIndex)
+                            {
+                                height = vertical + (rect.Bottom * zoom);
+                                pdfViewer.ScrollToVerticalOffset(height);
+                            }
+                            else
+                            {
+                                height = vertical + (rect.Top * zoom);
+                                pdfViewer.ScrollToVerticalOffset(height);
+                            }
                         }
                     }
 
+                    //if (historyPageIndex < pageIndex)
+                    //{
+                    //    if (docPage.PageSize.Height / 2 < rect.Top)
+                    //    {
+                    //        //double y1 = (rect.Y / 2) * zoom;
+                    //        //height = vertical + y1 + y * zoom;
+                    //        height = vertical + (rect.Bottom * zoom);
+                    //        pdfViewer.ScrollToVerticalOffset(height);
+                    //    }
+                    //}
+                    //else
+                    //{
+                    //    if (docPage.PageSize.Height / 2 < rect.Top)
+                    //    {
+                    //        //height = vertical + (rect.Y / 2) - y * zoom;
+                    //        height = vertical + (rect.Top * zoom);
+                    //        pdfViewer.ScrollToVerticalOffset(height);
+                    //    }
+                    //}
+
                     //pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
                     ChangeBtnGOorBack("GO", btnGOorBack);
                 }

+ 43 - 18
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -283,6 +283,10 @@ namespace PDF_Master.ViewModels.Tools
             }
         }
 
+        /// <summary>
+        /// 选中注释 区分签名、图章、手绘
+        /// </summary>
+        /// <param name="annotlist"></param>
         private void SelectedSignature(List<AnnotHandlerEventArgs> annotlist)
         {
             if (annotlist == null || annotlist.Count == 0)
@@ -297,11 +301,15 @@ namespace PDF_Master.ViewModels.Tools
 
             var signAnnot = viewContentViewModel.AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
             if (signAnnot == null)
-            {
-                if (annot.EventType == AnnotArgsType.AnnotStamp)
-                {
-                    StrAnnotToolChecked = "Stamp";
-                }
+            {
+                //var key = ToolExpandDict.FirstOrDefault(q => q.Value == annot.EventType);
+                //if (!string.IsNullOrEmpty(StrAnnotToolChecked))
+                //    StrAnnotToolChecked = key.Key.ToString();
+
+                //if (annot.EventType == AnnotArgsType.AnnotStamp)
+                //{
+                //    StrAnnotToolChecked = "Stamp";
+                //}
                 //else
                 //{
                 //    StrAnnotToolChecked = "";
@@ -309,7 +317,8 @@ namespace PDF_Master.ViewModels.Tools
             }
             else
             {
-                GetSignature();
+                viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                //GetSignature();
                 StrAnnotToolChecked = "Signature";
             }
         }
@@ -340,7 +349,7 @@ namespace PDF_Master.ViewModels.Tools
 
         //选中和非选中注释
         private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
-        {
+        {
             if (e != null)
             {
                 if (e.IsMouseRightActive)
@@ -363,8 +372,14 @@ namespace PDF_Master.ViewModels.Tools
 
                             if (Settings.Default.AppProperties.InitialVIew.AutoExpandProperty
                                 && annot.EventType != AnnotArgsType.AnnotStamp && StrAnnotToolChecked != "Signature"
-                                && annot.EventType != AnnotArgsType.AnnotLink)
-                                ShowPropertyPanel(true);
+                                && annot.EventType != AnnotArgsType.AnnotLink)
+                            {
+                                ShowPropertyPanel(true);
+                            }
+                            if (StrAnnotToolChecked == "Signature")
+                            {
+                                StrAnnotToolChecked = "";
+                            }
                         }
                         else
                         {
@@ -494,7 +509,12 @@ namespace PDF_Master.ViewModels.Tools
                 }
             }
             else
-            {
+            {
+                if (viewContentViewModel.CurrentBar != "TabItemAnnotation")
+                {
+                    return;
+                }
+
                 if (StrAnnotToolChecked == "Link")
                 {
                     if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
@@ -870,14 +890,14 @@ namespace PDF_Master.ViewModels.Tools
                     {
                         case ActionType.Add:
 
-                            //if (editEvent.EditAnnotArgs is StickyAnnotArgs stickyAnnotArgs)
-                            //{
-                            //    PDFViewer.SelectAnnotation(stickyAnnotArgs.PageIndex, stickyAnnotArgs.AnnotIndex);
-                            //}
-                            //if (editEvent.EditAnnotArgs is FreeTextAnnotArgs freeTextAnnotArgs)
-                            //{
-                            //    PDFViewer.SelectAnnotation(freeTextAnnotArgs.PageIndex, freeTextAnnotArgs.AnnotIndex);
-                            //}
+                            if (editEvent.EditAnnotArgs is StickyAnnotArgs stickyAnnotArgs)
+                            {
+                                PDFViewer.SelectAnnotation(stickyAnnotArgs.PageIndex, stickyAnnotArgs.AnnotIndex);
+                            }
+                            if (editEvent.EditAnnotArgs is FreeTextAnnotArgs freeTextAnnotArgs)
+                            {
+                                PDFViewer.SelectAnnotation(freeTextAnnotArgs.PageIndex, freeTextAnnotArgs.AnnotIndex);
+                            }
                             //BOTA
                             bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
 
@@ -991,6 +1011,11 @@ namespace PDF_Master.ViewModels.Tools
         }
 
         //阅读页悬浮相应
+        /// <summary>
+        /// 阅读页鼠标悬浮在注释上的虚线
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void PDFViewer_AnnotHoverHandler(object sender, AnnotHoverData e)
         {
             if (e != null && e.DrawContext != null)

+ 33 - 19
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -146,6 +146,7 @@ namespace PDF_Master.ViewModels.Tools
             ToolExpandDict.Add("Arrow", AnnotArgsType.AnnotLine);
             ToolExpandDict.Add("Line", AnnotArgsType.AnnotLine);
             ToolExpandDict.Add("Link", AnnotArgsType.AnnotLink);
+            ToolExpandDict.Add("Stamp", AnnotArgsType.AnnotStamp);
         }
 
         //注释工具按钮悬浮文案
@@ -764,25 +765,33 @@ namespace PDF_Master.ViewModels.Tools
             var drawRectTuple = DrawRectCreateAnnot();
             if (drawRectTuple != null)
             {
-                //annotArgs.PageIndex = drawRectTuple.Item1;
-                //annotArgs.ClientRect = drawRectTuple.Item2;
-                //PDFViewer.CreatePageAnnot(drawRectTuple.Item1, annotArgs);
-
-                LinkAnnotArgs linkArgs = new LinkAnnotArgs();
-                linkArgs.ClientRect = drawRectTuple.Item2;
-                linkArgs.URI = string.Empty;
-                linkArgs.LinkType = LINK_TYPE.GOTO;
-                linkArgs.DestIndex = drawRectTuple.Item1;
-                PDFViewer.CreatePageAnnot(drawRectTuple.Item1, linkArgs);
-                //BtnLinkIsChecked = true;
-                //List<AnnotHandlerEventArgs> lists = new List<AnnotHandlerEventArgs>();
-                //lists.Add(linkArgs);
-                //propertyPanel.IsAddLink = true;
-
-                //annotArgs = GetLink(lists);
-                //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
-                //PDFViewer.SetToolParam(annotArgs);
-                //viewContentViewModel.IsPropertyOpen = true;
+                if (annotArgs is LinkAnnotArgs linkAnnot)
+                {
+                    //annotArgs.PageIndex = drawRectTuple.Item1;
+                    //annotArgs.ClientRect = drawRectTuple.Item2;
+                    //PDFViewer.CreatePageAnnot(drawRectTuple.Item1, annotArgs);
+
+                    LinkAnnotArgs linkArgs = new LinkAnnotArgs();
+                    linkArgs.ClientRect = drawRectTuple.Item2;
+                    linkArgs.URI = string.Empty;
+                    linkArgs.LinkType = LINK_TYPE.GOTO;
+                    linkArgs.DestIndex = drawRectTuple.Item1;
+                    PDFViewer.CreatePageAnnot(drawRectTuple.Item1, linkArgs);
+                    //BtnLinkIsChecked = true;
+                    //List<AnnotHandlerEventArgs> lists = new List<AnnotHandlerEventArgs>();
+                    //lists.Add(linkArgs);
+                    //propertyPanel.IsAddLink = true;
+
+                    //annotArgs = GetLink(lists);
+                    //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                    //PDFViewer.SetToolParam(annotArgs);
+                    //viewContentViewModel.IsPropertyOpen = true;
+                }
+                if (annotArgs is SquareAnnotArgs squareAnnot)
+                {
+                    squareAnnot.ClientRect = drawRectTuple.Item2;
+                    PDFViewer.CreatePageAnnot(drawRectTuple.Item1, squareAnnot);
+                }
             }
         }
 
@@ -1150,6 +1159,11 @@ namespace PDF_Master.ViewModels.Tools
             if (stampAnnotArgs != null)
                 stampAnnotArgsList.Add(stampAnnotArgs);
 
+            if (string.IsNullOrEmpty(StrAnnotToolChecked))
+            {
+                viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                return stampAnnotArgs;
+            }
             AddToPropertyPanel("StampAnnotProperty", null, stampAnnotArgsList);
             return stampAnnotArgs;
         }

+ 8 - 3
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -208,6 +208,10 @@ namespace PDF_Master.ViewModels.Tools
                 PDFViewer.ToolManager.EnableClickCreate = false;
                 PDFViewer.SetMouseMode(MouseModes.PanTool);
                 ShowPropertyPanel(false);
+                if (string.IsNullOrEmpty(StrAnnotToolChecked))
+                {
+                    events.GetEvent<LinkAnnotTipCloseEvent>().Publish(new LinkAnnotTipCloseArgs() { UniCode = App.mainWindowViewModel.SelectedItem.Unicode });
+                }
             }
 
             if (dictVar["isTemplateAnnot"] == false && annotArgs == null)
@@ -1571,10 +1575,11 @@ namespace PDF_Master.ViewModels.Tools
             if (KeyEventsHelper.IsSingleKey(Key.Escape))
             {
                 //BtnHandIsChecked = true;
-                PDFViewer.SetMouseMode(MouseModes.PanTool);
+
                 PDFViewer.ClearSelectAnnots();
                 StrAnnotToolChecked = "";
                 ShowPropertyPanel(false);
+                PDFViewer.SetMouseMode(MouseModes.PanTool);
             }
             else if (KeyEventsHelper.IsModifierKey(ModifierKeys.Shift, Key.None))
             {
@@ -1699,8 +1704,8 @@ namespace PDF_Master.ViewModels.Tools
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
             StrAnnotToolChecked = "";
-            UnBindingPDFViewerHandler();
-            UnBindingEvent();
+            //UnBindingPDFViewerHandler();
+            //UnBindingEvent();
         }
 
         public void OnNavigatedTo(NavigationContext navigationContext)

+ 4 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -253,6 +253,9 @@ namespace PDF_Master.ViewModels
         //若point不赋值或从列表中找不到point,系统会提供默认值为(0,0)的新point,所以改用Tuple<int,int>
         public List<FillAndSignIsShape> FillAndSign = new List<FillAndSignIsShape>();
 
+        /// <summary>
+        /// 签名列表
+        /// </summary>
         public List<Tuple<int, int>> AnnotSignatures = new List<Tuple<int, int>>();
 
         /// <summary>
@@ -1106,7 +1109,7 @@ namespace PDF_Master.ViewModels
                         PDFViewer.Document.Release();
                         PDFViewer.InitDocument(filePath);
                         PDFViewer.Document.UnlockWithPassword(result.Password);
-                    } 
+                    }
                     DialogParameters value = new DialogParameters();
                     value.Add(ParameterNames.PDFDocument, PDFViewer.Document);
                     dialogs.ShowDialog(DialogNames.DeleteSafetySettingsDialog, value, e => { });

+ 57 - 56
PDF Office/Views/BOTA/OutLineControl.xaml

@@ -16,6 +16,60 @@
             <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="pack://application:,,,/PDF Master;component/Styles/OutLineItemStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
+
+            <ContextMenu x:Key="OutLineItemMenu">
+                <MenuItem
+                                        x:Name="AddMenu"
+                                        Click="AddMenu_Click"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Add}" />
+                <MenuItem
+                                        x:Name="AddChlidMenu"
+                                        Click="AddChlidMenu_Click"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_AddSub}" />
+                <MenuItem
+                                        x:Name="AddParentMenu"
+                                        Click="AddParentMenu_Click"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_AddLevel}"
+                                        IsEnabled="{Binding CanAddParent}" />
+
+                <MenuItem
+                                        x:Name="DeleteMenu"
+                                        Click="DeleteMenu_Click"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Delete}" />
+
+                <MenuItem
+                                        x:Name="RenameMenu"
+                                        Click="RenameMenu_Click"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Rename}" />
+                <MenuItem
+                                        x:Name="ChangeDestinationMenu"
+                                        Click="ChangeDestinationMenu_Click"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Change}" />
+
+                <MenuItem
+                                        x:Name="UpgradeMenu"
+                                        Click="UpgradeMenu_Click"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Up}"
+                                        IsEnabled="{Binding CanUp}" />
+                <MenuItem
+                                        x:Name="DowngradeMenu"
+                                        Click="DowngradeMenu_Click"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Down}"
+                                        IsEnabled="{Binding CanDown}" />
+            </ContextMenu>
+            <!--  圆角 https://wpf.2000things.com/2012/05/11/556-clipping-to-a-border-using-an-opacity-mask  -->
+            <ToolTip x:Key="OutLineItemToolTip"
+                                        Width="320"
+                                        Height="120"
+                                        Closed="ToolTip_Closed"
+                                        Opened="ToolTip_Opened"
+                                        Style="{StaticResource ErrorRoundedTooltip}">
+                <customcontrol:CustomImageControl
+                                            Width="320"
+                                            Height="120"
+                                            HorizontalAlignment="Stretch"
+                                            VerticalAlignment="Stretch" />
+            </ToolTip>
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid Background="Transparent">
@@ -163,68 +217,13 @@
                 PreviewMouseMove="OutlineView_PreviewMouseMove"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 VirtualizingPanel.ScrollUnit="Pixel"
+                LostFocus="OutlineView_LostFocus"
                 Visibility="{Binding ElementName=NoOutlineStackPanel, Path=Visibility, Converter={StaticResource UnVisivleConvert}}">
                 <TreeView.ItemTemplate>
                     <HierarchicalDataTemplate DataType="{x:Type model:OutlineNode}" ItemsSource="{Binding Path=Chlidlist}">
                         <Grid>
-                            <Grid.ContextMenu>
-                                <ContextMenu>
-                                    <MenuItem
-                                        x:Name="AddMenu"
-                                        Click="AddMenu_Click"
-                                        Header="{x:Static mainPageLoader:MainPage.Outline_Add}" />
-                                    <MenuItem
-                                        x:Name="AddChlidMenu"
-                                        Click="AddChlidMenu_Click"
-                                        Header="{x:Static mainPageLoader:MainPage.Outline_AddSub}" />
-                                    <MenuItem
-                                        x:Name="AddParentMenu"
-                                        Click="AddParentMenu_Click"
-                                        Header="{x:Static mainPageLoader:MainPage.Outline_AddLevel}"
-                                        IsEnabled="{Binding CanAddParent}" />
-
-                                    <MenuItem
-                                        x:Name="DeleteMenu"
-                                        Click="DeleteMenu_Click"
-                                        Header="{x:Static mainPageLoader:MainPage.Outline_Delete}" />
 
-                                    <MenuItem
-                                        x:Name="RenameMenu"
-                                        Click="RenameMenu_Click"
-                                        Header="{x:Static mainPageLoader:MainPage.Outline_Rename}" />
-                                    <MenuItem
-                                        x:Name="ChangeDestinationMenu"
-                                        Click="ChangeDestinationMenu_Click"
-                                        Header="{x:Static mainPageLoader:MainPage.Outline_Change}" />
-
-                                    <MenuItem
-                                        x:Name="UpgradeMenu"
-                                        Click="UpgradeMenu_Click"
-                                        Header="{x:Static mainPageLoader:MainPage.Outline_Up}"
-                                        IsEnabled="{Binding CanUp}" />
-                                    <MenuItem
-                                        x:Name="DowngradeMenu"
-                                        Click="DowngradeMenu_Click"
-                                        Header="{x:Static mainPageLoader:MainPage.Outline_Down}"
-                                        IsEnabled="{Binding CanDown}" />
-                                </ContextMenu>
-                            </Grid.ContextMenu>
                             <Grid x:Name="ContentPanel">
-                                <Grid.ToolTip>
-                                    <!--  圆角 https://wpf.2000things.com/2012/05/11/556-clipping-to-a-border-using-an-opacity-mask  -->
-                                    <ToolTip
-                                        Width="320"
-                                        Height="120"
-                                        Closed="ToolTip_Closed"
-                                        Opened="ToolTip_Opened"
-                                        Style="{StaticResource ErrorRoundedTooltip}">
-                                        <customcontrol:CustomImageControl
-                                            Width="320"
-                                            Height="120"
-                                            HorizontalAlignment="Stretch"
-                                            VerticalAlignment="Stretch" />
-                                    </ToolTip>
-                                </Grid.ToolTip>
                                 <Grid.ColumnDefinitions>
                                     <ColumnDefinition />
                                     <ColumnDefinition Width="auto" />
@@ -282,6 +281,8 @@
                 </TreeView.ItemTemplate>
                 <TreeView.ItemContainerStyle>
                     <Style BasedOn="{StaticResource OutLineItemStyle}" TargetType="TreeViewItem">
+                        <Setter Property="ContextMenu" Value="{StaticResource  OutLineItemMenu}" />
+                        <Setter Property="ToolTip" Value="{StaticResource  OutLineItemToolTip}" />
                         <EventSetter Event="PreviewMouseLeftButtonUp" Handler="TreeViewItem_PreviewMouseLeftButtonUp" />
                         <EventSetter Event="PreviewMouseLeftButtonDown" Handler="TreeViewItem_PreviewMouseLeftButtonDown" />
                     </Style>

+ 1 - 1
PDF Office/Views/Dialog/SignatureCreateDialog.xaml.cs

@@ -77,7 +77,7 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
             BtnTextClear.Content = App.MainPageLoader.GetString("Signatur_DialogClear");
 
             DrawItem.Header = App.MainPageLoader.GetString("Signatur_DialogDraw");
-            DrawHint.Text = App.MainPageLoader.GetString("Signatur_DialogPictureHint");
+            DrawHint.Text = App.MainPageLoader.GetString("Signatur_DialogDrawHint");
             BtnDrawClear.Content = App.MainPageLoader.GetString("Signatur_DialogClear");
 
             PictureItem.Header = App.MainPageLoader.GetString("Signatur_DialogPicture");

+ 25 - 9
PDFSettings/APPSettingProperties.cs

@@ -15,14 +15,18 @@ namespace PDFSettings
         public DescriptionPropertyClass Description = new DescriptionPropertyClass();
         public InitialVIewPropertyClass InitialVIew = new InitialVIewPropertyClass();
         public AnnotatePropertyClass Annotate = new AnnotatePropertyClass();
+
         //自定义主题色保存
         public List<System.Windows.Media.Color> CustomColorList = new List<System.Windows.Media.Color>();
+
         //动态图章日期格式   下拉列表索引
         public int DateMode = 0;
 
         public string CustomAuthor = "PDF Reader Pro";
+
         //ToolTabControl 选中项
         public int TabSelectedIndex = 0;
+
         //是否固定
         public bool IsFixed = true;
 
@@ -31,6 +35,7 @@ namespace PDFSettings
 
         //文件源路径集合
         public List<string> CustomStampFilePathLists = new List<string>();
+
         public List<string> SignatureFilePathLists = new List<string>();
 
         public string culture = System.Globalization.CultureInfo.CurrentUICulture.ToString();
@@ -40,7 +45,6 @@ namespace PDFSettings
         /// </summary>
         public int RecentFileListMode = 0;
 
-
         /// <summary>
         /// 删除最近文件记录时是否显示询问弹窗
         /// </summary>
@@ -84,7 +88,6 @@ namespace PDFSettings
         /// </summary>
         public int AutoSaveInterval = 5;
 
-
         /// <summary>
         /// 关闭文档 弹出保存提示
         /// </summary>
@@ -133,7 +136,6 @@ namespace PDFSettings
         /// </summary>
         public bool RememberBOTA = false;
 
-
         /// <summary>
         /// 有大纲时默认显示大纲列表
         /// </summary>
@@ -177,7 +179,7 @@ namespace PDFSettings
         /// <summary>
         /// 高亮链接
         /// </summary>
-        public bool HighlightLink = true; 
+        public bool HighlightLink = true;
     }
 
     public class AnnotatePropertyClass
@@ -186,14 +188,29 @@ namespace PDFSettings
 
         public Color HighLightColor = Color.FromArgb(0xFF, 0xFF, 0xC7, 0x00);
         public Color UnderLineColor = Color.FromArgb(0xFF, 0xFC, 0x1F, 0x1F);
+
+        /// <summary>
+        /// 删除线
+        /// </summary>
         public Color StrikethroughColor = Color.FromArgb(0xFF, 0xFC, 0x1F, 0x1F);
+
         public Color FreeHandColor = Color.FromArgb(0xFF, 0xFC, 0x1F, 0x1F);
+
+        /// <summary>
+        /// 文本字体颜色
+        /// </summary>
         public Color TextAnnoteColor = Colors.Black;
-        public Color NoteAnnoteColor = Color.FromArgb(0xFF, 0x25, 0x26, 0x29);
+
+        /// <summary>
+        /// 便签默认颜色
+        /// </summary>
+        /// #FFD573
+        public Color NoteAnnoteColor = Color.FromArgb(0xFF, 0xFF, 0xD5, 0x73);
+
         public Color RectangleBorderColor = Color.FromArgb(0xFF, 0xFC, 0x1F, 0x1F);
-        public Color RectangleFillColor = Colors.White;
+        public Color RectangleFillColor = Colors.Transparent;
         public Color CircleBorderColor = Color.FromArgb(0xFF, 0xFC, 0x1F, 0x1F);
-        public Color CircleFillColor = Colors.White;
+        public Color CircleFillColor = Colors.Transparent;
         public Color LineColor = Color.FromArgb(0xFF, 0xFC, 0x1F, 0x1F);
         public Color ArrowColor = Colors.Red;
 
@@ -212,5 +229,4 @@ namespace PDFSettings
         /// </summary>
         public string AnchoredFamaily = "Helvetica";
     }
-
-}
+}