瀏覽代碼

【注释】文字未Helvetica,选择Bold,Helvetica变成Arial

OYXH\oyxh 1 年之前
父節點
當前提交
c278a57cd9

+ 24 - 1
PDF Office/Model/AnnotPanel/FontBoard.cs

@@ -398,6 +398,7 @@ namespace PDF_Master.Model.AnnotPanel
                         FontFamilySelectedIndex = 0;
                         break;
                     case "Helvetica":
+                    case "Arial":
                         FontFamilySelectedIndex = 1;
                         break;
                     case "Times New Roman":
@@ -467,7 +468,24 @@ namespace PDF_Master.Model.AnnotPanel
         public ComboDataItem CurrrentFontWeightStyle
         {
             get { return _currrentFontWeightStyle; }
-            set => SetProperty(ref _currrentFontWeightStyle, value);
+            set {
+                SetProperty(ref _currrentFontWeightStyle, value);
+                switch (value.Content.ToString())
+                {
+                    case "Regular":
+                        FontStyleSelectedIndex = 0;
+                        break;
+                    case "Bold":
+                        FontStyleSelectedIndex = 1;
+                        break;
+                    case "Italic":
+                        FontStyleSelectedIndex = 2;
+                        break;
+                    case "Bold Italic":
+                        FontStyleSelectedIndex = 3;
+                        break;
+                }
+            }
         }
 
         public void UpdateFontWeight_Style()
@@ -576,6 +594,11 @@ namespace PDF_Master.Model.AnnotPanel
 
         public void GetCurrentFontFamily(string fontFamily, string uiStr)
         {
+            if(fontFamily == "Arial")
+            {
+                fontFamily = "Helvetica";
+                uiStr = "Helvetica";
+            }
             CurrentFontFamily = new ComboDataItem(fontFamily, uiStr);
         }
 

+ 7 - 3
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -1190,11 +1190,15 @@ namespace PDF_Master.ViewModels.BOTA
                             }
 
                             await Task.Delay(5);//不加延时 每页的第一个注释不会展开
-                            if (!listBox.SelectedItems.Contains(AnnotationListItems[k]))
+                            if (ViewContentViewModel.IsMultiSelected == false)
                             {
-                                listBox.SelectedItem = AnnotationListItems[k];
-                                //PdfViewer.SelectAnnotation(args.PageIndex, args.AnnotIndex);
+                                if (!listBox.SelectedItems.Contains(AnnotationListItems[k]))
+                                {
+                                    listBox.SelectedItem = AnnotationListItems[k];
+                                    //PdfViewer.SelectAnnotation(args.PageIndex, args.AnnotIndex);
+                                }
                             }
+                            
 
                             ExpandGroupHeader(AnnotationListItems[k], listBox);
 

+ 6 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -269,6 +269,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         //从预设样式设置文本
+        /// <summary>
+        /// 从预设样式设置文本
+        /// </summary>
         private void SelectedPresetFont()
         {
             if (FontVm.CurrentPresetFont != null)
@@ -301,6 +304,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         //设置文本字重、样式
+        /// <summary>
+        /// 设置文本字重、样式
+        /// </summary>
         private void FontStyleWeightChanged()
         {
             if (FontVm.CurrrentFontWeightStyle != null)

+ 12 - 11
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -489,6 +489,7 @@ namespace PDF_Master.ViewModels.Tools
                 {
                     if (e.AnnotItemsList.Count == 1)
                     {
+                        viewContentViewModel.IsMultiSelected = false;
                         //IsAnnotCreateReset:是否为创建注释的状态
                         if (e.IsAnnotCreateReset == false)
                         {
@@ -659,7 +660,7 @@ namespace PDF_Master.ViewModels.Tools
                     {
                         //框选注释
                         PropertyPanel.annotlists = e.AnnotItemsList;
-
+                        viewContentViewModel.IsMultiSelected= true;
                         viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
                         ShowPropertyPanel(true);
 
@@ -1181,16 +1182,16 @@ namespace PDF_Master.ViewModels.Tools
                             break;
 
                         case ActionType.Modify:
-                            if (string.IsNullOrEmpty(StrAnnotToolChecked) == false)
-                            {
-                                List<AnnotHandlerEventArgs> selectedArgs = new List<AnnotHandlerEventArgs>() { annot };
-                                switch (annot.EventType)
-                                {
-                                    case AnnotArgsType.AnnotFreeText://文本
-                                        GetFreetext(selectedArgs);
-                                        break;
-                                }
-                            }
+                            //if (string.IsNullOrEmpty(StrAnnotToolChecked) == false)
+                            //{
+                            //    List<AnnotHandlerEventArgs> selectedArgs = new List<AnnotHandlerEventArgs>() { annot };
+                            //    switch (annot.EventType)
+                            //    {
+                            //        case AnnotArgsType.AnnotFreeText://文本
+                            //            GetFreetext(selectedArgs);
+                            //            break;
+                            //    }
+                            //}
                             if (viewModel != null)
                             {
                                 int pageindex = editEvent.PageIndex;

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

@@ -204,7 +204,7 @@ namespace PDF_Master.ViewModels
         #endregion 文案
 
         #region 属性、变量
-
+        public bool IsMultiSelected { get; set; } = false;
         public OpenFileInfo OpenFileInfo = null;
         public CPDFViewer PDFViewer { get; set; }
         public bool ReadModeIsShowProperty { get; set; } = false;

+ 2 - 0
PDF Office/Views/BOTA/AnnotationContent.xaml.cs

@@ -1,5 +1,6 @@
 using ComPDFKit.PDFAnnotation;
 using ComPDFKit.PDFPage;
+using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Master.DataConvert;
 using PDF_Master.EventAggregators;
@@ -329,6 +330,7 @@ namespace PDF_Master.Views.BOTA
             //AnnotationList.ScrollIntoView(AnnotationList.Items[0]);
             if (a1 == 1)
             {
+                //if(viewModel.ViewContentViewModel.IsPropertyOpen==false)
                 viewModel.ListBoxItemPreviewMouseLeftButtonDown.Execute((sender as ListBox).SelectedItems[0]);
             }
             else if (a1 > 1)