|
@@ -74,20 +74,9 @@ class KMSnapshotWindowController: NSWindowController {
|
|
|
|
|
|
/*
|
|
|
#define EM_DASH_CHARACTER (unichar)0x2014
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
NSString *SKSnapshotCurrentSetupKey = @"currentSetup";
|
|
|
|
|
|
-
|
|
|
-
|
|
|
static char SKSnaphotWindowDefaultsObservationContext;
|
|
|
-
|
|
|
- @interface SKSnapshotWindowController ()
|
|
|
- @property (nonatomic, copy) NSString *pageLabel;
|
|
|
- @property (nonatomic) BOOL hasWindow;
|
|
|
- @end
|
|
|
*/
|
|
|
|
|
|
private let SMALL_DELAY = 0.1
|
|
@@ -511,7 +500,6 @@ class KMSnapshotWindowController: NSWindowController {
|
|
|
miniaturizeWindow.backgroundImage = self.windowImage
|
|
|
miniaturizeWindow.orderFront(nil)
|
|
|
self.animating = true
|
|
|
-// let hasWindow = self.hasWindow
|
|
|
|
|
|
NSAnimationContext.runAnimationGroup { context in
|
|
|
context.duration = RESIZE_TIME_FACTOR * miniaturizeWindow.animationResizeTime(endRect)
|
|
@@ -553,24 +541,23 @@ class KMSnapshotWindowController: NSWindowController {
|
|
|
}
|
|
|
self.hasWindow = false
|
|
|
}
|
|
|
+
|
|
|
+ func deminiaturize() {
|
|
|
+ if (self.animating) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if let dockRect = self.delegate?.snapshotController?(self, miniaturizedRect: false) {
|
|
|
+ let endRect = self.window?.frame ?? .zero
|
|
|
+ let startRect = self.miniaturizedRectForDockingRect(dockRect)
|
|
|
+
|
|
|
+ self.miniaturizeWindowFromRect(startRect, toRect: endRect)
|
|
|
+// SKDESTROY(windowImage);
|
|
|
+ } else {
|
|
|
+ self.showWindow(self)
|
|
|
+ }
|
|
|
+ self.hasWindow = true
|
|
|
+ }
|
|
|
/*
|
|
|
- - (void)deminiaturize {
|
|
|
- if (animating)
|
|
|
- return;
|
|
|
- if ([[self delegate] respondsToSelector:@selector(snapshotController:miniaturizedRect:)]) {
|
|
|
- NSRect dockRect = [[self delegate] snapshotController:self miniaturizedRect:NO];
|
|
|
- NSRect endRect = [[self window] frame];
|
|
|
- NSRect startRect = [self miniaturizedRectForDockingRect:dockRect];
|
|
|
-
|
|
|
- [self miniaturizeWindowFromRect:startRect toRect:endRect];
|
|
|
-
|
|
|
- SKDESTROY(windowImage);
|
|
|
- } else {
|
|
|
- [self showWindow:self];
|
|
|
- }
|
|
|
- [self setHasWindow:YES];
|
|
|
- }
|
|
|
-
|
|
|
#pragma mark KVO
|
|
|
|
|
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|