Browse Source

【2025】【综合】偏好设置内容整理

niehaoyu 2 months ago
parent
commit
e532267c1a

+ 1 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -7344,7 +7344,7 @@ extension KMMainViewController {
                 return
             }
             
-            let type = KMPreferenceManager.shared.savePasswordType
+            let type = SettingsManager.sharedInstance.keychainType
             if (type == .never) {
                 return
             }

+ 1 - 7
PDF Office/PDF Master/KMClass/Settings/Preference/Tools/KMPreferenceEnum.swift

@@ -27,13 +27,7 @@ enum KMPreferenceRevertInitSettingType: Int {
     case normal = 0
     case fullScreen = 1
 }
-
-enum KMPreferenceSavePasswordType: Int {
-    case always = 0
-    case never = 1
-    case ask = 2
-}
-
+ 
 enum KMPreferenceViewSetting: String {
     case pageNumber = "pageNumber"
 }

+ 3 - 29
PDF Office/PDF Master/KMClass/Settings/Preference/Tools/KMPreferenceManager.swift

@@ -23,8 +23,7 @@ private let KMCloseFilePromptTypeKey: KMPreferenceKey = "KMCloseFilePromptTypeKe
 private let KMOpenImageFileTypeKey: KMPreferenceKey = "KMOpenImageFileTypeKey"
 private let KMSetDefaultPDFReaderKey: KMPreferenceKey = "KMSetDefaultPDFReaderKey"
 /// save password
-private let KMSavePasswordTypeKey: KMPreferenceKey = "KMSavePasswordTypeKey"
-private let KMGeneralAuthorNameKey: KMPreferenceKey = "KMGeneralAuthorNameKey"
+ private let KMGeneralAuthorNameKey: KMPreferenceKey = "KMGeneralAuthorNameKey"
   
 /// 偏好设置已改变
 private let KMPreferenceDidChangeNotificationName = "KMPreferenceDidChangeNotificationName"
@@ -58,8 +57,7 @@ typealias KMPreference = KMPreferenceManager
     public static let openImageFileTypeKey                      = KMOpenImageFileTypeKey
     public static let setDefaultPDFReaderKey                    = KMSetDefaultPDFReaderKey
     /// save password
-    public static let savePasswordTypeKey                       = KMSavePasswordTypeKey
-    public static let generalAuthorNameKey                      = KMGeneralAuthorNameKey
+     public static let generalAuthorNameKey                      = KMGeneralAuthorNameKey
       
       
     override init() {
@@ -200,31 +198,7 @@ extension KMPreferenceManager {
             }
         }
     }
