소스 검색

【fix】【测量】测量工具栏需要有选中状态

tangchao 6 달 전
부모
커밋
4b47447567

+ 2 - 1
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift

@@ -62,7 +62,8 @@ extension KMToolbarItemView {
                         self.nameBtn.setTitleColor(color: Self.fetchTextSelectedColor())
                     }
                     if(self.needExpandAction) {
-                        self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownSel")
+//                        self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownSel")
+                        self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
                     }
                 } else {
                     if (self.needExpandAction) {

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -2395,6 +2395,7 @@ extension KMToolbarViewController {
             item?.titleName = NSLocalizedString("Measure", comment: "")
             item?.boxImagePosition = .imageExpandLeft
             item?.needExpandAction = true
+            item?.btnAction =  #selector(_itemAction)
             let menuItem = NSMenuItem.init(title: NSLocalizedString("Measure", comment: ""), action: nil, target: self)
             let subMenu = NSMenu()
             subMenu.addItem(title: NSLocalizedString("Line", comment: ""), action: #selector(_measureAction), target: self, tag: 1)

+ 16 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -4352,6 +4352,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     distanceMeasureInfoWindowController?.angleLabel.stringValue = ""
                     distanceMeasureInfoWindowController?.xLabel.stringValue = ""
                     distanceMeasureInfoWindowController?.yLabel.stringValue = ""
+                    
+                    self.toolbarController.findItem(KMToolbarMeasureItemIdentifier)?.isSelected = true
                 } else if index == 2 {
                     self.listView.annotationType = .polyLine
 
@@ -4363,6 +4365,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     perimeterMeasureInfoWindowController?.showWindow(nil)
                     perimeterMeasureInfoWindowController?.lengthLabel.stringValue = ""
                     perimeterMeasureInfoWindowController?.angleLabel.stringValue = ""
+                    
+                    self.toolbarController.findItem(KMToolbarMeasureItemIdentifier)?.isSelected = true
                 } else if index == 3 {
                     self.listView.annotationType = .polyGon
 
@@ -4374,6 +4378,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     areaMeasureInfoWindowController?.showWindow(nil)
                     areaMeasureInfoWindowController?.areaLabel.stringValue = ""
                     areaMeasureInfoWindowController?.angleLabel.stringValue = ""
+                    
+                    self.toolbarController.findItem(KMToolbarMeasureItemIdentifier)?.isSelected = true
                 } else if index == 4 {
                     self.listView.annotationType = .square
 
@@ -4385,6 +4391,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     areaMeasureInfoWindowController?.showWindow(nil)
                     areaMeasureInfoWindowController?.areaLabel.stringValue = ""
                     areaMeasureInfoWindowController?.angleLabel.stringValue = ""
+                    
+                    self.toolbarController.findItem(KMToolbarMeasureItemIdentifier)?.isSelected = true
                 } else {
                     if let isVisible = distanceMeasureInfoWindowController!.window?.isVisible, isVisible {
                         distanceMeasureInfoWindowController?.hideFloatingWindow()
@@ -4393,6 +4401,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     } else if let isVisible = areaMeasureInfoWindowController!.window?.isVisible, isVisible {
                         areaMeasureInfoWindowController?.hideFloatingWindow()
                     }
+                    
+                    self.toolbarController.findItem(KMToolbarMeasureItemIdentifier)?.isSelected = false
                 }
                 
                 self.rightSideViewController.reloadDataWithPDFView(pdfView: listView, isShow: true)
@@ -4585,6 +4595,12 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                         FMTrackEventManager.defaultManager.trackEvent(event: "Tbr", withProperties: ["Tbr_Btn": "Btn_Tbr_DigitalSignature"])
                     }
                     self.enterDigitalSign()
+                } else if itemID == KMToolbarMeasureItemIdentifier {
+                    if toolbarItem.isSelected {
+                        toolbarItem.isSelected = false
+                        self.listView.toolMode = .textToolMode
+                        self.listView.annotationType = .unkown
+                    }
                 }
             }
         }

+ 2 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -617,6 +617,8 @@ import Cocoa
         } else if areaMeasureInfoWindowController?.window?.isVisible == true {
             areaMeasureInfoWindowController?.hideFloatingWindow()
         }
+        
+        self.toolbarController.findItem(KMToolbarMeasureItemIdentifier)?.isSelected = false
     }
     
     // MARK: Set Methods

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
PDF Office/PDF Master/Strings/ar.lproj/Localizable.strings


+ 1 - 0
PDF Office/PDF Master/Strings/pt.lproj/Localizable.strings

@@ -4533,3 +4533,4 @@
  documentos permite identificar rapidamente diferenças entre duas versões de um PDF para um melhor processo de revisão.";
 "Right click a color and select “Change Color...”" = "Clique com o botão direito do rato numa cor e selecione “Alterar cor...”";
 "Right-click on the toolbar, select “Customize Toolbar“ in drop-down bar. Then reorder, add or remove tools displayed in the toolbar by simple drag and drop." = "Clique com o botão direito do rato na barra de ferramentas e selecione “Personalizar barra de ferramentas” na barra pendente. Em seguida, reordene, adicione ou remova ferramentas apresentadas na barra de ferramentas simplesmente arrastando e largando.";
+"Show/Hide Panel" = "Mostrar/ocultar painel";