|
@@ -35,6 +35,7 @@ let KMViewZoomScaleTypeKey: KMPreferenceKey = "KMViewZoomScaleTypeKey"
|
|
|
let KMLeftSideDisplayTypeKey: KMPreferenceKey = "KMLeftSideDisplayTypeKey"
|
|
|
let KMShowOutlineListKey: KMPreferenceKey = "KMShowOutlineListKey"
|
|
|
let KMLeftSideExpandTypeKey: KMPreferenceKey = "KMLeftSideExpandTypeKey"
|
|
|
+let KMPropertyPanelExpandTypeKey: KMPreferenceKey = "KMPropertyPanelExpandTypeKey"
|
|
|
let KMDisplayBackgroundNormalColorKey: KMPreferenceKey = "KMDisplayBackgroundNormalColorKey"
|
|
|
let KMDisplayBackgroundFullScreenColorKey: KMPreferenceKey = "KMDisplayBackgroundFullScreenColorKey"
|
|
|
let KMHighlightFormsKey: KMPreferenceKey = "KMHighlightFormsKey"
|
|
@@ -259,6 +260,7 @@ class KMPreferenceManager: NSObject {
|
|
|
KMLeftSideDisplayTypeKey,
|
|
|
KMShowOutlineListKey,
|
|
|
KMLeftSideExpandTypeKey,
|
|
|
+ KMPropertyPanelExpandTypeKey,
|
|
|
KMDisplayBackgroundNormalColorKey,
|
|
|
KMDisplayBackgroundFullScreenColorKey,
|
|
|
KMHighlightFormsKey,
|
|
@@ -301,6 +303,7 @@ class KMPreferenceManager: NSObject {
|
|
|
KMLeftSideDisplayTypeKey : 0,
|
|
|
KMShowOutlineListKey: true,
|
|
|
KMLeftSideExpandTypeKey : 0,
|
|
|
+ KMPropertyPanelExpandTypeKey : 0,
|
|
|
KMDisplayBackgroundNormalColorKey : self.displayBackgroundNormalColorValues,
|
|
|
KMDisplayBackgroundFullScreenColorKey : self.displayBackgroundFullScreenColorValues,
|
|
|
KMHighlightFormsKey : true,
|
|
@@ -614,12 +617,29 @@ extension KMPreferenceManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var leftSideExpandType: Int {
|
|
|
+// var leftSideExpandType: Int {
|
|
|
+// get {
|
|
|
+// return self.getData(forKey: KMLeftSideExpandTypeKey) as! Int
|
|
|
+// }
|
|
|
+// set {
|
|
|
+// let _ = self.setData(data: newValue, forKey: KMLeftSideExpandTypeKey)
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ var propertyPanelExpandType: KMPreferencePropertyPanelExpandType {
|
|
|
get {
|
|
|
- return self.getData(forKey: KMLeftSideExpandTypeKey) as! Int
|
|
|
+ let type: Int? = self.getData(forKey: KMPropertyPanelExpandTypeKey) as? Int
|
|
|
+ if (type == nil || type! == 0) {
|
|
|
+ return .auto
|
|
|
+ } else if (type! == 1) {
|
|
|
+ return .manual
|
|
|
+ }
|
|
|
+ return .auto
|
|
|
}
|
|
|
set {
|
|
|
- let _ = self.setData(data: newValue, forKey: KMLeftSideExpandTypeKey)
|
|
|
+ if (newValue == .auto || newValue == .manual) {
|
|
|
+ let _ = self.setData(data: newValue.rawValue, forKey: KMPropertyPanelExpandTypeKey)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -873,4 +893,10 @@ extension KMPreferenceManager {
|
|
|
func leftSideNeedCloseWhenOpenFile() -> Bool {
|
|
|
return KMPreferenceManager.shared.leftSideDisplayType == .closeWhenOpenFile
|
|
|
}
|
|
|
+
|
|
|
+ var autoExpandPropertyPanel: Bool {
|
|
|
+ get {
|
|
|
+ return KMPreferenceManager.shared.propertyPanelExpandType == .auto
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|