Forráskód Böngészése

【工具栏】- 点击页面显示时工具栏状态刷新

liaoxiaoyue 1 éve
szülő
commit
68cd33e85e

+ 4 - 2
PDF Office/PDF Office/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -386,8 +386,10 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
     }
     
     func toolbarViewController(_ viewController: KMToolbarViewController, clickMode toolMode: KMToolbarViewType, toolbar toolbarItem: KMToolBoxItem) {
-        if toolMode != .Magnify && toolMode != .Move && toolMode != .Select && toolMode != .SelectZoom && toolMode != .LeftPanel && toolMode != .RightPanel {
+        if self.lastItemBox != nil {
             self.lastItemBox.isSelected = false
+        }
+        if toolMode != .Magnify && toolMode != .Move && toolMode != .Select && toolMode != .SelectZoom && toolMode != .LeftPanel && toolMode != .RightPanel {
             if(toolMode == self.toolbarType) {
                 toolbarItem.isSelected = false
             } else {
@@ -395,7 +397,7 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
                 self.lastItemBox = toolbarItem
             }
         } else {
-            if(toolMode != self.toolbarType) {
+            if(toolMode != self.toolbarType && toolMode != .LeftPanel) {
                 let item : KMToolBoxItem = (self.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentAnnotationToolbarItemIdentifier))!
                 item.isSelected = true
                 self.lastItemBox = item