-    
-    var savePasswordType: KMPreferenceSavePasswordType {
-        get {
-            let type = KMDataManager.ud_integer(forKey: KMSavePasswordOptionKey)
-            if type == -1 {
-                return .ask
-            } else if type == 1 {
-                return .always
-            }
-            return .never
-        }
-        set {
-            if (newValue == .always || newValue == .never || newValue == .ask) {
-                var data: Int = 0
-                if newValue == .always {
-                    data = 1
-                } else if newValue == .ask {
-                    data = -1
-                }
-             
-                let _ = self.setData(data: newValue.rawValue, forKey: KMSavePasswordTypeKey)
-            }
-        }
-    }
-    
+     
     var openDocumentType: KMPreferenceOpenDocumentType { // KMOpenDocumentInTab
         get {
             guard let num = KMDataManager.ud_object(forKey: KMOpenDocumentInTabKey) as? NSNumber else {

+ 29 - 46
PDF Office/PDF Master/KMClass/Settings/SettingsDisplayView.swift

@@ -25,7 +25,7 @@ class SettingsDisplayView: BaseXibView {
     @IBOutlet weak var defaultOpenSelectView: ComponentSelect!
     @IBOutlet weak var remeberLastRadio: ComponentRadio!
     @IBOutlet weak var hideLeftSideRadio: ComponentRadio!
-    @IBOutlet weak var prioritizeOutlineCheckbox: ComponentCheckBox!
+    @IBOutlet weak var prioritizeOutlineRadio: ComponentRadio!
     @IBOutlet weak var defaultOpenRadioWidthConst: NSLayoutConstraint!
     @IBOutlet weak var remeberLastRadioWidthConst: NSLayoutConstraint!
     @IBOutlet weak var hideLeftSideRadioWidthConst: NSLayoutConstraint!
@@ -33,11 +33,11 @@ class SettingsDisplayView: BaseXibView {
     
     @IBOutlet weak var propertyPanelView: NSView!
     @IBOutlet weak var propertyPanelLabel: NSTextField!
-    @IBOutlet weak var panelInteractionLabel: NSTextField!
-    @IBOutlet weak var panelInteractionSelect: ComponentSelect!
+    @IBOutlet var autoExpandPropertyPanelCheckbox: ComponentCheckBox!
     @IBOutlet weak var showQuickCheckbox: ComponentCheckBox!
     @IBOutlet weak var showQuickCheckboxWidthConst: NSLayoutConstraint!
-     
+    @IBOutlet var propertyPanelWidthConst: NSLayoutConstraint!
+    
     @IBOutlet weak var highlightView: NSView!
     @IBOutlet weak var highlightLabel: NSTextField!
     @IBOutlet weak var highlightLinkCheckbox: ComponentCheckBox!
@@ -85,14 +85,14 @@ class SettingsDisplayView: BaseXibView {
     func setTitleUI () {
         
         //获取颜色
-        var titleLabelColor: NSColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        let titleLabelColor: NSColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
          
-        var subtitleLabelColor: NSColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-nor")
+        let subtitleLabelColor: NSColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-nor")
           
         //获取字体
-        var titleLabelFont: NSFont = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
+        let titleLabelFont: NSFont = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
         
-        var subtitleLabelFont: NSFont = ComponentLibrary.shared.getFontFromKey("mac/body-s-regular")
+        let subtitleLabelFont: NSFont = ComponentLibrary.shared.getFontFromKey("mac/body-s-regular")
  
         //Layout and Zoom
         layoutZoomLabel.stringValue = KMLocalizedString("Default Layout and Zoom")
@@ -115,10 +115,6 @@ class SettingsDisplayView: BaseXibView {
         propertyPanelLabel.textColor = titleLabelColor
         propertyPanelLabel.font = titleLabelFont
         
-        panelInteractionLabel.stringValue = KMLocalizedString("Panel Open Interaction:", comment: "")
-        panelInteractionLabel.textColor = subtitleLabelColor
-        panelInteractionLabel.font = subtitleLabelFont
-         
         highlightLabel.stringValue = KMLocalizedString("Highlight", comment: "")
         highlightLabel.textColor = titleLabelColor
         highlightLabel.font = titleLabelFont
@@ -223,44 +219,33 @@ class SettingsDisplayView: BaseXibView {
                                                                 checkboxType: .normal)
         hideLeftSideRadioWidthConst.constant = hideLeftSideRadio.properties.propertyInfo.viewWidth
         
-        prioritizeOutlineCheckbox.properties = ComponentCheckBoxProperty(size: .s,
+        prioritizeOutlineRadio.properties = ComponentCheckBoxProperty(size: .s,
                                                                 state: .normal,
                                                                 isDisabled: false,
                                                                 showhelp: false,
                                                                 text: "Prioritize open the outline list when outlines are available",
                                                                 checkboxType: .normal)
-        prioritizeOutlineCheckboxWidthConst.constant = prioritizeOutlineCheckbox.properties.propertyInfo.viewWidth
+        prioritizeOutlineCheckboxWidthConst.constant = prioritizeOutlineRadio.properties.propertyInfo.viewWidth
         
         defaultOpenRadio.setTarget(self, action: #selector(leftSidePanelAction(_:)))
         remeberLastRadio.setTarget(self, action: #selector(leftSidePanelAction(_:)))
         hideLeftSideRadio.setTarget(self, action: #selector(leftSidePanelAction(_:)))
-        prioritizeOutlineCheckbox.setTarget(self, action: #selector(leftSidePanelAction(_:)))
+        prioritizeOutlineRadio.setTarget(self, action: #selector(leftSidePanelAction(_:)))
         
     }
     
     func setUpPropertyPanel() {
      //Property Panel
          
-        panelInteractionSelect.properties = ComponentSelectProperties(size: .s,
-                                                                state: .normal,
-                                                                isDisabled: false,
-                                                                isError: false,
-                                                                leftIcon: false,
-                                                                placeholder: nil,
-                                                                errorText: nil,
-                                                                creatable: false,
-                                                                text: "Automatic")
-        if true {
-            var menuItemArr: [ComponentMenuitemProperty] = []
-            let AutomaticProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, keyEquivalent: nil, text: "Automatic")
-            menuItemArr.append(AutomaticProperty)
-            
-            let hideProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, keyEquivalent: nil, text: "Hide Property Panel")
-            menuItemArr.append(hideProperty)
-            
-            panelInteractionSelect.updateMenuItemsArr(menuItemArr)
-            panelInteractionSelect.delegate = self
-        }
+        autoExpandPropertyPanelCheckbox.properties = ComponentCheckBoxProperty(size: .s,
+                                                                 state: .normal,
+                                                                 isDisabled: false,
+                                                                 showhelp: false,
+                                                                 text: "Automatically expand the properties panel",
+                                                                 checkboxType: SettingsManager.sharedInstance.showQuickActionBar ? .selected : .normal)
+        autoExpandPropertyPanelCheckbox.setTarget(self, action: #selector(propertyPanelAction(_:)))
+        propertyPanelWidthConst.constant = autoExpandPropertyPanelCheckbox.properties.propertyInfo.viewWidth
+    
         
         showQuickCheckbox.properties = ComponentCheckBoxProperty(size: .s,
                                                                  state: .normal,
@@ -308,7 +293,7 @@ class SettingsDisplayView: BaseXibView {
         defaultOpenRadio.properties.checkboxType = .normal
         remeberLastRadio.properties.checkboxType = .normal
         hideLeftSideRadio.properties.checkboxType = .normal
-        prioritizeOutlineCheckbox.properties.checkboxType = .normal
+        prioritizeOutlineRadio.properties.checkboxType = .normal
         
         defaultOpenSelectView.properties.isDisabled = true
         if SettingsManager.sharedInstance.leftPanelType == .defaultOpen {
@@ -322,21 +307,22 @@ class SettingsDisplayView: BaseXibView {
             hideLeftSideRadio.properties.checkboxType = .selected
             
         } else if SettingsManager.sharedInstance.leftPanelType == .prioritizeOutline {
-            prioritizeOutlineCheckbox.properties.checkboxType = .selected
+            prioritizeOutlineRadio.properties.checkboxType = .selected
             
         }
         
         defaultOpenRadio.reloadData()
         remeberLastRadio.reloadData()
         hideLeftSideRadio.reloadData()
-        prioritizeOutlineCheckbox.reloadData()
+        prioritizeOutlineRadio.reloadData()
         
         defaultOpenSelectView.selectItemAtIndex(SettingsManager.sharedInstance.defaultOpen.rawValue)
         defaultOpenSelectView.reloadData()
         
         //Property Panel
-        panelInteractionSelect.selectItemAtIndex(SettingsManager.sharedInstance.panelOpenType.rawValue)
-        panelInteractionSelect.reloadData()
+        
+        autoExpandPropertyPanelCheckbox.properties.checkboxType = SettingsManager.sharedInstance.autoExpandPropertyPanel ? .selected : .normal
+        autoExpandPropertyPanelCheckbox.reloadData()
         
         showQuickCheckbox.properties.checkboxType = SettingsManager.sharedInstance.showQuickActionBar ? .selected : .normal
         showQuickCheckbox.reloadData()
@@ -355,12 +341,11 @@ class SettingsDisplayView: BaseXibView {
     @objc func leftSidePanelAction(_ sender: NSView) {
         if sender == defaultOpenRadio {
             SettingsManager.sharedInstance.leftPanelType = .defaultOpen
-            
         } else if sender == remeberLastRadio {
             SettingsManager.sharedInstance.leftPanelType = .sameAsLastOpen
         } else if sender == hideLeftSideRadio {
             SettingsManager.sharedInstance.leftPanelType = .hideLeftSide
-        } else if sender == prioritizeOutlineCheckbox {
+        } else if sender == prioritizeOutlineRadio {
             SettingsManager.sharedInstance.leftPanelType = .prioritizeOutline
         }
         self.reloadData()
@@ -370,6 +355,8 @@ class SettingsDisplayView: BaseXibView {
     @objc func propertyPanelAction(_ sender: NSView) {
         if sender == showQuickCheckbox {
             SettingsManager.sharedInstance.showQuickActionBar = showQuickCheckbox.properties.checkboxType == .selected ? true : false
+        } else if sender == autoExpandPropertyPanelCheckbox {
+            SettingsManager.sharedInstance.autoExpandPropertyPanel = autoExpandPropertyPanelCheckbox.properties.checkboxType == .selected ? true : false
         }
         self.reloadData()
         
@@ -402,10 +389,6 @@ extension SettingsDisplayView: ComponentSelectDelegate {
             if defaultOpenSelectView.indexOfSelect() >= 0 {
                 SettingsManager.sharedInstance.defaultOpen = defaultOpenType(rawValue: defaultOpenSelectView.indexOfSelect())!
             }
-        } else if view == panelInteractionSelect {
-            if panelInteractionSelect.indexOfSelect() >= 0 {
-                SettingsManager.sharedInstance.panelOpenType = panelOpenInteractionType(rawValue: panelInteractionSelect.indexOfSelect())!
-            }
         }
         SettingsManager.sharedInstance.saveData()
         

+ 33 - 43
PDF Office/PDF Master/KMClass/Settings/SettingsDisplayView.xib

@@ -8,6 +8,7 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="SettingsDisplayView" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
+                <outlet property="autoExpandPropertyPanelCheckbox" destination="Tfr-FV-tbn" id="EAe-fV-kZp"/>
                 <outlet property="contendBox" destination="gld-Ys-bvb" id="Q6v-8q-A4c"/>
                 <outlet property="defaultOpenRadio" destination="0wD-eD-gRt" id="dmz-PR-VJk"/>
                 <outlet property="defaultOpenRadioWidthConst" destination="sOU-Oc-Gkz" id="rYp-8m-06E"/>
@@ -26,12 +27,11 @@
                 <outlet property="layoutZoomView" destination="AUZ-JH-o92" id="rvu-Un-cCa"/>
                 <outlet property="leftSideLabel" destination="rJD-ZL-u8T" id="83k-sD-ZPX"/>
                 <outlet property="leftSideView" destination="FLk-kJ-VBb" id="ugO-ne-DUn"/>
-                <outlet property="panelInteractionLabel" destination="CBV-go-C9i" id="qth-Eu-uht"/>
-                <outlet property="panelInteractionSelect" destination="Tfr-FV-tbn" id="Jd5-jP-0LA"/>
-                <outlet property="prioritizeOutlineCheckbox" destination="zyN-P1-6Xz" id="NtV-fA-OPJ"/>
                 <outlet property="prioritizeOutlineCheckboxWidthConst" destination="1J4-y4-Cdn" id="YCz-xt-SQP"/>
+                <outlet property="prioritizeOutlineRadio" destination="zyN-P1-6Xz" id="Dm7-0t-rGZ"/>
                 <outlet property="propertyPanelLabel" destination="Utr-pX-8FQ" id="1nF-kk-KRZ"/>
                 <outlet property="propertyPanelView" destination="IkQ-RL-abt" id="6Ey-pe-Ccw"/>
+                <outlet property="propertyPanelWidthConst" destination="50x-SN-yyq" id="HY3-Jg-VyW"/>
                 <outlet property="remeberLastRadio" destination="OUf-0h-7vT" id="B1M-3Q-v6X"/>
                 <outlet property="remeberLastRadioWidthConst" destination="LqD-Zi-Ss7" id="NP9-pd-cG3"/>
                 <outlet property="showQuickCheckbox" destination="vaN-3Z-QaJ" id="qCM-oN-qrq"/>
@@ -121,10 +121,10 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="FLk-kJ-VBb">
-                                <rect key="frame" x="24" y="324" width="592" height="164"/>
+                                <rect key="frame" x="24" y="320" width="592" height="168"/>
                                 <subviews>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="Px8-zQ-6nQ">
-                                        <rect key="frame" x="0.0" y="124" width="592" height="40"/>
+                                        <rect key="frame" x="0.0" y="128" width="592" height="40"/>
                                         <subviews>
                                             <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rJD-ZL-u8T">
                                                 <rect key="frame" x="-2" y="12" width="95" height="16"/>
@@ -141,36 +141,36 @@
                                             <constraint firstAttribute="height" constant="40" id="ya6-x9-rgQ"/>
                                         </constraints>
                                     </customView>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="t73-KL-UuO" customClass="ComponentSelect" customModule="KMComponentLibrary">
+                                        <rect key="frame" x="58" y="96" width="320" height="32"/>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="320" id="A94-nz-XzA"/>
+                                            <constraint firstAttribute="height" constant="32" id="rYt-1c-GK9"/>
+                                        </constraints>
+                                    </customView>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="0wD-eD-gRt" customClass="ComponentRadio" customModule="KMComponentLibrary">
-                                        <rect key="frame" x="0.0" y="92" width="50" height="32"/>
+                                        <rect key="frame" x="0.0" y="96" width="50" height="32"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="32" id="4rx-h8-gYy"/>
                                             <constraint firstAttribute="width" constant="50" id="sOU-Oc-Gkz"/>
                                         </constraints>
                                     </customView>
-                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="t73-KL-UuO" customClass="ComponentSelect" customModule="KMComponentLibrary">
-                                        <rect key="frame" x="58" y="92" width="320" height="32"/>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="zyN-P1-6Xz" customClass="ComponentRadio" customModule="KMComponentLibrary">
+                                        <rect key="frame" x="0.0" y="64" width="100" height="32"/>
                                         <constraints>
-                                            <constraint firstAttribute="width" constant="320" id="A94-nz-XzA"/>
-                                            <constraint firstAttribute="height" constant="32" id="rYt-1c-GK9"/>
+                                            <constraint firstAttribute="width" constant="100" id="1J4-y4-Cdn"/>
+                                            <constraint firstAttribute="height" constant="32" id="Kja-na-TtP"/>
                                         </constraints>
                                     </customView>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="OUf-0h-7vT" customClass="ComponentRadio" customModule="KMComponentLibrary">
-                                        <rect key="frame" x="0.0" y="60" width="100" height="32"/>
+                                        <rect key="frame" x="0.0" y="32" width="100" height="32"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="100" id="LqD-Zi-Ss7"/>
                                             <constraint firstAttribute="height" constant="32" id="dAg-Dd-TsK"/>
                                         </constraints>
                                     </customView>
-                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="zyN-P1-6Xz" customClass="ComponentCheckBox" customModule="KMComponentLibrary">
-                                        <rect key="frame" x="0.0" y="0.0" width="100" height="20"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="100" id="1J4-y4-Cdn"/>
-                                            <constraint firstAttribute="height" constant="20" id="Kja-na-TtP"/>
-                                        </constraints>
-                                    </customView>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="eDd-fm-nRr" customClass="ComponentRadio" customModule="KMComponentLibrary">
-                                        <rect key="frame" x="0.0" y="28" width="100" height="32"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="100" height="32"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="32" id="ebV-qv-x2f"/>
                                             <constraint firstAttribute="width" constant="100" id="kbo-zl-cHS"/>
@@ -180,26 +180,26 @@
                                 <constraints>
                                     <constraint firstItem="t73-KL-UuO" firstAttribute="top" secondItem="Px8-zQ-6nQ" secondAttribute="bottom" id="2YE-QV-Khd"/>
                                     <constraint firstAttribute="trailing" secondItem="Px8-zQ-6nQ" secondAttribute="trailing" id="4oF-1u-r47"/>
+                                    <constraint firstItem="zyN-P1-6Xz" firstAttribute="top" secondItem="t73-KL-UuO" secondAttribute="bottom" id="96a-q3-Cu2"/>
                                     <constraint firstItem="zyN-P1-6Xz" firstAttribute="leading" secondItem="FLk-kJ-VBb" secondAttribute="leading" id="GfD-bh-mTd"/>
-                                    <constraint firstItem="zyN-P1-6Xz" firstAttribute="top" secondItem="eDd-fm-nRr" secondAttribute="bottom" constant="8" id="V9o-NS-Xwg"/>
+                                    <constraint firstItem="OUf-0h-7vT" firstAttribute="top" secondItem="zyN-P1-6Xz" secondAttribute="bottom" id="clt-km-z2z"/>
                                     <constraint firstAttribute="width" constant="592" id="dY3-AN-qlQ"/>
-                                    <constraint firstItem="OUf-0h-7vT" firstAttribute="top" secondItem="t73-KL-UuO" secondAttribute="bottom" id="gqZ-bv-fQb"/>
-                                    <constraint firstAttribute="height" constant="164" id="iA2-2c-69F"/>
+                                    <constraint firstItem="eDd-fm-nRr" firstAttribute="top" secondItem="OUf-0h-7vT" secondAttribute="bottom" id="egP-V7-xmQ"/>
+                                    <constraint firstAttribute="height" constant="168" id="iA2-2c-69F"/>
                                     <constraint firstItem="t73-KL-UuO" firstAttribute="leading" secondItem="0wD-eD-gRt" secondAttribute="trailing" constant="8" id="l3s-Cx-vy1"/>
                                     <constraint firstItem="Px8-zQ-6nQ" firstAttribute="leading" secondItem="FLk-kJ-VBb" secondAttribute="leading" id="lfL-yQ-0CW"/>
                                     <constraint firstItem="OUf-0h-7vT" firstAttribute="leading" secondItem="FLk-kJ-VBb" secondAttribute="leading" id="lxQ-sb-leL"/>
                                     <constraint firstItem="eDd-fm-nRr" firstAttribute="leading" secondItem="FLk-kJ-VBb" secondAttribute="leading" id="nOe-rK-A0v"/>
                                     <constraint firstItem="0wD-eD-gRt" firstAttribute="leading" secondItem="FLk-kJ-VBb" secondAttribute="leading" id="pPs-B8-bg3"/>
                                     <constraint firstItem="t73-KL-UuO" firstAttribute="centerY" secondItem="0wD-eD-gRt" secondAttribute="centerY" id="roW-Gd-JNi"/>
-                                    <constraint firstItem="eDd-fm-nRr" firstAttribute="top" secondItem="OUf-0h-7vT" secondAttribute="bottom" id="v8U-MJ-gNA"/>
                                     <constraint firstItem="Px8-zQ-6nQ" firstAttribute="top" secondItem="FLk-kJ-VBb" secondAttribute="top" id="yZy-IQ-nPN"/>
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="IkQ-RL-abt">
-                                <rect key="frame" x="24" y="208" width="592" height="100"/>
+                                <rect key="frame" x="24" y="198" width="592" height="106"/>
                                 <subviews>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="gce-cI-Ca3">
-                                        <rect key="frame" x="0.0" y="60" width="592" height="40"/>
+                                        <rect key="frame" x="0.0" y="66" width="592" height="40"/>
                                         <subviews>
                                             <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Utr-pX-8FQ">
                                                 <rect key="frame" x="-2" y="12" width="93" height="16"/>
@@ -216,26 +216,18 @@
                                             <constraint firstItem="Utr-pX-8FQ" firstAttribute="centerY" secondItem="gce-cI-Ca3" secondAttribute="centerY" id="aSl-Fq-wwb"/>
                                         </constraints>
                                     </customView>
-                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CBV-go-C9i">
-                                        <rect key="frame" x="-2" y="36" width="146" height="16"/>
-                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Panel Open Interaction:" id="TGr-w3-azK">
-                                            <font key="font" usesAppearanceFont="YES"/>
-                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                    </textField>
-                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="Tfr-FV-tbn" customClass="ComponentSelect" customModule="KMComponentLibrary">
-                                        <rect key="frame" x="146" y="28" width="320" height="32"/>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="Tfr-FV-tbn" customClass="ComponentCheckBox" customModule="KMComponentLibrary">
+                                        <rect key="frame" x="0.0" y="34" width="320" height="32"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="320" id="50x-SN-yyq"/>
                                             <constraint firstAttribute="height" constant="32" id="g8L-EI-5Jp"/>
                                         </constraints>
                                     </customView>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="vaN-3Z-QaJ" customClass="ComponentCheckBox" customModule="KMComponentLibrary">
-                                        <rect key="frame" x="0.0" y="0.0" width="100" height="20"/>
+                                        <rect key="frame" x="0.0" y="2" width="100" height="32"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="100" id="B64-ma-pU2"/>
-                                            <constraint firstAttribute="height" constant="20" id="hum-qj-eYk"/>
+                                            <constraint firstAttribute="height" constant="32" id="hum-qj-eYk"/>
                                         </constraints>
                                     </customView>
                                 </subviews>
@@ -243,18 +235,16 @@
                                     <constraint firstItem="gce-cI-Ca3" firstAttribute="leading" secondItem="IkQ-RL-abt" secondAttribute="leading" id="08F-rb-wKc"/>
                                     <constraint firstAttribute="trailing" secondItem="gce-cI-Ca3" secondAttribute="trailing" id="A2w-Yy-uMD"/>
                                     <constraint firstItem="gce-cI-Ca3" firstAttribute="top" secondItem="IkQ-RL-abt" secondAttribute="top" id="BUB-r3-pAT"/>
-                                    <constraint firstItem="vaN-3Z-QaJ" firstAttribute="top" secondItem="Tfr-FV-tbn" secondAttribute="bottom" constant="8" id="FJM-qe-VyD"/>
+                                    <constraint firstItem="vaN-3Z-QaJ" firstAttribute="top" secondItem="Tfr-FV-tbn" secondAttribute="bottom" id="FJM-qe-VyD"/>
                                     <constraint firstItem="Tfr-FV-tbn" firstAttribute="top" secondItem="gce-cI-Ca3" secondAttribute="bottom" id="Tqu-6L-kE0"/>
                                     <constraint firstItem="vaN-3Z-QaJ" firstAttribute="leading" secondItem="IkQ-RL-abt" secondAttribute="leading" id="Uec-Ye-H43"/>
-                                    <constraint firstAttribute="height" constant="100" id="Yer-rS-HWb"/>
-                                    <constraint firstItem="CBV-go-C9i" firstAttribute="leading" secondItem="IkQ-RL-abt" secondAttribute="leading" id="aXB-la-vDU"/>
-                                    <constraint firstItem="Tfr-FV-tbn" firstAttribute="centerY" secondItem="CBV-go-C9i" secondAttribute="centerY" id="nUE-iD-Z3a"/>
-                                    <constraint firstItem="Tfr-FV-tbn" firstAttribute="leading" secondItem="CBV-go-C9i" secondAttribute="trailing" constant="4" id="pDe-di-btO"/>
+                                    <constraint firstAttribute="height" constant="106" id="Yer-rS-HWb"/>
+                                    <constraint firstItem="Tfr-FV-tbn" firstAttribute="leading" secondItem="IkQ-RL-abt" secondAttribute="leading" id="joB-TE-TCC"/>
                                     <constraint firstAttribute="width" constant="592" id="pKY-VU-9gc"/>
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="1hb-Hv-az3">
-                                <rect key="frame" x="24" y="88" width="592" height="104"/>
+                                <rect key="frame" x="24" y="78" width="592" height="104"/>
                                 <subviews>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="du7-5h-cT8">
                                         <rect key="frame" x="0.0" y="64" width="592" height="40"/>

+ 27 - 63
PDF Office/PDF Master/KMClass/Settings/SettingsManager.swift

@@ -110,19 +110,7 @@ var settingsHighlightFormFieldKey  = "settingsHighlightFormFieldKey"
 class SettingsManager: NSObject {
     
     static let sharedInstance = SettingsManager.init()
-    
-    //General
  
-    //PageDisplay
-    private var _layoutType: pageLayoutType = .singlePage
-    private var _zoomType: zoomInfoType = .adaptationWidth
-    private var _leftPanelType: leftSidePanelType = .defaultOpen
-    private var _defaultOpen: defaultOpenType = .thumbnail
-    private var _panelOpenType: panelOpenInteractionType = .automatic
-    private var _showQuickActionBar: Bool = true
-    private var _highlightLink: Bool = true
-    private var _highlightFormField: Bool = true
-    
     override init() {
         super.init()
         
@@ -160,7 +148,7 @@ class SettingsManager: NSObject {
         self.zoomType = zoomInfoType(rawValue: UserDefaults.standard.integer(forKey: settingsZoomTypeKey)) ?? .adaptationWidth
         self.leftPanelType = leftSidePanelType(rawValue: UserDefaults.standard.integer(forKey: settingsLeftSidePanelKey)) ?? .defaultOpen
         self.defaultOpen = defaultOpenType(rawValue: UserDefaults.standard.integer(forKey: settingsDefaultOpenTypeKey)) ?? .thumbnail
-        self.panelOpenType = panelOpenInteractionType(rawValue: UserDefaults.standard.integer(forKey: settingsPanelOpenTypeKey)) ?? .automatic
+        self.autoExpandPropertyPanel = UserDefaults.standard.bool(forKey: settingsPanelOpenTypeKey)
         self.showQuickActionBar =  UserDefaults.standard.bool(forKey: settingsShowQuickActionBarKey)
         self.highlightLink = UserDefaults.standard.bool(forKey: settingsHighlightLinkKey)
         self.highlightFormField = UserDefaults.standard.bool(forKey: settingsHighlightFormFieldKey)
@@ -183,7 +171,7 @@ class SettingsManager: NSObject {
         UserDefaults.standard.setValue(layoutType.rawValue, forKey: settingsPageLayoutTypeKey)
         UserDefaults.standard.setValue(zoomType.rawValue, forKey: settingsZoomTypeKey)
         UserDefaults.standard.setValue(leftPanelType.rawValue, forKey: settingsLeftSidePanelKey)
-        UserDefaults.standard.setValue(panelOpenType.rawValue, forKey: settingsPanelOpenTypeKey)
+        UserDefaults.standard.setValue(autoExpandPropertyPanel, forKey: settingsPanelOpenTypeKey)
         UserDefaults.standard.setValue(defaultOpen.rawValue, forKey: settingsDefaultOpenTypeKey)
         UserDefaults.standard.setValue(showQuickActionBar, forKey: settingsShowQuickActionBarKey)
         UserDefaults.standard.setValue(highlightLink, forKey: settingsHighlightLinkKey)
@@ -250,75 +238,51 @@ class SettingsManager: NSObject {
         }
     }
     
-    var layoutType: pageLayoutType {
-        get {
-            return _layoutType
-        }
-        set {
-            _layoutType = newValue
+    var layoutType: pageLayoutType = .singlePage {
+        didSet {
+            
         }
     }
     
-    var zoomType: zoomInfoType {
-        get {
-            return _zoomType
-        }
-        set {
-            _zoomType = newValue
+    var zoomType: zoomInfoType = .adaptationWidth {
+        didSet {
+            
         }
     }
     
-    var leftPanelType: leftSidePanelType {
-        get {
-            return _leftPanelType
-        }
-        set {
-            _leftPanelType = newValue
+    var leftPanelType: leftSidePanelType = .defaultOpen {
+        didSet {
+            
         }
     }
     
-    var defaultOpen: defaultOpenType {
-        get {
-            return _defaultOpen
-        }
-        set {
-            _defaultOpen = newValue
+    var defaultOpen: defaultOpenType = .thumbnail {
+        didSet {
+            
         }
     }
     
-    var panelOpenType: panelOpenInteractionType {
-        get {
-            return  _panelOpenType
-        }
-        set {
-            _panelOpenType = newValue
+    var autoExpandPropertyPanel: Bool = true {
+        didSet {
+            
         }
     }
     
-    var showQuickActionBar: Bool {
-        get {
-            return _showQuickActionBar
-        }
-        set {
-            _showQuickActionBar = newValue
+    var showQuickActionBar: Bool = true {
+        didSet {
+            
         }
     }
     
-    var highlightLink: Bool {
-        get {
-            return _highlightLink
-        }
-        set {
-            _highlightLink = newValue
+    var highlightLink: Bool = true {
+        didSet {
+            
         }
     }
     
-    var highlightFormField: Bool {
-        get {
-            return _highlightFormField
-        }
-        set {
-            _highlightFormField = newValue
+    var highlightFormField: Bool = true {
+        didSet {
+            
         }
     }
     
@@ -348,7 +312,7 @@ class SettingsManager: NSObject {
         self.zoomType = .adaptationWidth
         self.leftPanelType = .defaultOpen
         self.defaultOpen = .thumbnail
-        self.panelOpenType = .automatic
+        self.autoExpandPropertyPanel = true
         self.showQuickActionBar = true
         self.highlightLink = true
         self.highlightFormField = true