@breakside/jskit 2021.40.1 → 2021.43.0
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/JS/JSClass.js +8 -5
- package/Frameworks/Foundation.jsframework/JS/JSDateFormatter.js +81 -8
- package/Frameworks/Foundation.jsframework/JS/JSImage.js +1 -0
- package/Frameworks/Foundation.jsframework/JS/JSIndexPath.js +3 -0
- package/Frameworks/Foundation.jsframework/JS/JSLocale.js +536 -4
- package/Frameworks/Foundation.jsframework/JS/JSNumberFormatter.js +20 -7
- package/Frameworks/Foundation.jsframework/JS/JSTimeZone.js +6 -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/Foundation/JSClass.js +8 -5
- package/Root/Frameworks/Foundation/JSDateFormatter.js +81 -8
- package/Root/Frameworks/Foundation/JSImage.js +1 -0
- package/Root/Frameworks/Foundation/JSIndexPath.js +3 -0
- package/Root/Frameworks/Foundation/JSLocale.js +536 -4
- package/Root/Frameworks/Foundation/JSNumberFormatter.js +20 -7
- package/Root/Frameworks/Foundation/JSTimeZone.js +6 -2
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- 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/UIButton.js +8 -6
- package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +3 -4
- package/Root/Frameworks/UIKit/UILayer.js +17 -0
- package/Root/Frameworks/UIKit/UIListView.js +44 -28
- package/Root/Frameworks/UIKit/UINavigationBar.js +13 -14
- package/Root/Frameworks/UIKit/UINavigationItem.js +4 -0
- package/Root/Frameworks/UIKit/UIPopupButton.js +3 -0
- package/Root/Frameworks/UIKit/UISplitViewController.js +37 -22
- package/Root/Frameworks/UIKit/UIToolbar.js +1 -1
- package/Root/Frameworks/UIKit/UIView.js +1 -0
- package/Root/Frameworks/UIKit/UIWindow.js +42 -3
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
|
@@ -440,18 +440,20 @@ JSClass("UIButtonStyler", UIControlStyler, {
|
|
|
440
440
|
var image = button.getImageForState(UIControl.State.normal);
|
|
441
441
|
var contentRect = button.bounds.rectWithInsets(button._titleInsets);
|
|
442
442
|
if (button._titleLabel !== null){
|
|
443
|
+
var titleSize = button._titleLabel.intrinsicSize;
|
|
444
|
+
var x, y;
|
|
443
445
|
if (image !== null){
|
|
444
446
|
var imageScale = contentRect.size.height / image.size.height;
|
|
445
447
|
var imageSize = JSSize(image.size.width * imageScale, contentRect.size.height);
|
|
446
448
|
button._imageView.frame = JSRect(contentRect.origin, imageSize);
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
var titleSize = button._titleLabel.intrinsicSize;
|
|
450
|
-
var y = (contentRect.size.height - titleSize.height) / 2;
|
|
451
|
-
button._titleLabel.frame = JSRect(x, contentRect.origin.y + y, w, titleSize.height);
|
|
449
|
+
x = contentRect.origin.x + imageSize.width + this.titleImageSpacing;
|
|
450
|
+
y = (contentRect.size.height - titleSize.height) / 2;
|
|
452
451
|
}else{
|
|
453
|
-
|
|
452
|
+
x = contentRect.origin.x;
|
|
453
|
+
y = (contentRect.size.height - titleSize.height) / 2;
|
|
454
454
|
}
|
|
455
|
+
var w = Math.max(0, contentRect.origin.x + contentRect.size.width - x);
|
|
456
|
+
button._titleLabel.frame = JSRect(x, contentRect.origin.y + y, w, titleSize.height);
|
|
455
457
|
}else if (image !== null){
|
|
456
458
|
button._imageView.frame = contentRect;
|
|
457
459
|
}
|
|
@@ -936,11 +936,10 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
|
|
|
936
936
|
color = window.backgroundColor;
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
|
-
if (color
|
|
940
|
-
|
|
941
|
-
}else{
|
|
942
|
-
this.themeColorElement.setAttribute("content", JSColor.background);
|
|
939
|
+
if (color === null){
|
|
940
|
+
color = JSColor.background;
|
|
943
941
|
}
|
|
942
|
+
this.themeColorElement.setAttribute("content", color.cssString());
|
|
944
943
|
},
|
|
945
944
|
|
|
946
945
|
// --------------------------------------------------------------------
|
|
@@ -145,6 +145,23 @@ JSClass("UILayer", JSObject, {
|
|
|
145
145
|
this.didChangeProperty('position');
|
|
146
146
|
},
|
|
147
147
|
|
|
148
|
+
untransformedFrame: JSDynamicProperty(),
|
|
149
|
+
|
|
150
|
+
getUntransformedFrame: function(){
|
|
151
|
+
var bounds = this.model.bounds;
|
|
152
|
+
var anchorPoint = this.model.anchorPoint;
|
|
153
|
+
var offset = JSPoint(anchorPoint.x * bounds.size.width, anchorPoint.y * bounds.size.height);
|
|
154
|
+
return JSRect(this.model.position.subtracting(offset), bounds.size);
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
setUntransformedFrame: function(frame){
|
|
158
|
+
var bounds = this.model.bounds;
|
|
159
|
+
var anchorPoint = this.model.anchorPoint;
|
|
160
|
+
var offset = JSPoint(anchorPoint.x * frame.size.width, anchorPoint.y * frame.size.height);
|
|
161
|
+
this.bounds = JSRect(bounds.origin, frame.size);
|
|
162
|
+
this.position = frame.origin.adding(offset);
|
|
163
|
+
},
|
|
164
|
+
|
|
148
165
|
setBounds: function(bounds){
|
|
149
166
|
// When the bounds origin changes, it's like a scrolling view, and we need to update the sublayers
|
|
150
167
|
// When the bounds change size, the position and frame both need to be recalculated accordingly
|
|
@@ -142,6 +142,12 @@ JSClass("UIListView", UIScrollView, {
|
|
|
142
142
|
if (spec.containsKey("showsFocusRing")){
|
|
143
143
|
this._showsFocusRing = spec.valueForKey("showsFocusRing");
|
|
144
144
|
}
|
|
145
|
+
if (spec.containsKey("listHeaderView")){
|
|
146
|
+
this.listHeaderView = spec.valueForKey("listHeaderView", UIView);
|
|
147
|
+
}
|
|
148
|
+
if (spec.containsKey("listFooterView")){
|
|
149
|
+
this.listFooterView = spec.valueForKey("listFooterView", UIView);
|
|
150
|
+
}
|
|
145
151
|
},
|
|
146
152
|
|
|
147
153
|
_commonListInit: function(){
|
|
@@ -1553,8 +1559,7 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1553
1559
|
cell.position = JSPoint(rect.origin.x + cell.bounds.size.width * cell.anchorPoint.x, rect.origin.y + cell.bounds.size.height * cell.anchorPoint.y);
|
|
1554
1560
|
cell.active = false;
|
|
1555
1561
|
this._updateCellState(cell);
|
|
1556
|
-
|
|
1557
|
-
styler.updateCell(cell, indexPath);
|
|
1562
|
+
cell.update();
|
|
1558
1563
|
cell.setNeedsLayout();
|
|
1559
1564
|
return cell;
|
|
1560
1565
|
},
|
|
@@ -1961,12 +1966,10 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1961
1966
|
|
|
1962
1967
|
_updateVisibleCellStyles: function(){
|
|
1963
1968
|
var item;
|
|
1964
|
-
var styler;
|
|
1965
1969
|
for (var i = 0, l = this._visibleItems.length; i < l; ++i){
|
|
1966
1970
|
item = this._visibleItems[i];
|
|
1967
1971
|
if (item.kind === VisibleItem.Kind.cell){
|
|
1968
|
-
|
|
1969
|
-
styler.updateCell(item.view, item.view.indexPath);
|
|
1972
|
+
item.view.update();
|
|
1970
1973
|
}
|
|
1971
1974
|
}
|
|
1972
1975
|
},
|
|
@@ -2291,18 +2294,16 @@ JSClass("UIListView", UIScrollView, {
|
|
|
2291
2294
|
// --------------------------------------------------------------------
|
|
2292
2295
|
// MARK: - Touch Events
|
|
2293
2296
|
|
|
2294
|
-
|
|
2295
|
-
_touchTimer: null,
|
|
2297
|
+
_touch: null,
|
|
2296
2298
|
|
|
2297
2299
|
_cancelTouchSelection: function(){
|
|
2298
|
-
if (this.
|
|
2299
|
-
this.
|
|
2300
|
-
this._touchActiveCell = null;
|
|
2300
|
+
if (this._touch.cell){
|
|
2301
|
+
this._touch.cell.active = false;
|
|
2301
2302
|
}
|
|
2302
|
-
if (this.
|
|
2303
|
-
this.
|
|
2304
|
-
this._touchTimer = null;
|
|
2303
|
+
if (this._touch.timer !== null){
|
|
2304
|
+
this._touch.timer.invalidate();
|
|
2305
2305
|
}
|
|
2306
|
+
this._touch = null;
|
|
2306
2307
|
},
|
|
2307
2308
|
|
|
2308
2309
|
_makeTouchActiveCell: function(touch){
|
|
@@ -2316,7 +2317,7 @@ JSClass("UIListView", UIScrollView, {
|
|
|
2316
2317
|
return;
|
|
2317
2318
|
}
|
|
2318
2319
|
cell.active = true;
|
|
2319
|
-
this.
|
|
2320
|
+
this._touch.cell = cell;
|
|
2320
2321
|
},
|
|
2321
2322
|
|
|
2322
2323
|
touchesBegan: function(touches, event){
|
|
@@ -2324,15 +2325,25 @@ JSClass("UIListView", UIScrollView, {
|
|
|
2324
2325
|
if (touches.length > 1){
|
|
2325
2326
|
return;
|
|
2326
2327
|
}
|
|
2327
|
-
this.
|
|
2328
|
-
this
|
|
2329
|
-
|
|
2330
|
-
|
|
2328
|
+
this._touch = {
|
|
2329
|
+
location0: touches[0].locationInView(this),
|
|
2330
|
+
cell: null,
|
|
2331
|
+
timer: JSTimer.scheduledTimerWithInterval(0.05, function(){
|
|
2332
|
+
this._touch.timer = null;
|
|
2333
|
+
this._makeTouchActiveCell(touches[0]);
|
|
2334
|
+
}, this)
|
|
2335
|
+
};
|
|
2331
2336
|
},
|
|
2332
2337
|
|
|
2333
2338
|
touchesMoved: function(touches, event){
|
|
2334
2339
|
UIListView.$super.touchesMoved.call(this, touches, event);
|
|
2335
|
-
this.
|
|
2340
|
+
if (this._touch !== null){
|
|
2341
|
+
var location = touches[0].locationInView(this);
|
|
2342
|
+
var diff = location.subtracting(this._touch.location0);
|
|
2343
|
+
if ((diff.x * diff.x + diff.y * diff.y) > 2){
|
|
2344
|
+
this._cancelTouchSelection();
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2336
2347
|
},
|
|
2337
2348
|
|
|
2338
2349
|
touchesEnded: function(touches, event){
|
|
@@ -2340,15 +2351,16 @@ JSClass("UIListView", UIScrollView, {
|
|
|
2340
2351
|
if (touches.length > 1){
|
|
2341
2352
|
return;
|
|
2342
2353
|
}
|
|
2343
|
-
if (this.
|
|
2344
|
-
this.
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2354
|
+
if (this._touch !== null){
|
|
2355
|
+
if (this._touch.timer !== null){
|
|
2356
|
+
this._touch.timer.invalidate();
|
|
2357
|
+
this._makeTouchActiveCell(touches[0]);
|
|
2358
|
+
}
|
|
2359
|
+
if (this._touch.cell){
|
|
2360
|
+
this._touch.cell.active = false;
|
|
2361
|
+
this._setSelectedIndexPaths([this._touch.cell.indexPath], {notifyDelegate: true});
|
|
2362
|
+
}
|
|
2363
|
+
this._touch = null;
|
|
2352
2364
|
}
|
|
2353
2365
|
},
|
|
2354
2366
|
|
|
@@ -2378,6 +2390,10 @@ JSClass("UIListView", UIScrollView, {
|
|
|
2378
2390
|
return null;
|
|
2379
2391
|
},
|
|
2380
2392
|
|
|
2393
|
+
indexPathOfCell: function(cell){
|
|
2394
|
+
return cell.indexPath;
|
|
2395
|
+
},
|
|
2396
|
+
|
|
2381
2397
|
/// Get the visible cell that contains the given location, if any
|
|
2382
2398
|
///
|
|
2383
2399
|
/// Only visible cells are checked in the search, because those are the only
|
|
@@ -44,7 +44,7 @@ JSClass("UINavigationBar", UIView, {
|
|
|
44
44
|
this._items = [];
|
|
45
45
|
|
|
46
46
|
if (spec.containsKey("styler")){
|
|
47
|
-
this._styler = spec.valueForKey("styler",
|
|
47
|
+
this._styler = spec.valueForKey("styler", UINavigationBar.Styler);
|
|
48
48
|
}
|
|
49
49
|
this._commonNavigationBarInit();
|
|
50
50
|
},
|
|
@@ -90,11 +90,11 @@ JSClass("UINavigationBar", UIView, {
|
|
|
90
90
|
pushAnimator: null,
|
|
91
91
|
|
|
92
92
|
createPushAnimator: function(){
|
|
93
|
-
return UIViewPropertyAnimator.initWithDuration(0.2, UIAnimation.Timing.
|
|
93
|
+
return UIViewPropertyAnimator.initWithDuration(0.2, UIAnimation.Timing.easeInOut);
|
|
94
94
|
},
|
|
95
95
|
|
|
96
96
|
createPopAnimator: function(){
|
|
97
|
-
return UIViewPropertyAnimator.initWithDuration(0.2, UIAnimation.Timing.
|
|
97
|
+
return UIViewPropertyAnimator.initWithDuration(0.2, UIAnimation.Timing.easeInOut);
|
|
98
98
|
},
|
|
99
99
|
|
|
100
100
|
pushItem: function(item, animated){
|
|
@@ -510,10 +510,10 @@ JSClass("UINavigationBarDefaultStyler", UINavigationBarStyler, {
|
|
|
510
510
|
}
|
|
511
511
|
removingBackBarItemView.alpha = 0;
|
|
512
512
|
removingTitleLabel.alpha = 0;
|
|
513
|
-
removingTitleLabel.transform = JSAffineTransform.Translated(backTitleFrame.origin.x - removingTitleLabel.frame.origin.x, 0).scaledBy(1 / backToTitleScale);
|
|
513
|
+
removingTitleLabel.transform = JSAffineTransform.Translated(Math.min(0, backTitleFrame.origin.x - removingTitleLabel.frame.origin.x), 0).scaledBy(1 / backToTitleScale);
|
|
514
514
|
if (removingCustomView){
|
|
515
515
|
removingCustomView.alpha = 0;
|
|
516
|
-
removingCustomView.transform = JSAffineTransform.Translated(backTitleFrame.origin.x - removingCustomView.frame.origin.x, 0).scaledBy(1 / backToTitleScale);
|
|
516
|
+
removingCustomView.transform = JSAffineTransform.Translated(Math.min(0, backTitleFrame.origin.x - removingCustomView.frame.origin.x), 0).scaledBy(1 / backToTitleScale);
|
|
517
517
|
}
|
|
518
518
|
props.titleLabel.alpha = 1;
|
|
519
519
|
props.titleLabel.transform = JSAffineTransform.Identity;
|
|
@@ -570,10 +570,10 @@ JSClass("UINavigationBarDefaultStyler", UINavigationBarStyler, {
|
|
|
570
570
|
props.backBarItemView.alpha = 0;
|
|
571
571
|
var backTitleFrame = removingBackBarItemView.titleLabel.convertRectToView(removingBackBarItemView.titleLabel.bounds, props.backBarItemView.superview);
|
|
572
572
|
if (props.customView){
|
|
573
|
-
props.customView.transform = JSAffineTransform.Translated(backTitleFrame.origin.x - props.customView.frame.origin.x, 0).scaledBy(1 / backToTitleScale);
|
|
573
|
+
props.customView.transform = JSAffineTransform.Translated(Math.min(0, backTitleFrame.origin.x - props.customView.frame.origin.x), 0).scaledBy(1 / backToTitleScale);
|
|
574
574
|
props.customView.alpha = 0;
|
|
575
575
|
}else{
|
|
576
|
-
props.titleLabel.transform = JSAffineTransform.Translated(backTitleFrame.origin.x - props.titleLabel.frame.origin.x, 0).scaledBy(1 / backToTitleScale);
|
|
576
|
+
props.titleLabel.transform = JSAffineTransform.Translated(Math.min(0, backTitleFrame.origin.x - props.titleLabel.frame.origin.x), 0).scaledBy(1 / backToTitleScale);
|
|
577
577
|
}
|
|
578
578
|
animator.addAnimations(function(){
|
|
579
579
|
var i, l;
|
|
@@ -693,6 +693,7 @@ JSClass("UINavigationBarDefaultStyler", UINavigationBarStyler, {
|
|
|
693
693
|
},
|
|
694
694
|
|
|
695
695
|
layoutBar: function(navigationBar){
|
|
696
|
+
var item = navigationBar.topItem;
|
|
696
697
|
var size = navigationBar.bounds.size;
|
|
697
698
|
var props = navigationBar.stylerProperties;
|
|
698
699
|
var xLeft = this.itemInsets.left;
|
|
@@ -706,7 +707,7 @@ JSClass("UINavigationBarDefaultStyler", UINavigationBarStyler, {
|
|
|
706
707
|
if (!barItemView.hidden){
|
|
707
708
|
xLeft += barItemView.bounds.size.width;
|
|
708
709
|
}
|
|
709
|
-
for (i = 0, l = props.leftBarItemViews; i < l; ++i){
|
|
710
|
+
for (i = 0, l = props.leftBarItemViews.length; i < l; ++i){
|
|
710
711
|
barItemView = props.leftBarItemViews[i];
|
|
711
712
|
barItemView.sizeToFitSize(JSSize(xRight - xLeft, itemHeight));
|
|
712
713
|
barItemView.frame = JSRect(JSPoint(xLeft, y + (itemHeight - barItemView.bounds.size.height) / 2), barItemView.bounds.size);
|
|
@@ -731,20 +732,18 @@ JSClass("UINavigationBarDefaultStyler", UINavigationBarStyler, {
|
|
|
731
732
|
props.titleLabel.hidden = false;
|
|
732
733
|
titleView = props.titleLabel;
|
|
733
734
|
}
|
|
734
|
-
titleView.sizeToFitSize(JSSize(availableTitleWidth,
|
|
735
|
+
titleView.sizeToFitSize(JSSize(availableTitleWidth, size.height));
|
|
735
736
|
var viewSize = titleView.bounds.size;
|
|
736
737
|
var minX = xLeft;
|
|
737
738
|
var maxX = xRight - viewSize.width;
|
|
738
739
|
var centeredX = (size.width - viewSize.width) / 2;
|
|
739
740
|
var centeredY = (size.height - viewSize.height) / 2;
|
|
740
|
-
|
|
741
|
+
var titleTextAlignment = item ? item.titleTextAlignment || this.titleTextAlignment : this.titleTextAlignment;
|
|
742
|
+
if (titleTextAlignment === JSTextAlignment.center){
|
|
741
743
|
titleView.frame = JSRect(JSPoint(Math.min(Math.max(minX, centeredX), maxX), centeredY), viewSize);
|
|
742
|
-
}else if (
|
|
744
|
+
}else if (titleTextAlignment === JSTextAlignment.right){
|
|
743
745
|
titleView.frame = JSRect(JSPoint(maxX - viewSize.width, centeredY), viewSize);
|
|
744
746
|
}else{
|
|
745
|
-
if (props.backBarItemView && props.backBarItemView.hidden){
|
|
746
|
-
minX += props.backBarItemView.bounds.size.width;
|
|
747
|
-
}
|
|
748
747
|
titleView.frame = JSRect(JSPoint(minX, centeredY), viewSize);
|
|
749
748
|
}
|
|
750
749
|
}else{
|
|
@@ -25,6 +25,7 @@ JSClass("UINavigationItem", JSObject, {
|
|
|
25
25
|
rightBarItems: JSDynamicProperty('_rightBarItems', null),
|
|
26
26
|
leftBarItems: JSDynamicProperty('_leftBarItems', null),
|
|
27
27
|
hidesBackButton: false,
|
|
28
|
+
titleTextAlignment: null,
|
|
28
29
|
|
|
29
30
|
init: function(args){
|
|
30
31
|
this._rightBarItems = [];
|
|
@@ -45,6 +46,9 @@ JSClass("UINavigationItem", JSObject, {
|
|
|
45
46
|
if (spec.containsKey("hidesBackButton")){
|
|
46
47
|
this.hidesBackButton = spec.valueForKey("hidesBackButton");
|
|
47
48
|
}
|
|
49
|
+
if (spec.containsKey("titleTextAlignment")){
|
|
50
|
+
this.titleTextAlignment = spec.valueForKey("titleTextAlignment", JSTextAlignment);
|
|
51
|
+
}
|
|
48
52
|
this._rightBarItems = [];
|
|
49
53
|
this._leftBarItems = [];
|
|
50
54
|
var i, l;
|
|
@@ -566,6 +566,9 @@ JSClass("UIPopupButtonCustomStyler", UIPopupButtonStyler, {
|
|
|
566
566
|
if (spec.containsKey("indicatorSpacing")){
|
|
567
567
|
this.indicatorSpacing = spec.valueForKey("indicatorSpacing");
|
|
568
568
|
}
|
|
569
|
+
if (spec.containsKey("cornerRadius")){
|
|
570
|
+
this.cornerRadius = spec.valueForKey("cornerRadius");
|
|
571
|
+
}
|
|
569
572
|
|
|
570
573
|
this._fillInMissingColors();
|
|
571
574
|
},
|
|
@@ -31,8 +31,6 @@ JSClass("UISplitViewController", UIViewController, {
|
|
|
31
31
|
splitView: JSReadOnlyProperty(),
|
|
32
32
|
_defaultViewClass: UISplitView,
|
|
33
33
|
|
|
34
|
-
_mainHidden: false,
|
|
35
|
-
|
|
36
34
|
initWithSpec: function(spec){
|
|
37
35
|
if (spec.containsKey('leadingViewController')){
|
|
38
36
|
this._leadingViewController = spec.valueForKey("leadingViewController");
|
|
@@ -190,6 +188,10 @@ JSClass("UISplitViewController", UIViewController, {
|
|
|
190
188
|
},
|
|
191
189
|
|
|
192
190
|
setMainViewController: function(mainViewController){
|
|
191
|
+
if (this.isViewLoaded && this.view.mainHidden){
|
|
192
|
+
this._setMainViewControllerCollapsed(mainViewController);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
193
195
|
var callAppearanceMethods = this.isViewVisible;
|
|
194
196
|
var disappearingViewController = null;
|
|
195
197
|
if (this._mainViewController !== null && this._mainViewController.parentViewController === this){
|
|
@@ -200,32 +202,45 @@ JSClass("UISplitViewController", UIViewController, {
|
|
|
200
202
|
this._mainViewController.removeFromParentViewController();
|
|
201
203
|
}
|
|
202
204
|
this._mainViewController = mainViewController;
|
|
203
|
-
if (this.
|
|
204
|
-
if (
|
|
205
|
-
this.
|
|
205
|
+
if (this._mainViewController){
|
|
206
|
+
if (callAppearanceMethods){
|
|
207
|
+
this._mainViewController.viewWillAppear(false);
|
|
206
208
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
this.
|
|
209
|
+
this.addChildViewController(this._mainViewController);
|
|
210
|
+
}
|
|
211
|
+
if (this._view !== null){
|
|
212
|
+
var view = null;
|
|
213
|
+
if (this._mainViewController !== null){
|
|
214
|
+
view = this._mainViewController.view;
|
|
213
215
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
this._view.mainView = view;
|
|
216
|
+
this._view.mainView = view;
|
|
217
|
+
}
|
|
218
|
+
if (callAppearanceMethods){
|
|
219
|
+
if (disappearingViewController !== null){
|
|
220
|
+
disappearingViewController.enqueueDidDisappear();
|
|
220
221
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
if (this._mainViewController !== null){
|
|
223
|
+
this._mainViewController.enqueueDidAppear();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
_setMainViewControllerCollapsed: function(mainViewController){
|
|
229
|
+
if (this._mainViewController !== null){
|
|
230
|
+
if (this._leadingViewController.isKindOfClass(UINavigationController)){
|
|
231
|
+
if (this._mainViewController === this._leadingViewController.topViewController){
|
|
232
|
+
this._leadingViewController.popViewController(false);
|
|
224
233
|
}
|
|
225
|
-
|
|
226
|
-
|
|
234
|
+
}else{
|
|
235
|
+
if (this._mainViewController === this._leadingViewController.presentedViewController){
|
|
236
|
+
this._leadingViewController.dismiss(false);
|
|
227
237
|
}
|
|
228
238
|
}
|
|
239
|
+
this._leadingViewController.view.layoutIfNeeded();
|
|
240
|
+
}
|
|
241
|
+
this._mainViewController = mainViewController;
|
|
242
|
+
if (this._mainViewController !== null){
|
|
243
|
+
this._leadingViewController.show(this._mainViewController, this);
|
|
229
244
|
}
|
|
230
245
|
},
|
|
231
246
|
|
|
@@ -43,7 +43,7 @@ JSClass("UIToolbar", UIView, {
|
|
|
43
43
|
initWithSpec: function(spec){
|
|
44
44
|
UIToolbar.$super.initWithSpec.call(this, spec);
|
|
45
45
|
if (spec.containsKey("styler")){
|
|
46
|
-
this._styler = spec.valueForKey("styler",
|
|
46
|
+
this._styler = spec.valueForKey("styler", UIToolbar.Styler);
|
|
47
47
|
}else{
|
|
48
48
|
this._styler = UIToolbar.Styler.default;
|
|
49
49
|
}
|
|
@@ -1122,6 +1122,11 @@ JSClass("UIRootWindow", UIWindow, {
|
|
|
1122
1122
|
return this.application.accessibilityLabel;
|
|
1123
1123
|
},
|
|
1124
1124
|
|
|
1125
|
+
_commonWindowInit: function(){
|
|
1126
|
+
UIRootWindow.$super._commonWindowInit.call(this);
|
|
1127
|
+
this.frame = this.application.windowServer.screen.frame;
|
|
1128
|
+
},
|
|
1129
|
+
|
|
1125
1130
|
isAccessibilityElement: false,
|
|
1126
1131
|
|
|
1127
1132
|
});
|
|
@@ -1426,7 +1431,7 @@ JSClass("UIWindowTitlelessStyler", UIWindowStyler, {
|
|
|
1426
1431
|
closeButtonImages: null,
|
|
1427
1432
|
|
|
1428
1433
|
init: function(){
|
|
1429
|
-
|
|
1434
|
+
UIWindowTitlelessStyler.$super.init.call(this);
|
|
1430
1435
|
this.shadowColor = JSColor.windowShadow;
|
|
1431
1436
|
this.backgroundColor = JSColor.window;
|
|
1432
1437
|
this.closeButtonImages = {
|
|
@@ -1438,8 +1443,42 @@ JSClass("UIWindowTitlelessStyler", UIWindowStyler, {
|
|
|
1438
1443
|
this.toolbarTitleColor = JSColor.toolbarTitle;
|
|
1439
1444
|
},
|
|
1440
1445
|
|
|
1446
|
+
initWithSpec: function(spec){
|
|
1447
|
+
UIWindowTitlelessStyler.$super.initWithSpec.call(this, spec);
|
|
1448
|
+
if (spec.containsKey("backgroundColor")){
|
|
1449
|
+
this.backgroundColor = spec.valueForKey("backgroundColor", JSColor);
|
|
1450
|
+
}else{
|
|
1451
|
+
this.backgroundColor = JSColor.window;
|
|
1452
|
+
}
|
|
1453
|
+
if (spec.containsKey("shadowColor")){
|
|
1454
|
+
this.shadowColor = spec.valueForKey("shadowColor", JSColor);
|
|
1455
|
+
}else{
|
|
1456
|
+
this.shadowColor = JSColor.windowShadow;
|
|
1457
|
+
}
|
|
1458
|
+
if (spec.containsKey("shadowRadius")){
|
|
1459
|
+
this.shadowRadius = spec.valueForKey("shadowRadius");
|
|
1460
|
+
}
|
|
1461
|
+
if (spec.containsKey("inactiveShadowRadius")){
|
|
1462
|
+
this.inactiveShadowRadius = spec.valueForKey("inactiveShadowRadius");
|
|
1463
|
+
}
|
|
1464
|
+
if (spec.containsKey("cornerRadius")){
|
|
1465
|
+
this.cornerRadius = spec.valueForKey("cornerRadius");
|
|
1466
|
+
}
|
|
1467
|
+
if (spec.containsKey("toolbarTitleColor")){
|
|
1468
|
+
this.toolbarTitleColor = spec.valueForKey("toolbarTitleColor", JSColor);
|
|
1469
|
+
}else{
|
|
1470
|
+
this.toolbarTitleColor = JSColor.toolbarTitle;
|
|
1471
|
+
}
|
|
1472
|
+
this.closeButtonImages = {
|
|
1473
|
+
inactive: images.closeInactive,
|
|
1474
|
+
normal: images.closeNormal,
|
|
1475
|
+
over: images.closeOver,
|
|
1476
|
+
active: images.closeActive
|
|
1477
|
+
};
|
|
1478
|
+
},
|
|
1479
|
+
|
|
1441
1480
|
initializeWindow: function(window){
|
|
1442
|
-
|
|
1481
|
+
UIWindowTitlelessStyler.$super.initializeWindow.call(this, window);
|
|
1443
1482
|
var closeButton = UIButton.initWithStyler(UIButton.Styler.custom);
|
|
1444
1483
|
closeButton.setImageForState(this.closeButtonImages.normal, UIControl.State.normal);
|
|
1445
1484
|
closeButton.setImageForState(this.closeButtonImages.over, UIControl.State.over);
|
|
@@ -1463,7 +1502,7 @@ JSClass("UIWindowTitlelessStyler", UIWindowStyler, {
|
|
|
1463
1502
|
},
|
|
1464
1503
|
|
|
1465
1504
|
layoutWindow: function(window){
|
|
1466
|
-
|
|
1505
|
+
UIWindowTitlelessStyler.$super.layoutWindow.call(this, window);
|
|
1467
1506
|
var controlsView = window.stylerProperties.controlsView;
|
|
1468
1507
|
var closeButton = window.stylerProperties.closeButton;
|
|
1469
1508
|
var toolbar = window.stylerProperties.toolbar;
|