@breakside/jskit 2025.24.0 → 2025.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Info.json +2 -2
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeAtom.js +3 -1
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeEdit.js +28 -0
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeEditList.js +60 -0
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeMediaInformation.js +8 -0
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeMovieHeader.js +1 -1
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeSampleDescription.js +1 -1
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeTrack.js +2 -0
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeTrackHeader.js +2 -2
- package/Root/Frameworks/MediaKit/QuickTime/MKQuickTimeVideoMediaInformationHeader.js +59 -0
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UICursor.js +8 -0
- package/Root/Frameworks/UIKit/UIPopupWindow.js +224 -21
- package/Root/Frameworks/UIKit/UIWindow.js +26 -3
- package/Root/Frameworks/UIKit/UIWindowServer.js +252 -13
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
|
@@ -153,6 +153,10 @@ UICursor.SystemIdentifier = {
|
|
|
153
153
|
operationNotAllowed: 'not-allowed',
|
|
154
154
|
resizeLeftRight: 'col-resize',
|
|
155
155
|
resizeUpDown: 'row-resize',
|
|
156
|
+
resizeEastWest: 'ew-resize',
|
|
157
|
+
resizeNorthSouth: 'ns-resize',
|
|
158
|
+
resizeNorthEastSouthWest: 'nesw-resize',
|
|
159
|
+
resizeNorthWestSouthEast: 'nwse-resize',
|
|
156
160
|
openHand: 'grab',
|
|
157
161
|
closedHand: 'grabbing',
|
|
158
162
|
dragLink: 'alias',
|
|
@@ -167,6 +171,10 @@ UICursor.pointingHand = UICursor.initWithSystemIdentifier(UICursor.SystemIdentif
|
|
|
167
171
|
UICursor.operationNotAllowed = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.operationNotAllowed);
|
|
168
172
|
UICursor.resizeLeftRight = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.resizeLeftRight);
|
|
169
173
|
UICursor.resizeUpDown = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.resizeUpDown);
|
|
174
|
+
UICursor.resizeEastWest = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.resizeEastWest);
|
|
175
|
+
UICursor.resizeNorthSouth = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.resizeNorthSouth);
|
|
176
|
+
UICursor.resizeNorthEastSouthWest = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.resizeNorthEastSouthWest);
|
|
177
|
+
UICursor.resizeNorthWestSouthEast = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.resizeNorthWestSouthEast);
|
|
170
178
|
UICursor.openHand = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.openHand);
|
|
171
179
|
UICursor.closedHand = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.closedHand);
|
|
172
180
|
UICursor.dragLink = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.dragLink);
|
|
@@ -23,6 +23,7 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
23
23
|
showsSourceArrow: JSDynamicProperty('_showsSourceArrow', false),
|
|
24
24
|
sourceArrowSize: JSDynamicProperty('_sourceArrowSize', 10),
|
|
25
25
|
sourceSpacing: JSDynamicProperty('_sourceSpacing', 0),
|
|
26
|
+
sourceView: null,
|
|
26
27
|
isUserMovable: false,
|
|
27
28
|
placement: 0,
|
|
28
29
|
canBecomeKey: true,
|
|
@@ -41,8 +42,59 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
41
42
|
},
|
|
42
43
|
|
|
43
44
|
setShowsSourceArrow: function(showsSourceArrow){
|
|
45
|
+
if (showsSourceArrow === this._showsSourceArrow){
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (this._isOpen){
|
|
49
|
+
var frame = JSRect(this.untransformedFrame);
|
|
50
|
+
if (this.placement === UIPopupWindow.Placement.left){
|
|
51
|
+
if (this._showsSourceArrow){
|
|
52
|
+
frame.size.width -= this._actualArrowSize;
|
|
53
|
+
}else{
|
|
54
|
+
frame.size.width += this._actualArrowSize;
|
|
55
|
+
}
|
|
56
|
+
}else if (this.placement === UIPopupWindow.Placement.right){
|
|
57
|
+
if (this._showsSourceArrow){
|
|
58
|
+
frame.size.width -= this._actualArrowSize;
|
|
59
|
+
frame.origin.x += this._actualArrowSize;
|
|
60
|
+
if (this._downLocation !== null){
|
|
61
|
+
this._downLocation.x -= this._actualArrowSize;
|
|
62
|
+
}
|
|
63
|
+
}else{
|
|
64
|
+
frame.size.width += this._actualArrowSize;
|
|
65
|
+
frame.origin.x -= this._actualArrowSize;
|
|
66
|
+
if (this._downLocation !== null){
|
|
67
|
+
this._downLocation.x += this._actualArrowSize;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}else if (this.placement === UIPopupWindow.Placement.above){
|
|
71
|
+
if (this._showsSourceArrow){
|
|
72
|
+
frame.size.height -= this._actualArrowSize;
|
|
73
|
+
}else{
|
|
74
|
+
frame.size.height += this._actualArrowSize;
|
|
75
|
+
}
|
|
76
|
+
}else if (this.placement === UIPopupWindow.Placement.below){
|
|
77
|
+
if (this._showsSourceArrow){
|
|
78
|
+
frame.size.height -= this._actualArrowSize;
|
|
79
|
+
frame.origin.y += this._actualArrowSize;
|
|
80
|
+
if (this._downLocation !== null){
|
|
81
|
+
this._downLocation.y -= this._actualArrowSize;
|
|
82
|
+
}
|
|
83
|
+
}else{
|
|
84
|
+
frame.size.height += this._actualArrowSize;
|
|
85
|
+
frame.origin.y -= this._actualArrowSize;
|
|
86
|
+
if (this._downLocation !== null){
|
|
87
|
+
this._downLocation.x += this._actualArrowSize;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
this.untransformedFrame = frame;
|
|
92
|
+
}
|
|
44
93
|
this._showsSourceArrow = showsSourceArrow;
|
|
45
94
|
this._styler.updateWindow(this);
|
|
95
|
+
if (this._isOpen && !this._showsSourceArrow){
|
|
96
|
+
JSNotificationCenter.shared.post("UIPopupWindowDidDetachFromSource", this);
|
|
97
|
+
}
|
|
46
98
|
},
|
|
47
99
|
|
|
48
100
|
setSourceArrowSize: function(sourceArrowSize){
|
|
@@ -67,8 +119,12 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
67
119
|
if (animated === undefined){
|
|
68
120
|
animated = true;
|
|
69
121
|
}
|
|
70
|
-
var
|
|
71
|
-
|
|
122
|
+
var sourceBounds = view.bounds;
|
|
123
|
+
if (view.sourceRectForPopupWindow){
|
|
124
|
+
sourceBounds = view.sourceRectForPopupWindow(this);
|
|
125
|
+
}
|
|
126
|
+
var sourceFrame = view.convertRectToScreen(sourceBounds).rectWithInsets(-this._sourceSpacing);
|
|
127
|
+
var safeFrame = view.window.screen.availableFrame.rectWithInsets(20);
|
|
72
128
|
|
|
73
129
|
// Size to our content's preferred size
|
|
74
130
|
this.sizeToFit();
|
|
@@ -101,27 +157,39 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
101
157
|
);
|
|
102
158
|
if (placement == UIPopupWindow.Placement.below){
|
|
103
159
|
if (frame.size.height > available.bottom){
|
|
104
|
-
if (available.top
|
|
160
|
+
if (available.top >= available.bottom * 2){
|
|
105
161
|
placement = UIPopupWindow.Placement.above;
|
|
106
|
-
}else if (available.right
|
|
162
|
+
}else if (available.right >= frame.size.width){
|
|
107
163
|
placement = UIPopupWindow.Placement.right;
|
|
108
|
-
}else if (available.left
|
|
164
|
+
}else if (available.left >= frame.size.width){
|
|
109
165
|
placement = UIPopupWindow.Placement.left;
|
|
110
|
-
}else if (available.top
|
|
166
|
+
}else if (available.top >= frame.size.height){
|
|
111
167
|
placement = UIPopupWindow.Placement.top;
|
|
112
168
|
}
|
|
113
169
|
}
|
|
114
170
|
}else if (placement == UIPopupWindow.Placement.above){
|
|
115
|
-
if (frame.size.height > available.top
|
|
116
|
-
|
|
171
|
+
if (frame.size.height > available.top){
|
|
172
|
+
if (available.bottom >= available.top * 2){
|
|
173
|
+
placement = UIPopupWindow.Placement.below;
|
|
174
|
+
}else if (available.bottom >= frame.size.height){
|
|
175
|
+
placement = UIPopupWindow.Placement.below;
|
|
176
|
+
}
|
|
117
177
|
}
|
|
118
178
|
}else if (placement == UIPopupWindow.Placement.left){
|
|
119
|
-
if (frame.size.width > available.left
|
|
120
|
-
|
|
179
|
+
if (frame.size.width > available.left){
|
|
180
|
+
if (available.right >= frame.size.width){
|
|
181
|
+
placement = UIPopupWindow.Placement.right;
|
|
182
|
+
}else if ((this.windowServer.mouseLocation.x - safeFrame.origin.x) < frame.size.width){
|
|
183
|
+
placement = UIPopupWindow.Placement.right;
|
|
184
|
+
}
|
|
121
185
|
}
|
|
122
186
|
}else if (placement == UIPopupWindow.Placement.right){
|
|
123
|
-
if (frame.size.width > available.right
|
|
124
|
-
|
|
187
|
+
if (frame.size.width > available.right){
|
|
188
|
+
if (available.left >= frame.size.width){
|
|
189
|
+
placement = UIPopupWindow.Placement.left;
|
|
190
|
+
}else if ((safeFrame.origin.x + safeFrame.size.width - this.windowServer.mouseLocation.x) < frame.size.width){
|
|
191
|
+
placement = UIPopupWindow.Placement.left;
|
|
192
|
+
}
|
|
125
193
|
}
|
|
126
194
|
}
|
|
127
195
|
|
|
@@ -138,12 +206,22 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
138
206
|
frame.origin.y = sourceFrame.origin.y - frame.size.height;
|
|
139
207
|
}else if (placement == UIPopupWindow.Placement.left){
|
|
140
208
|
if (frame.size.width > available.left){
|
|
141
|
-
|
|
209
|
+
sourceFrame = JSRect(
|
|
210
|
+
Math.max(safeFrame.origin.x + frame.size.width, this.windowServer.mouseLocation.x),
|
|
211
|
+
sourceFrame.origin.y,
|
|
212
|
+
1,
|
|
213
|
+
sourceFrame.size.height
|
|
214
|
+
);
|
|
142
215
|
}
|
|
143
216
|
frame.origin.x = sourceFrame.origin.x - frame.size.width;
|
|
144
217
|
}else if (placement == UIPopupWindow.Placement.right){
|
|
145
218
|
if (frame.size.width > available.right){
|
|
146
|
-
|
|
219
|
+
sourceFrame = JSRect(
|
|
220
|
+
Math.min(safeFrame.origin.x + safeFrame.size.width - frame.size.width, this.windowServer.mouseLocation.x) - 1,
|
|
221
|
+
sourceFrame.origin.y,
|
|
222
|
+
1,
|
|
223
|
+
sourceFrame.size.height
|
|
224
|
+
);
|
|
147
225
|
}
|
|
148
226
|
frame.origin.x = sourceFrame.origin.x + sourceFrame.size.width;
|
|
149
227
|
}
|
|
@@ -153,8 +231,8 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
153
231
|
if (frame.origin.x + frame.size.width > safeFrame.origin.x + safeFrame.size.width){
|
|
154
232
|
frame.origin.x = safeFrame.origin.x + safeFrame.size.width - frame.size.width;
|
|
155
233
|
}
|
|
156
|
-
if (frame.origin.x <
|
|
157
|
-
frame.origin.x =
|
|
234
|
+
if (frame.origin.x < safeFrame.origin.x){
|
|
235
|
+
frame.origin.x = safeFrame.origin.x;
|
|
158
236
|
if (frame.size.width > safeFrame.size.width){
|
|
159
237
|
frame.size.width = safeFrame.size.width;
|
|
160
238
|
}
|
|
@@ -164,8 +242,8 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
164
242
|
if (frame.origin.y + frame.size.height > safeFrame.origin.y + safeFrame.size.height){
|
|
165
243
|
frame.origin.y = safeFrame.origin.y + safeFrame.size.height - frame.size.height;
|
|
166
244
|
}
|
|
167
|
-
if (frame.origin.y <
|
|
168
|
-
frame.origin.y =
|
|
245
|
+
if (frame.origin.y < safeFrame.origin.y){
|
|
246
|
+
frame.origin.y = safeFrame.origin.y;
|
|
169
247
|
if (frame.size.height > safeFrame.size.height){
|
|
170
248
|
frame.size.height = safeFrame.size.height;
|
|
171
249
|
}
|
|
@@ -216,6 +294,7 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
216
294
|
|
|
217
295
|
this.placement = placement;
|
|
218
296
|
this.frame = frame;
|
|
297
|
+
this.sourceView = view;
|
|
219
298
|
|
|
220
299
|
// Create animated opening, closing
|
|
221
300
|
if (animated){
|
|
@@ -241,12 +320,96 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
241
320
|
this.makeKeyAndOrderFront();
|
|
242
321
|
},
|
|
243
322
|
|
|
323
|
+
repositionSourceArrow: function(){
|
|
324
|
+
var view = this.sourceView;
|
|
325
|
+
if (view === null){
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
var sourceFrame = view.convertRectToScreen(view.bounds);
|
|
329
|
+
var frame = this.untransformedFrame;
|
|
330
|
+
if (sourceFrame === null){
|
|
331
|
+
this.sourceView = null;
|
|
332
|
+
this.showsSourceArrow = false;
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
var x, y;
|
|
336
|
+
var minY = frame.origin.y + this.styler.cornerRadius + this._actualArrowSize;
|
|
337
|
+
var maxY = frame.origin.y + frame.size.height - this.styler.cornerRadius - this._actualArrowSize;
|
|
338
|
+
var minX = frame.origin.x + this.styler.cornerRadius + this._actualArrowSize;
|
|
339
|
+
var maxX = frame.origin.x + frame.size.width - this.styler.cornerRadius - this._actualArrowSize;
|
|
340
|
+
if (this.placement === UIPopupWindow.Placement.left){
|
|
341
|
+
x = sourceFrame.origin.x - this._sourceSpacing;
|
|
342
|
+
if (Math.abs(frame.origin.x + frame.size.width - x) < 1){
|
|
343
|
+
y = sourceFrame.center.y;
|
|
344
|
+
if (y >= minY && y <= maxY){
|
|
345
|
+
this.anchorPoint = JSPoint(1, (y - frame.origin.y) / frame.size.height);
|
|
346
|
+
this.untransformedFrame = frame;
|
|
347
|
+
this.setNeedsLayout();
|
|
348
|
+
}else{
|
|
349
|
+
this.sourceView = null;
|
|
350
|
+
this.showsSourceArrow = false;
|
|
351
|
+
}
|
|
352
|
+
}else{
|
|
353
|
+
this.sourceView = null;
|
|
354
|
+
this.showsSourceArrow = false;
|
|
355
|
+
}
|
|
356
|
+
}else if (this.placement === UIPopupWindow.Placement.right){
|
|
357
|
+
x = sourceFrame.origin.x + sourceFrame.size.width + this._sourceSpacing;
|
|
358
|
+
if (Math.abs(frame.origin.x - x) < 1){
|
|
359
|
+
y = sourceFrame.center.y;
|
|
360
|
+
if (y >= minY && y <= maxY){
|
|
361
|
+
this.anchorPoint = JSPoint(0, (y - frame.origin.y) / frame.size.height);
|
|
362
|
+
this.untransformedFrame = frame;
|
|
363
|
+
this.setNeedsLayout();
|
|
364
|
+
}else{
|
|
365
|
+
this.sourceView = null;
|
|
366
|
+
this.showsSourceArrow = false;
|
|
367
|
+
}
|
|
368
|
+
}else{
|
|
369
|
+
this.sourceView = null;
|
|
370
|
+
this.showsSourceArrow = false;
|
|
371
|
+
}
|
|
372
|
+
}else if (this.placement === UIPopupWindow.Placement.above){
|
|
373
|
+
y = sourceFrame.origin.y - this._sourceSpacing;
|
|
374
|
+
if (Math.abs(frame.origin.y + frame.size.height - y) < 1){
|
|
375
|
+
x = sourceFrame.center.x;
|
|
376
|
+
if (x >= minX && x <= maxX){
|
|
377
|
+
this.anchorPoint = JSPoint((x - frame.origin.x) / frame.size.width, 1);
|
|
378
|
+
this.untransformedFrame = frame;
|
|
379
|
+
this.setNeedsLayout();
|
|
380
|
+
}else{
|
|
381
|
+
this.sourceView = null;
|
|
382
|
+
this.showsSourceArrow = false;
|
|
383
|
+
}
|
|
384
|
+
}else{
|
|
385
|
+
this.sourceView = null;
|
|
386
|
+
this.showsSourceArrow = false;
|
|
387
|
+
}
|
|
388
|
+
}else if (this.placement === UIPopupWindow.Placement.below){
|
|
389
|
+
y = sourceFrame.origin.y + sourceFrame.size.height + this._sourceSpacing;
|
|
390
|
+
if (Math.abs(frame.origin.y - y) < 1){
|
|
391
|
+
x = sourceFrame.center.x;
|
|
392
|
+
if (x >= minX && x <= maxX){
|
|
393
|
+
this.anchorPoint = JSPoint((x - frame.origin.x) / frame.size.width, 0);
|
|
394
|
+
this.untransformedFrame = frame;
|
|
395
|
+
this.setNeedsLayout();
|
|
396
|
+
}else{
|
|
397
|
+
this.sourceView = null;
|
|
398
|
+
this.showsSourceArrow = false;
|
|
399
|
+
}
|
|
400
|
+
}else{
|
|
401
|
+
this.sourceView = null;
|
|
402
|
+
this.showsSourceArrow = false;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
|
|
244
407
|
openCenteredInView: function(view, animated){
|
|
245
408
|
if (animated === undefined){
|
|
246
409
|
animated = true;
|
|
247
410
|
}
|
|
248
411
|
var sourceFrame = view.convertRectToScreen(view.bounds);
|
|
249
|
-
var safeFrame = view.window.screen.availableFrame;
|
|
412
|
+
var safeFrame = view.window.screen.availableFrame.rectWithInsets(20);
|
|
250
413
|
|
|
251
414
|
this.sizeToFit();
|
|
252
415
|
var frame = JSRect(this.frame);
|
|
@@ -281,9 +444,12 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
281
444
|
this.closeAnimator = closeAnimator;
|
|
282
445
|
}
|
|
283
446
|
}
|
|
284
|
-
|
|
285
447
|
this.makeKeyAndOrderFront();
|
|
448
|
+
},
|
|
286
449
|
|
|
450
|
+
close: function(){
|
|
451
|
+
UIPopupWindow.$super.close.call(this);
|
|
452
|
+
this.sourceView = null;
|
|
287
453
|
},
|
|
288
454
|
|
|
289
455
|
modalIndicationClosesWindow: false,
|
|
@@ -300,7 +466,41 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
300
466
|
UIPopupWindow.$super.indicateModalStatus.call(this);
|
|
301
467
|
},
|
|
302
468
|
|
|
303
|
-
accessibilityRole: UIAccessibility.Role.popover
|
|
469
|
+
accessibilityRole: UIAccessibility.Role.popover,
|
|
470
|
+
|
|
471
|
+
minimumMoveDistance: 10,
|
|
472
|
+
|
|
473
|
+
mouseDragged: function(event){
|
|
474
|
+
if (this._showsSourceArrow && this._isMoving){
|
|
475
|
+
var frameBeforeMoving = this.frame;
|
|
476
|
+
var location = this.convertPointToScreen(event.locationInWindow);
|
|
477
|
+
var distance = this._downLocation ? location.distanceToPoint(this._downLocation) : JSPoint.Zero;
|
|
478
|
+
UIPopupWindow.$super.mouseDragged.call(this, event);
|
|
479
|
+
this._didMove = distance >= this.minimumMoveDistance;
|
|
480
|
+
if (this._didMove){
|
|
481
|
+
this.showsSourceArrow = false;
|
|
482
|
+
}else{
|
|
483
|
+
this.frame = frameBeforeMoving;
|
|
484
|
+
}
|
|
485
|
+
}else{
|
|
486
|
+
UIPopupWindow.$super.mouseDragged.call(this, event);
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
|
|
490
|
+
_windowServerDidResize: function(frameBeforeResize){
|
|
491
|
+
UIPopupWindow.$super._windowServerDidResize.call(this);
|
|
492
|
+
if (this._showsSourceArrow){
|
|
493
|
+
var frameBeforeReposition = JSRect(this.untransformedFrame);
|
|
494
|
+
this.repositionSourceArrow();
|
|
495
|
+
if (!this._showsSourceArrow){
|
|
496
|
+
var frameAfterReposition = this.untransformedFrame;
|
|
497
|
+
frameBeforeResize.origin.x += frameAfterReposition.origin.x - frameBeforeReposition.origin.x;
|
|
498
|
+
frameBeforeResize.origin.y += frameAfterReposition.origin.y - frameBeforeReposition.origin.y;
|
|
499
|
+
frameBeforeResize.size.width += frameAfterReposition.size.width - frameBeforeReposition.size.width;
|
|
500
|
+
frameBeforeResize.size.height += frameAfterReposition.size.height - frameBeforeReposition.size.height;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
304
504
|
|
|
305
505
|
});
|
|
306
506
|
|
|
@@ -428,6 +628,9 @@ JSClass("UIPopupWindowStyler", UIWindowStyler, {
|
|
|
428
628
|
popupArrow.position = anchorPosition;
|
|
429
629
|
popupArrow.anchorPoint = JSPoint(0.5, 0);
|
|
430
630
|
}
|
|
631
|
+
window._resizeView = popupBacking;
|
|
632
|
+
}else{
|
|
633
|
+
window._resizeView = null;
|
|
431
634
|
}
|
|
432
635
|
window._contentView.frame = window.bounds.rectWithInsets(contentInsets);
|
|
433
636
|
},
|
|
@@ -327,6 +327,9 @@ JSClass('UIWindow', UIView, {
|
|
|
327
327
|
this._setTraitCollection(traits);
|
|
328
328
|
}
|
|
329
329
|
},
|
|
330
|
+
|
|
331
|
+
_windowServerDidResize: function(){
|
|
332
|
+
},
|
|
330
333
|
|
|
331
334
|
traitCollection: JSReadOnlyProperty('_traitCollection', null),
|
|
332
335
|
|
|
@@ -417,6 +420,7 @@ JSClass('UIWindow', UIView, {
|
|
|
417
420
|
if (!this._isOpen){
|
|
418
421
|
return;
|
|
419
422
|
}
|
|
423
|
+
JSNotificationCenter.shared.post("UIWindowWillClose", this);
|
|
420
424
|
if (this.viewController){
|
|
421
425
|
this.viewController.viewWillDisappear(false);
|
|
422
426
|
}else if (this._contentViewController){
|
|
@@ -426,13 +430,14 @@ JSClass('UIWindow', UIView, {
|
|
|
426
430
|
this.openAnimator.stopAndCallCompletions();
|
|
427
431
|
}
|
|
428
432
|
if (this.closeAnimator !== null){
|
|
429
|
-
var self = this;
|
|
430
433
|
this.closeAnimator.addCompletion(function(){
|
|
431
|
-
|
|
432
|
-
|
|
434
|
+
this.windowServer.windowRemoved(this);
|
|
435
|
+
JSNotificationCenter.shared.post("UIWindowDidClose", this);
|
|
436
|
+
}, this);
|
|
433
437
|
this.closeAnimator.start();
|
|
434
438
|
}else{
|
|
435
439
|
this.windowServer.windowRemoved(this);
|
|
440
|
+
JSNotificationCenter.shared.post("UIWindowDidClose", this);
|
|
436
441
|
}
|
|
437
442
|
this._isOpen = false;
|
|
438
443
|
},
|
|
@@ -663,6 +668,24 @@ JSClass('UIWindow', UIView, {
|
|
|
663
668
|
return responder;
|
|
664
669
|
},
|
|
665
670
|
|
|
671
|
+
minimumSize: JSDynamicProperty("_minimumSize", null),
|
|
672
|
+
maximumSize: JSDynamicProperty("_maximumSize", null),
|
|
673
|
+
_canResizeWidth: false,
|
|
674
|
+
_canResizeHeight: false,
|
|
675
|
+
_resizeView: null,
|
|
676
|
+
|
|
677
|
+
setMinimumSize: function(minimumSize){
|
|
678
|
+
this._minimumSize = JSSize(minimumSize);
|
|
679
|
+
this._canResizeWidth = this._minimumSize !== null && this._maximumSize !== null && this._minimumSize.width !== this._maximumSize.width;
|
|
680
|
+
this._canResizeHeight = this._minimumSize !== null && this._maximumSize !== null && this._minimumSize.height !== this._maximumSize.height;
|
|
681
|
+
},
|
|
682
|
+
|
|
683
|
+
setMaximumSize: function(maximumSize){
|
|
684
|
+
this._maximumSize = JSSize(maximumSize);
|
|
685
|
+
this._canResizeWidth = this._minimumSize !== null && this._maximumSize !== null && this._minimumSize.width !== this._maximumSize.width;
|
|
686
|
+
this._canResizeHeight = this._minimumSize !== null && this._maximumSize !== null && this._minimumSize.height !== this._maximumSize.height;
|
|
687
|
+
},
|
|
688
|
+
|
|
666
689
|
// -------------------------------------------------------------------------
|
|
667
690
|
// MARK: - First Responder
|
|
668
691
|
|