Browse Source

[综合] - 幻灯片选项

liujiajie 1 year ago
parent
commit
1e9f33c377

+ 25 - 15
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/SKPresentationOptionsSheetController.swift

@@ -150,11 +150,11 @@ class SKPresentationOptionsSheetController: NSWindowController, NSWindowDelegate
     }
     
     func stopObservingTransitions(infos: [KMTransitionInfo]) {
-        for info in infos {
-            info.removeObserver(self, forKeyPath: TRANSITIONSTYLE_KEY) 
-            info.removeObserver(self, forKeyPath: DURATION_KEY)
-            info.removeObserver(self, forKeyPath: SHOULDRESTRICT_KEY)
-        }
+//        for info in infos {
+//            info.removeObserver(self, forKeyPath: TRANSITIONSTYLE_KEY) 
+//            info.removeObserver(self, forKeyPath: DURATION_KEY)
+//            info.removeObserver(self, forKeyPath: SHOULDRESTRICT_KEY)
+//        }
     }
     
     func creatTransitionController() {
@@ -229,11 +229,11 @@ class SKPresentationOptionsSheetController: NSWindowController, NSWindowDelegate
     }
     
     func startObservingTransitions(_ infos: [KMTransitionInfo]) {
-        for info in infos {
-            info.addObserver(self, forKeyPath: TRANSITIONSTYLE_KEY, options: [.new, .old], context: &SKTransitionPropertiesObservationContext)
-            info.addObserver(self, forKeyPath: DURATION_KEY, options: [.new, .old], context: &SKTransitionPropertiesObservationContext)
-            info.addObserver(self, forKeyPath: SHOULDRESTRICT_KEY, options: [.new, .old], context: &SKTransitionPropertiesObservationContext)
-        }
+//        for info in infos {
+//            info.addObserver(self, forKeyPath: TRANSITIONSTYLE_KEY, options: [.new, .old], context: &SKTransitionPropertiesObservationContext)
+//            info.addObserver(self, forKeyPath: DURATION_KEY, options: [.new, .old], context: &SKTransitionPropertiesObservationContext)
+//            info.addObserver(self, forKeyPath: SHOULDRESTRICT_KEY, options: [.new, .old], context: &SKTransitionPropertiesObservationContext)
+//        }
     }
     
     func makeTransitions() { 
@@ -243,7 +243,7 @@ class SKPresentationOptionsSheetController: NSWindowController, NSWindowDelegate
         var labelWidth: CGFloat = 0.0
         
         var array = [Any]()
-        _ = transition.properties
+        let dictionary: NSDictionary? = transition.properties
         let arr: NSArray? = transitionController.pageTransitions as NSArray?
         let ptEnum = arr?.objectEnumerator()
         var tn: KMThumbnail? = nil
@@ -252,8 +252,8 @@ class SKPresentationOptionsSheetController: NSWindowController, NSWindowDelegate
             if tn != nil {
                 let info = KMTransitionInfo()
                 info.thumbnail = tn
-                info.label = "\(tn!.label)\(RIGHTARROW_CHARACTER)\(next.label)"
-                info.properties = ptEnum?.nextObject() as? NSDictionary
+                info.label = "\(tn!.label)"+"→"+"\(next.label)"
+                info.properties = ((ptEnum?.nextObject()) != nil) ? ptEnum?.nextObject() as? NSDictionary : dictionary
                 array.append(info)
                 (cell as AnyObject).setStringValue(info.label)
                 labelWidth = max(labelWidth, ceil(((cell as AnyObject).cellSize?.width)!))
@@ -377,8 +377,18 @@ class SKPresentationOptionsSheetController: NSWindowController, NSWindowDelegate
         }
     }
     func numberOfRows(in tableView: NSTableView) -> Int {
-        return 0
-    }
+        return transitions?.count ?? 0
+    }
+//    func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
+//        let identifier = tableColumn!.identifier
+//        let info = transitions?[row]
+//        if identifier.rawValue == PAGE_COLUMNID {
+//            
+//        } else if identifier.rawValue == IMAGE_COLUMNID {
+//            
+//        }
+//        return nil
+//    }
     func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {
         return nil
     }

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/TransitionSheet.xib

@@ -222,7 +222,7 @@ Gw
                                                 <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
                                                 <color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
                                             </tableHeaderCell>
-                                            <textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" alignment="left" id="282" customClass="SKCenteredTextFieldCell">
+                                            <textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" alignment="left" id="282">
                                                 <font key="font" metaFont="smallSystem"/>
                                                 <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                                 <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>