소스 검색

【PDFView】- 页码指示器显示优化

liaoxiaoyue 1 년 전
부모
커밋
22185b9510

+ 4 - 0
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -70,6 +70,7 @@ extension KMMainViewController {
                 if mouseEntered == false  && self.isEditPage == false {
                     self.tipCurrentPageBox.fillColor = NSColor(calibratedRed: 0, green: 0, blue: 0, alpha: 0.5)
                     self.currentPageLabel.textColor = NSColor.white
+                    self.currentPageLabel.isHidden = false
                     self.pageCountLabel.textColor = NSColor.white
                     self.currentPageWidthConstraint.constant = NSString(string: self.currentPageLabel.stringValue).boundingRect(with: NSSize(width: 1000, height: 1000)).size.width + 8
                     DispatchQueue.main.async {
@@ -102,6 +103,9 @@ extension KMMainViewController {
     
     func hiddenPageIndicator() {
         DispatchQueue.main.async {
+            self.currentPageLabel.isEditable = false
+            self.currentPageLabel.isHidden = true
+            self.currentPageLabel.isSelectable = false
             self.tipCurrentPageBox.fillColor = NSColor.clear
             self.currentPageLabel.textColor = NSColor.clear
             self.pageCountLabel.textColor = NSColor.clear

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

@@ -754,6 +754,8 @@ import Cocoa
         self.currentPageWidthConstraint.constant = NSString(string: self.currentPageLabel.stringValue).boundingRect(with: NSSize(width: 1000, height: 1000)).size.width + 8
         self.tipCurrentPageBox.fillColor = NSColor(calibratedRed: 0, green: 0, blue: 0, alpha: 0.5)
         self.currentPageLabel.textColor = NSColor.white
+        self.currentPageLabel.isHidden = false
+        self.currentPageLabel.isSelectable = false
         self.pageCountLabel.textColor = NSColor.white
 
         DispatchQueue.main.async {