Browse Source

【暗黑】编辑PDF,属性面板 -- 优化

lizhe 11 months ago
parent
commit
858cfd6366

+ 62 - 29
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditImagePropertyViewController.swift

@@ -152,9 +152,9 @@ class KMEditImagePropertyViewController: NSViewController {
         self.opacityTitleLabel.textColor = KMAppearance.Layout.h0Color()
         
         self.imageBox.borderWidth = 1
-        self.imageBox.borderColor = NSColor.km_init(hex: "#DFE1E5")
+//        self.imageBox.borderColor = NSColor.km_init(hex: "#DFE1E5")
         self.imageBox.cornerRadius = 4
-        self.imageBox.fillColor = NSColor.km_init(hex: "#FFFFFF")
+//        self.imageBox.fillColor = NSColor.km_init(hex: "#FFFFFF")
         
         self.imageBox.borderColor = KMAppearance.Interactive.s0Color()
         self.imageBox.fillColor = KMAppearance.Layout.l1Color()
@@ -170,10 +170,19 @@ class KMEditImagePropertyViewController: NSViewController {
         opacityVC?.addItems(withObjectValues: ["25%","50%","75%","100%"])
         opacityVC?.selectItem(at: 0)
         opacityVC?.delete = self
-//        opacityVC?.background = KMAppearance.Layout.l1Color()
-//        opacityVC?.background_hov = KMAppearance.Layout.l1Color()
-//        opacityVC?.textColor = KMAppearance.Layout.h0Color()
-//        opacityVC?.textColor_hov = KMAppearance.Layout.h0Color()
+        opacityVC?.borderColor = KMAppearance.Interactive.s0Color()
+        opacityVC?.borderColor_disabled = KMAppearance.Interactive.s0Color()
+        opacityVC?.background = KMAppearance.Layout.l1Color()
+        opacityVC?.background_hov = KMAppearance.Layout.l1Color()
+        opacityVC?.background_focus = KMAppearance.Layout.l1Color()
+        opacityVC?.background_disabled = KMAppearance.Layout.l1Color()
+        opacityVC?.textColor = KMAppearance.Layout.h1Color()
+        opacityVC?.textColor_hov = KMAppearance.Layout.h1Color()
+        opacityVC?.textColor_focus = KMAppearance.Layout.h1Color()
+        opacityVC?.popViewControllerBackground = KMAppearance.Layout.bgColor()
+        opacityVC?.popViewControllerTextColor = KMAppearance.Layout.h0Color()
+        opacityVC?.popViewControllerEnterFillColor = KMAppearance.Interactive.s0Color()
+        opacityVC?.updateUI()
         
         
         
@@ -185,6 +194,7 @@ class KMEditImagePropertyViewController: NSViewController {
         rotateLeftVC?.action = #selector(leftRotationImageAction)
         rotateLeftVC?.image = NSImage(named: "KMImageNameEditPDFRotationLeft")!
         rotateLeftVC?._image_disabled = NSImage(named: "KMImageNameEditPDFRotationLeft")!
+        rotateLeftVC?.background_hov = KMAppearance.Interactive.s0Color()
         rotateLeftVC?.updateUI()
         
         rotateRightVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
@@ -193,6 +203,7 @@ class KMEditImagePropertyViewController: NSViewController {
         rotateRightVC?.target = self
         rotateRightVC?.action = #selector(rightRotationImageAction)
         rotateRightVC?.image = NSImage(named: "KMImageNameEditPDFRotationRight")!
+        rotateRightVC?.background_hov = KMAppearance.Interactive.s0Color()
         rotateRightVC?.updateUI()
         
         flipHorizontalVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
@@ -201,6 +212,7 @@ class KMEditImagePropertyViewController: NSViewController {
         flipHorizontalVC?.target = self
         flipHorizontalVC?.action = #selector(flipHorizontalImageAction)
         flipHorizontalVC?.image = NSImage(named: "KMImageNameEditPDFFlipHorizontal")!
+        flipHorizontalVC?.background_hov = KMAppearance.Interactive.s0Color()
         flipHorizontalVC?.updateUI()
         
         flipVerticalVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
@@ -209,6 +221,7 @@ class KMEditImagePropertyViewController: NSViewController {
         flipVerticalVC?.target = self
         flipVerticalVC?.action = #selector(flipVerticalImageAction)
         flipVerticalVC?.image = NSImage(named: "KMImageNameEditPDFFlipVertical")!
+        flipVerticalVC?.background_hov = KMAppearance.Interactive.s0Color()
         flipVerticalVC?.updateUI()
         
         // 设置默认状态下的滑块图像
@@ -230,11 +243,14 @@ class KMEditImagePropertyViewController: NSViewController {
         cropVC?.action = #selector(cutImageAction)
         cropVC?.button(type: .Sec, size: .m)
         cropVC?.stringValue = NSLocalizedString("Crop", comment: "")
+        cropVC?.borderColor = KMAppearance.Interactive.s0Color()
+        cropVC?.background = KMAppearance.Layout.l1Color()
+        cropVC?.background_hov = KMAppearance.Layout.l1Color()
+        cropVC?.background_focus = KMAppearance.Layout.l1Color()
+        cropVC?.textColor = KMAppearance.Layout.h1Color()
+        cropVC?.textColor_hov = KMAppearance.Layout.h1Color()
+        cropVC?.textColor_focus = KMAppearance.Layout.h1Color()
         cropVC?.updateUI()
-//        cropVC?.textColor = KMAppearance.Layout.h0Color()
-//        cropVC?.textColor_hov = KMAppearance.Layout.h0Color()
-//        cropVC?.background = KMAppearance.Layout.l1Color()
-//        cropVC?.background_hov = KMAppearance.Layout.l1Color()
         
         
         confirmVC = KMDesignButton.init(withType: .Text)
@@ -243,13 +259,15 @@ class KMEditImagePropertyViewController: NSViewController {
         confirmVC?.target = self
         confirmVC?.action = #selector(confirmVCImageAction)
         confirmVC?.button(type: .Cta, size: .m)
-        confirmVC?.stringValue = NSLocalizedString("Confirm Cut", comment: "")
+        confirmVC?.stringValue = NSLocalizedString("Confirm", comment: "")
+        confirmVC?.borderColor = KMAppearance.Interactive.s0Color()
+        confirmVC?.background = KMAppearance.Layout.l1Color()
+        confirmVC?.background_hov = KMAppearance.Layout.l1Color()
+        confirmVC?.background_focus = KMAppearance.Layout.l1Color()
+        confirmVC?.textColor = KMAppearance.Layout.h1Color()
+        confirmVC?.textColor_hov = KMAppearance.Layout.h1Color()
+        confirmVC?.textColor_focus = KMAppearance.Layout.h1Color()
         confirmVC?.updateUI()
-        confirmVC?.button.keyEquivalent = KMKeyEquivalent.enter
-//        confirmVC?.textColor = KMAppearance.Layout.h0Color()
-//        confirmVC?.textColor_hov = KMAppearance.Layout.h0Color()
-//        confirmVC?.background = KMAppearance.Layout.l1Color()
-//        confirmVC?.background_hov = KMAppearance.Layout.l1Color()
         
         
         cancelVC = KMDesignButton.init(withType: .Text)
@@ -259,11 +277,14 @@ class KMEditImagePropertyViewController: NSViewController {
         cancelVC?.action = #selector(cancelCutImageAction)
         cancelVC?.button(type: .Sec, size: .m)
         cancelVC?.stringValue = NSLocalizedString("Cancel", comment: "")
+        cancelVC?.borderColor = KMAppearance.Interactive.s0Color()
+        cancelVC?.background = KMAppearance.Layout.l1Color()
+        cancelVC?.background_hov = KMAppearance.Layout.l1Color()
+        cancelVC?.background_focus = KMAppearance.Layout.l1Color()
+        cancelVC?.textColor = KMAppearance.Layout.h1Color()
+        cancelVC?.textColor_hov = KMAppearance.Layout.h1Color()
+        cancelVC?.textColor_focus = KMAppearance.Layout.h1Color()
         cancelVC?.updateUI()
-//        cancelVC?.textColor = KMAppearance.Layout.h0Color()
-//        cancelVC?.textColor_hov = KMAppearance.Layout.h0Color()
-//        cancelVC?.background = KMAppearance.Layout.l1Color()
-//        cancelVC?.background_hov = KMAppearance.Layout.l1Color()
         
         replaceVC = KMDesignButton.init(withType: .Text)
         replaceBox.contentView = replaceVC?.view
@@ -272,11 +293,17 @@ class KMEditImagePropertyViewController: NSViewController {
         replaceVC?.action = #selector(replaceImageAction)
         replaceVC?.button(type: .Sec, size: .m)
         replaceVC?.stringValue = NSLocalizedString("Replace", comment: "")
+        replaceVC?.borderColor = KMAppearance.Interactive.s0Color()
+        replaceVC?.borderColor_hov = KMAppearance.Interactive.s0Color()
+        replaceVC?.borderColor_disabled = KMAppearance.Interactive.s0Color()
+        replaceVC?.background = KMAppearance.Layout.l1Color()
+        replaceVC?.background_hov = KMAppearance.Layout.l1Color()
+        replaceVC?.background_focus = KMAppearance.Layout.l1Color()
+        replaceVC?.background_disabled = KMAppearance.Layout.l1Color()
+        replaceVC?.textColor = KMAppearance.Layout.h1Color()
+        replaceVC?.textColor_hov = KMAppearance.Layout.h1Color()
+        replaceVC?.textColor_focus = KMAppearance.Layout.h1Color()
         replaceVC?.updateUI()
-//        replaceVC?.textColor = KMAppearance.Layout.h0Color()
-//        replaceVC?.textColor_hov = KMAppearance.Layout.h0Color()
-//        replaceVC?.background = KMAppearance.Layout.l1Color()
-//        replaceVC?.background_hov = KMAppearance.Layout.l1Color()
         
         exportVC = KMDesignButton.init(withType: .Text)
         exportBox.contentView = exportVC?.view
@@ -285,11 +312,17 @@ class KMEditImagePropertyViewController: NSViewController {
         exportVC?.action = #selector(exportImageAction)
         exportVC?.button(type: .Sec, size: .m)
         exportVC?.stringValue = NSLocalizedString("Export", comment: "")
+        exportVC?.borderColor = KMAppearance.Interactive.s0Color()
+        exportVC?.borderColor_hov = KMAppearance.Interactive.s0Color()
+        exportVC?.borderColor_disabled = KMAppearance.Interactive.s0Color()
+        exportVC?.background = KMAppearance.Layout.l1Color()
+        exportVC?.background_hov = KMAppearance.Layout.l1Color()
+        exportVC?.background_focus = KMAppearance.Layout.l1Color()
+        exportVC?.background_disabled = KMAppearance.Layout.l1Color()
+        exportVC?.textColor = KMAppearance.Layout.h1Color()
+        exportVC?.textColor_hov = KMAppearance.Layout.h1Color()
+        exportVC?.textColor_focus = KMAppearance.Layout.h1Color()
         exportVC?.updateUI()
-//        exportVC?.textColor = KMAppearance.Layout.h0Color()
-//        exportVC?.textColor_hov = KMAppearance.Layout.h0Color()
-//        exportVC?.background = KMAppearance.Layout.l1Color()
-//        exportVC?.background_hov = KMAppearance.Layout.l1Color()
         
         self.noTitleLabel.textColor = NSColor.km_init(hex: "#616469")
         self.noTitleLabel.font = NSFont.SFProTextRegularFont(14)
@@ -313,7 +346,7 @@ class KMEditImagePropertyViewController: NSViewController {
         
         self.opacityTitleLabel.stringValue = NSLocalizedString("Opacity", comment: "")
         self.cropVC?.stringValue = NSLocalizedString("Crop", comment: "")
-        self.confirmVC?.stringValue = NSLocalizedString("Confirm Crop", comment: "")
+        self.confirmVC?.stringValue = NSLocalizedString("Confirm", comment: "")
         self.cancelVC?.stringValue = NSLocalizedString("Cancel", comment: "")
         self.replaceVC?.stringValue = NSLocalizedString("Replace", comment: "")
         self.exportVC?.stringValue = NSLocalizedString("Export", comment: "")

+ 11 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -178,6 +178,8 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         leftAlignmentVC?.action = #selector(leftAlignmentAction)
         leftAlignmentVC?.image = NSImage(named: "KMImageNameEditPDFAlignLeft")!
         leftAlignmentVC?.image_sel = NSImage(named: "KMImageNameEditPDFAlignLeftSelect")!
+        leftAlignmentVC?.background_hov = KMAppearance.Layout.l1Color()
+        leftAlignmentVC?.background_sel = KMAppearance.Layout.l1Color()
         leftAlignmentVC?.updateUI()
         
         centerAlignmentVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
@@ -187,6 +189,8 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         centerAlignmentVC?.action = #selector(centerAlignmentAction)
         centerAlignmentVC?.image = NSImage(named: "KMImageNameEditPDFAlignCenter")!
         centerAlignmentVC?.image_sel = NSImage(named: "KMImageNameEditPDFAlignCenterSelect")!
+        centerAlignmentVC?.background_hov = KMAppearance.Layout.l1Color()
+        centerAlignmentVC?.background_sel = KMAppearance.Layout.l1Color()
         centerAlignmentVC?.updateUI()
         
         rightAlignmentVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
@@ -196,9 +200,11 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         rightAlignmentVC?.action = #selector(rightAlignmentAction)
         rightAlignmentVC?.image = NSImage(named: "KMImageNameEditPDFAlignRight")!
         rightAlignmentVC?.image_sel = NSImage(named: "KMImageNameEditPDFAlignRightSelect")!
+        rightAlignmentVC?.background_hov = KMAppearance.Layout.l1Color()
+        rightAlignmentVC?.background_sel = KMAppearance.Layout.l1Color()
         rightAlignmentVC?.updateUI()
         
-        var fontNameArray = KMEditPDFTextManager.manager.fetchTextFontNames()
+        let fontNameArray = KMEditPDFTextManager.manager.fetchTextFontNames()
         
         fontNameVC = KMDesignSelect.init(withType: .PopButton)
 //        fontNameVC?.isScrollPop = true
@@ -282,8 +288,11 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         textPresuppositionResetVC?.target = self
         textPresuppositionResetVC?.action = #selector(resetTextPresuppositionButtonAction)
         textPresuppositionResetVC?.image = NSImage(named: "KMImagePropertPanelTextDefaultMore")!
+        textPresuppositionResetVC?.background_hov = KMAppearance.Layout.l1Color()
+        textPresuppositionResetVC?.updateUI()
         
-        self.colorBox.borderColor = NSColor.km_init(hex: "#DFE1E5")
+//        self.colorBox.borderColor = NSColor.km_init(hex: "#DFE1E5")
+        self.colorBox.borderColor = KMAppearance.Interactive.s0Color()
         
         self.alignmentView.didChange = { [unowned self] view, areasArray, boundsArray in
             self.changeAreasAlign(areas: areasArray, newBounds: boundsArray)