Explorar o código

【主题】- 自定义主题可删除

liujiajie hai 1 ano
pai
achega
ed66670389

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayCustomThemesCollectionViewItem.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -21,7 +21,7 @@
             <rect key="frame" x="0.0" y="0.0" width="58" height="64"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
-                <box misplaced="YES" boxType="custom" borderWidth="0.0" cornerRadius="6" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Arc-B8-K9d" customClass="KMThemesBox" customModule="PDF_Master" customModuleProvider="target">
+                <box misplaced="YES" boxType="custom" borderWidth="0.0" cornerRadius="6" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Arc-B8-K9d" customClass="KMThemesBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="0.0" y="6" width="58" height="64"/>
                     <view key="contentView" id="xu5-Vf-7O3">
                         <rect key="frame" x="0.0" y="0.0" width="58" height="64"/>

+ 15 - 5
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayThemeCollectionViewItem.swift

@@ -39,6 +39,16 @@ class KMPageDisplayThemeCollectionViewItem: NSCollectionViewItem {
         return image
     }
     
+    @IBAction func closeButtonAction(_ sender: Any) {
+        if !IAPProductsManager.default().isAvailableAllFunction() {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        if let callback = itemCallBack {
+            callback(Int(itemInteger.rawValue))
+        }
+    }
+    
     func themesCollectionCellItem(item:NSInteger, itemData:[NSColor]) {
         let size = CGSize(width: 20, height: 20)
         itemInteger = KMPDFViewMode(rawValue: UInt(item)) ?? .normal
@@ -74,11 +84,11 @@ class KMPageDisplayThemeCollectionViewItem: NSCollectionViewItem {
 
             if mouseEntered {
                 if self.itemInteger.rawValue > 3 {
-//                    if !IAPProductsManager.defaultManager.isAvailableAllFunction {
-//                        self.closeButton.isHidden = true
-//                    } else {
-//                        self.closeButton.isHidden = false
-//                    }
+                    if !IAPProductsManager.default().isAvailableAllFunction() {
+                        self.closeButton.isHidden = true
+                    } else {
+                        self.closeButton.isHidden = false
+                    }
                 }
             } else {
                 self.closeButton.isHidden = true

+ 8 - 5
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayThemeCollectionViewItem.xib

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMPageDisplayThemeCollectionViewItem" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPageDisplayThemeCollectionViewItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="closeButton" destination="Ho0-7o-Web" id="Q0K-3U-jPF"/>
                 <outlet property="itemImageView" destination="PPa-Or-WHl" id="TAf-zw-q64"/>
@@ -19,10 +19,10 @@
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView identifier="KMPageDisplayThemeCollectionViewItem" misplaced="YES" id="3SZ-T6-0pc">
-            <rect key="frame" x="0.0" y="0.0" width="58" height="64"/>
+            <rect key="frame" x="0.0" y="0.0" width="58" height="58"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
-                <box boxType="custom" borderWidth="0.0" cornerRadius="6" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="6e1-NQ-e52" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                <box boxType="custom" borderWidth="0.0" cornerRadius="6" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="6e1-NQ-e52" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="0.0" y="0.0" width="58" height="58"/>
                     <view key="contentView" id="S4n-a2-gfe">
                         <rect key="frame" x="0.0" y="0.0" width="58" height="58"/>
@@ -54,6 +54,9 @@
                                     <constraint firstAttribute="height" constant="16" id="GlF-Cn-mfR"/>
                                     <constraint firstAttribute="width" constant="16" id="NhD-gS-6jN"/>
                                 </constraints>
+                                <connections>
+                                    <action selector="closeButtonAction:" target="-2" id="ovH-wL-YJe"/>
+                                </connections>
                             </button>
                             <imageView hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Gmv-j8-3Dr">
                                 <rect key="frame" x="38" y="38" width="20" height="20"/>