@breakside/jskit 2021.36.1 → 2021.40.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.
Files changed (106) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  3. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  4. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  5. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  6. package/Frameworks/Foundation.jsframework/JS/JSColor+HTML.js +11 -2
  7. package/Frameworks/Foundation.jsframework/JS/JSColor.js +62 -26
  8. package/Frameworks/Foundation.jsframework/JS/JSColorSpace.js +209 -1
  9. package/Frameworks/Foundation.jsframework/JS/JSImage.js +9 -3
  10. package/Frameworks/Foundation.jsframework/JS/JSSpec.js +1 -1
  11. package/Frameworks/Foundation.jsframework/JS/JSURL.js +42 -3
  12. package/Frameworks/Foundation.jsframework/JS/JSURLRequest.js +4 -1
  13. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  14. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  15. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  16. package/Info.json +2 -2
  17. package/Node/io.breakside.jskit-bundle.js +4 -4
  18. package/Resources/doc-default.css +86 -0
  19. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  20. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  21. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  22. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  23. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  24. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  25. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  26. package/Root/Frameworks/DOM/Info.yaml +1 -1
  27. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  28. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  29. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  30. package/Root/Frameworks/Foundation/JSColor+HTML.js +11 -2
  31. package/Root/Frameworks/Foundation/JSColor.js +62 -26
  32. package/Root/Frameworks/Foundation/JSColorSpace.js +209 -1
  33. package/Root/Frameworks/Foundation/JSImage.js +9 -3
  34. package/Root/Frameworks/Foundation/JSSpec.js +1 -1
  35. package/Root/Frameworks/Foundation/JSURL.js +42 -3
  36. package/Root/Frameworks/Foundation/JSURLRequest.js +4 -1
  37. package/Root/Frameworks/ImageKit/IKHTMLCanvasBitmapContext.js +1 -1
  38. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  39. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  40. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  41. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  42. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  43. package/Root/Frameworks/PDFKit/PDFColorSpace.js +1 -1
  44. package/Root/Frameworks/PDFKit/PDFReader.js +8 -3
  45. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  46. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  47. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  48. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  49. package/Root/Frameworks/ServerKit/SKValidatingObject.js +21 -0
  50. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  51. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  52. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  53. package/Root/Frameworks/UIKit/JSColor+UIKit.js +75 -0
  54. package/Root/Frameworks/UIKit/UIAccessibility.js +15 -0
  55. package/Root/Frameworks/UIKit/UIActivityIndicatorView.js +2 -1
  56. package/Root/Frameworks/UIKit/UIAlertController.js +4 -3
  57. package/Root/Frameworks/UIKit/UIAnimation.js +7 -13
  58. package/Root/Frameworks/UIKit/UIApplication.js +3 -0
  59. package/Root/Frameworks/UIKit/UIBasicAnimation.js +6 -0
  60. package/Root/Frameworks/UIKit/UIButton.js +49 -26
  61. package/Root/Frameworks/UIKit/UICheckbox.js +11 -22
  62. package/Root/Frameworks/UIKit/UIColorPanel.js +29 -15
  63. package/Root/Frameworks/UIKit/UIColorSpace.js +132 -0
  64. package/Root/Frameworks/UIKit/UIColorWell.js +30 -4
  65. package/Root/Frameworks/UIKit/UIControl.js +8 -4
  66. package/Root/Frameworks/UIKit/UIHTMLDisplayServer.js +1 -5
  67. package/Root/Frameworks/UIKit/UIHTMLTextField.js +3 -15
  68. package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +72 -1
  69. package/Root/Frameworks/UIKit/UIImageView.js +4 -0
  70. package/Root/Frameworks/UIKit/UIKit.js +2 -0
  71. package/Root/Frameworks/UIKit/UILabel.js +14 -2
  72. package/Root/Frameworks/UIKit/UILayer.js +29 -1
  73. package/Root/Frameworks/UIKit/UIListView.js +23 -12
  74. package/Root/Frameworks/UIKit/UIListViewCell.js +10 -2
  75. package/Root/Frameworks/UIKit/UIMenu.js +21 -13
  76. package/Root/Frameworks/UIKit/UIMenuBar.js +5 -4
  77. package/Root/Frameworks/UIKit/UIMenuView.js +9 -5
  78. package/Root/Frameworks/UIKit/UINavigationBar.js +8 -5
  79. package/Root/Frameworks/UIKit/UINavigationController.js +3 -2
  80. package/Root/Frameworks/UIKit/UIOutlineViewCell.js +2 -1
  81. package/Root/Frameworks/UIKit/UIPopupButton.js +22 -25
  82. package/Root/Frameworks/UIKit/UIPopupWindow.js +9 -2
  83. package/Root/Frameworks/UIKit/UIProgressIndicatorView.js +1 -1
  84. package/Root/Frameworks/UIKit/UIRadioGroup.js +11 -22
  85. package/Root/Frameworks/UIKit/UIScroller.js +4 -3
  86. package/Root/Frameworks/UIKit/UISegmentedControl.js +16 -15
  87. package/Root/Frameworks/UIKit/UISlider.js +29 -37
  88. package/Root/Frameworks/UIKit/UISplitView.js +16 -0
  89. package/Root/Frameworks/UIKit/UITabView.js +34 -31
  90. package/Root/Frameworks/UIKit/UITextEditor.js +2 -1
  91. package/Root/Frameworks/UIKit/UITextField.js +13 -14
  92. package/Root/Frameworks/UIKit/UITextLayer.js +5 -0
  93. package/Root/Frameworks/UIKit/UITokenField.js +3 -3
  94. package/Root/Frameworks/UIKit/UIToolbar.js +84 -38
  95. package/Root/Frameworks/UIKit/UIToolbarOverflow.svg +8 -0
  96. package/Root/Frameworks/UIKit/UITooltipWindow.js +38 -15
  97. package/Root/Frameworks/UIKit/UITraitCollection.js +21 -0
  98. package/Root/Frameworks/UIKit/UIUserInterface.js +6 -0
  99. package/Root/Frameworks/UIKit/UIWebView.js +3 -2
  100. package/Root/Frameworks/UIKit/UIWindow.js +178 -52
  101. package/Root/Frameworks/UIKit/UIWindowButtonCloseInactive.svg +1 -1
  102. package/Root/Frameworks/UIKit/UIWindowButtonCloseNormal.svg +1 -1
  103. package/Root/Frameworks/UIKit/UIWindowServer.js +72 -9
  104. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  105. package/Root/Templates/html/${PROJECT_NAME}/www/index.html +24 -4
  106. package/package.json +1 -1
@@ -17,6 +17,7 @@
17
17
  // #import "UILabel.js"
18
18
  // #import "UINavigationBarItem.js"
19
19
  // #import "UIViewPropertyAnimator.js"
20
+ // #import "JSColor+UIKit.js"
20
21
  'use strict';
21
22
 
22
23
  (function(){
@@ -317,10 +318,11 @@ JSClass("UINavigationBarDefaultStyler", UINavigationBarStyler, {
317
318
  init: function(){
318
319
  UINavigationBarDefaultStyler.$super.init.call(this);
319
320
  this.coversContent = true;
320
- this.backgroundColor = JSColor.initWithWhite(0.8);
321
+ this.backgroundColor = JSColor.background;
321
322
  this.contentSeparatorSize = 1;
322
- this.contentSeparatorColor = JSColor.initWithWhite(0.8);
323
- this.titleColor = JSColor.initWithWhite(0.2);
323
+ this.contentSeparatorColor = JSColor.initWithUIStyles(JSColor.black.colorWithAlpha(0.1), JSColor.white.colorWithAlpha(0.1));
324
+ this.titleColor = JSColor.text;
325
+ this.itemColor = JSColor.highlight;
324
326
  this.itemInsets = JSInsets.Zero;
325
327
  this._fillInDefaultStyles();
326
328
  },
@@ -336,8 +338,8 @@ JSClass("UINavigationBarDefaultStyler", UINavigationBarStyler, {
336
338
  if (spec.containsKey("contentSeparatorColor")){
337
339
  this.contentSeparatorColor = spec.valueForKey("contentSeparatorColor", JSColor);
338
340
  }
339
- if (spec.containsKey("contentSeparatorWidth")){
340
- this.contentSeparatorWidth = spec.valueForKey("contentSeparatorWidth");
341
+ if (spec.containsKey("contentSeparatorSize")){
342
+ this.contentSeparatorSize = spec.valueForKey("contentSeparatorSize");
341
343
  }
342
344
  if (spec.containsKey("titleColor")){
343
345
  this.titleColor = spec.valueForKey("titleColor", JSColor);
@@ -772,6 +774,7 @@ JSClass("UINavigationBarDefaultStyler", UINavigationBarStyler, {
772
774
  button.accessibilityLabel = barItem.accessibilityTitle;
773
775
  if (barItem.image){
774
776
  button.setImageForState(barItem.image, UIControl.State.normal);
777
+ button._imageView.automaticRenderMode = JSImage.RenderMode.template;
775
778
  }
776
779
  button.addAction(barItem.action, barItem.target);
777
780
  return button;
@@ -17,6 +17,7 @@
17
17
  // #import "UINavigationBar.js"
18
18
  // #import "UIScrollView.js"
19
19
  // #import "UIViewPropertyAnimator.js"
20
+ // #import "JSColor+UIKit.js"
20
21
  /* global UISplitViewController */
21
22
  'use strict';
22
23
 
@@ -195,7 +196,7 @@ JSClass("UINavigationController", UIViewController, {
195
196
  var navController = this;
196
197
  this.layoutChildView(viewController.view);
197
198
  viewController.view.transform = JSAffineTransform.Translated(viewController.view.bounds.size.width, 0);
198
- viewController.view.shadowColor = JSColor.initWithWhite(0, 0.4);
199
+ viewController.view.shadowColor = JSColor.windowShadow;
199
200
  viewController.view.shadowRadius = 20;
200
201
  this.pushAnimator.addAnimations(function(){
201
202
  viewController.view.transform = JSAffineTransform.Identity;
@@ -272,7 +273,7 @@ JSClass("UINavigationController", UIViewController, {
272
273
  var navController = this;
273
274
  this.layoutChildView(viewController.view);
274
275
  viewController.view.transform = JSAffineTransform.Translated(-viewController.view.bounds.size.width / 2, 0);
275
- fromViewController.view.shadowColor = JSColor.initWithWhite(0, 0.4);
276
+ fromViewController.view.shadowColor = JSColor.windowShadow;
276
277
  fromViewController.view.shadowRadius = 20;
277
278
  this.popAnimator.addAnimations(function(){
278
279
  viewController.view.transform = JSAffineTransform.Identity;
@@ -16,6 +16,7 @@
16
16
  // #import "UIListViewCell.js"
17
17
  // #import "UIButton.js"
18
18
  // #import "UIEvent.js"
19
+ // #import "JSColor+UIKit.js"
19
20
  'use strict';
20
21
 
21
22
  JSClass("UIOutlineViewCell", UIListViewCell, {
@@ -28,7 +29,7 @@ JSClass("UIOutlineViewCell", UIListViewCell, {
28
29
 
29
30
  _commonCellInit: function(){
30
31
  UIOutlineViewCell.$super._commonCellInit.call(this);
31
- var buttonStyler = UIButtonImageStyler.initWithColor(JSColor.black);
32
+ var buttonStyler = UIButtonImageStyler.initWithColor(JSColor.text);
32
33
  this._disclosureButton = UIButton.initWithStyler(buttonStyler);
33
34
  this._disclosureButton.addAction("_toggleExpanded", this);
34
35
  this._disclosureButton.accessibilityRole = UIAccessibility.Role.disclosureTriangle;
@@ -17,6 +17,7 @@
17
17
  // #import "UILabel.js"
18
18
  // #import "UIImageView.js"
19
19
  // #import "UIMenu.js"
20
+ // #import "JSColor+UIKit.js"
20
21
  'use strict';
21
22
 
22
23
  (function(){
@@ -64,6 +65,9 @@ JSClass("UIPopupButton", UIControl, {
64
65
  this.addItemWithTitle(options.valueForKey(i));
65
66
  }
66
67
  }
68
+ if (spec.containsKey("menuAdoptsTitleFont")){
69
+ this.menuAdoptsTitleFont = spec.valueForKey("menuAdoptsTitleFont");
70
+ }
67
71
  },
68
72
 
69
73
  commonUIControlInit: function(){
@@ -273,9 +277,13 @@ JSClass("UIPopupButton", UIControl, {
273
277
  // -------------------------------------------------------------------------
274
278
  // MARK: - Menu
275
279
 
280
+ menuAdoptsTitleFont: true,
281
+
276
282
  openMenu: function(){
277
283
  if (this.menu.items.length > 0){
278
- this.menu.font = this.titleLabel.font;
284
+ if (this.menuAdoptsTitleFont){
285
+ this.menu.font = this.titleLabel.font;
286
+ }
279
287
  this.menu.delegate = this;
280
288
  if (this._pullsDown){
281
289
  this.menu.minimumWidth = this.frame.size.width;
@@ -447,6 +455,7 @@ JSClass("UIPopupButtonStyler", UIControlStyler, {
447
455
  },
448
456
 
449
457
  initWithSpec: function(spec){
458
+ UIPopupButtonStyler.$super.initWithSpec.call(this, spec);
450
459
  if (spec.containsKey("menuStyler")){
451
460
  this.menuStyler = spec.valueForKey("menuStyler", UIMenu.Styler);
452
461
  }else{
@@ -480,7 +489,7 @@ JSClass("UIPopupButtonCustomStyler", UIPopupButtonStyler, {
480
489
  indicatorSpacing: 0,
481
490
 
482
491
  init: function(){
483
- this.initWithColor(JSColor.black);
492
+ this.initWithColor(JSColor.text);
484
493
  },
485
494
 
486
495
  initWithColor: function(color){
@@ -588,7 +597,7 @@ JSClass("UIPopupButtonCustomStyler", UIPopupButtonStyler, {
588
597
  }
589
598
  }
590
599
  if (this.normalTitleColor === null){
591
- this.normalTitleColor = JSColor.black;
600
+ this.normalTitleColor = JSColor.text;
592
601
  }
593
602
  if (this.activeTitleColor === null){
594
603
  this.activeTitleColor = this.normalTitleColor.colorDarkenedByPercentage(0.2);
@@ -703,31 +712,31 @@ JSClass("UIPopupButtonDefaultStyler", UIPopupButtonCustomStyler, {
703
712
 
704
713
  _fillInMissingColors: function(){
705
714
  if (this.normalBackgroundColor === null){
706
- this.normalBackgroundColor = UIPopupButtonDefaultStyler.NormalBackgroundColor;
715
+ this.normalBackgroundColor = JSColor.controlBackground;
707
716
  if (this.activeBackgroundColor === null){
708
- this.activeBackgroundColor = UIPopupButtonDefaultStyler.ActiveBackgroundColor;
717
+ this.activeBackgroundColor = JSColor.activeControlBackground;
709
718
  }
710
719
  if (this.disabledBackgroundColor === null){
711
- this.disabledBackgroundColor = UIPopupButtonDefaultStyler.DisabledBackgroundColor;
720
+ this.disabledBackgroundColor = JSColor.disabledControlBackground;
712
721
  }
713
722
  }
714
723
  if (this.normalBorderColor === null){
715
- this.normalBorderColor = UIPopupButtonDefaultStyler.NormalBorderColor;
724
+ this.normalBorderColor = JSColor.controlBorder;
716
725
  if (this.activeBorderColor === null){
717
- this.activeBorderColor = UIPopupButtonDefaultStyler.ActiveBorderColor;
726
+ this.activeBorderColor = JSColor.activeControlBorder;
718
727
  }
719
728
  if (this.disabledBorderColor === null){
720
- this.disabledBorderColor = UIPopupButtonDefaultStyler.DisabledBorderColor;
729
+ this.disabledBorderColor = JSColor.disabledControlBorder;
721
730
  }
722
731
  }
723
732
  if (this.normalTitleColor === null){
724
- this.normalTitleColor = UIPopupButtonDefaultStyler.NormalTitleColor;
733
+ this.normalTitleColor = JSColor.controlTitle;
725
734
  }
726
735
  if (this.activeTitleColor === null){
727
- this.activeTitleColor = UIPopupButtonDefaultStyler.ActiveTitleColor;
736
+ this.activeTitleColor = JSColor.activeControlTitle;
728
737
  }
729
738
  if (this.disabledTitleColor === null){
730
- this.disabledTitleColor = UIPopupButtonDefaultStyler.DisabledTitleColor;
739
+ this.disabledTitleColor = JSColor.disabledControlTitle;
731
740
  }
732
741
  }
733
742
 
@@ -744,7 +753,7 @@ JSClass("UIPopupButtonImageStyler", UIPopupButtonStyler, {
744
753
  cornerRadius: 0,
745
754
 
746
755
  init: function(){
747
- this.initWithColor(JSColor.black);
756
+ this.initWithColor(JSColor.text);
748
757
  },
749
758
 
750
759
  initWithColor: function(color){
@@ -832,18 +841,6 @@ JSClass("UIPopupButtonImageStyler", UIPopupButtonStyler, {
832
841
 
833
842
  });
834
843
 
835
- UIPopupButtonDefaultStyler.NormalBackgroundColor = JSColor.initWithRGBA(250/255,250/255,250/255);
836
- UIPopupButtonDefaultStyler.ActiveBackgroundColor = JSColor.initWithRGBA(224/255,224/255,224/255);
837
- UIPopupButtonDefaultStyler.DisabledBackgroundColor = JSColor.initWithRGBA(240/255,240/255,240/255);
838
-
839
- UIPopupButtonDefaultStyler.NormalBorderColor = JSColor.initWithRGBA(204/255,204/255,204/255);
840
- UIPopupButtonDefaultStyler.ActiveBorderColor = JSColor.initWithRGBA(192/255,192/255,192/255);
841
- UIPopupButtonDefaultStyler.DisabledBorderColor = JSColor.initWithRGBA(224/255,224/255,224/255);
842
-
843
- UIPopupButtonDefaultStyler.NormalTitleColor = JSColor.initWithRGBA(51/255,51/255,51/255);
844
- UIPopupButtonDefaultStyler.ActiveTitleColor = JSColor.initWithRGBA(51/255,51/255,51/255);
845
- UIPopupButtonDefaultStyler.DisabledTitleColor = JSColor.initWithRGBA(152/255,152/255,152/255);
846
-
847
844
  var images = Object.create({}, {
848
845
 
849
846
  bundle: {
@@ -15,6 +15,7 @@
15
15
 
16
16
  // #import "UIWindow.js"
17
17
  // #import "UIViewPropertyAnimator.js"
18
+ // #import "JSColor+UIKit.js"
18
19
  'use strict';
19
20
 
20
21
  JSClass("UIPopupWindow", UIWindow, {
@@ -277,9 +278,15 @@ JSClass("UIPopupWindow", UIWindow, {
277
278
 
278
279
  },
279
280
 
281
+ modalIndicationClosesWindow: false,
282
+
280
283
  _modalAnimator: null,
281
284
 
282
285
  indicateModalStatus: function(){
286
+ if (this.modalIndicationClosesWindow){
287
+ this.close();
288
+ return;
289
+ }
283
290
  if (this._modalAnimator !== null){
284
291
  return;
285
292
  }
@@ -321,8 +328,8 @@ JSClass("UIPopupWindowStyler", UIWindowStyler, {
321
328
 
322
329
  init: function(){
323
330
  UIPopupWindowStyler.$super.init.call(this);
324
- this.backgroundColor = JSColor.initWithRGBA(240/255,240/255,240/255,1);
325
- this.shadowColor = JSColor.initWithRGBA(0, 0, 0, 0.4);
331
+ this.backgroundColor = JSColor.window;
332
+ this.shadowColor = JSColor.windowShadow;
326
333
  this.shadowOffset = JSPoint.Zero;
327
334
  this.shadowRadius = UIWindow.Styler.default.shadowRadius;
328
335
  this.cornerRadius = UIWindow.Styler.default.cornerRadius;
@@ -51,7 +51,7 @@ JSClass("UIProgressIndicatorView", UIView, {
51
51
 
52
52
  _commonProgressInit: function(){
53
53
  if (this._progressBarColor === null){
54
- this._progressBarColor = JSColor.initWithRGBA(0, 0, 0, 0.4);
54
+ this._progressBarColor = JSColor.initWithUIStyles(JSColor.black.colorLightenedByPercentage(0.6), JSColor.white.colorDarkenedByPercentage(0.6));
55
55
  }
56
56
  if (this._progressBorderColor === null){
57
57
  this._progressBorderColor = this._progressBarColor;
@@ -17,6 +17,7 @@
17
17
  // #import "UILabel.js"
18
18
  // #import "UIImageView.js"
19
19
  // #import "UIEvent.js"
20
+ // #import "JSColor+UIKit.js"
20
21
  'use strict';
21
22
 
22
23
  (function(){
@@ -360,16 +361,16 @@ JSClass("UIRadioButtonDefaultStyler", UIRadioButtonStyler, {
360
361
  borderWidth: 1,
361
362
 
362
363
  init: function(){
363
- this.normalBackgroundColor = UIRadioButtonDefaultStyler.NormalBackgroundColor;
364
- this.disabledBackgroundColor = UIRadioButtonDefaultStyler.DisabledBackgroundColor;
365
- this.activeBackgroundColor = UIRadioButtonDefaultStyler.ActiveBackgroundColor;
366
- this.normalBorderColor = UIRadioButtonDefaultStyler.NormalBorderColor;
367
- this.disabledBorderColor = UIRadioButtonDefaultStyler.DisabledBorderColor;
368
- this.activeBorderColor = UIRadioButtonDefaultStyler.ActiveBorderColor;
369
- this.normalTitleColor = UIRadioButtonDefaultStyler.NormalTitleColor;
370
- this.disabledTitleColor = UIRadioButtonDefaultStyler.DisabledTitleColor;
371
- this.activeTitleColor = UIRadioButtonDefaultStyler.ActiveTitleColor;
372
- this.shadowColor = JSColor.initWithRGBA(0, 0, 0, 0.1);
364
+ this.normalBackgroundColor = JSColor.controlBackground;
365
+ this.disabledBackgroundColor = JSColor.disabledControlBackground;
366
+ this.activeBackgroundColor = JSColor.activeControlBackground;
367
+ this.normalBorderColor = JSColor.controlBorder;
368
+ this.disabledBorderColor = JSColor.disabledControlBorder;
369
+ this.activeBorderColor = JSColor.activeControlBorder;
370
+ this.normalTitleColor = JSColor.controlTitle;
371
+ this.disabledTitleColor = JSColor.disabledControlTitle;
372
+ this.activeTitleColor = JSColor.activeControlTitle;
373
+ this.shadowColor = JSColor.controlShadow;
373
374
  this.shadowOffset = JSPoint(0, 1);
374
375
  },
375
376
 
@@ -426,18 +427,6 @@ JSClass("UIRadioButtonDefaultStyler", UIRadioButtonStyler, {
426
427
 
427
428
  });
428
429
 
429
- UIRadioButtonDefaultStyler.NormalBackgroundColor = JSColor.initWithRGBA(250/255,250/255,250/255);
430
- UIRadioButtonDefaultStyler.ActiveBackgroundColor = JSColor.initWithRGBA(224/255,224/255,224/255);
431
- UIRadioButtonDefaultStyler.DisabledBackgroundColor = JSColor.initWithRGBA(240/255,240/255,240/255);
432
-
433
- UIRadioButtonDefaultStyler.NormalBorderColor = JSColor.initWithRGBA(204/255,204/255,204/255);
434
- UIRadioButtonDefaultStyler.ActiveBorderColor = JSColor.initWithRGBA(192/255,192/255,192/255);
435
- UIRadioButtonDefaultStyler.DisabledBorderColor = JSColor.initWithRGBA(224/255,224/255,224/255);
436
-
437
- UIRadioButtonDefaultStyler.NormalTitleColor = JSColor.initWithRGBA(51/255,51/255,51/255);
438
- UIRadioButtonDefaultStyler.ActiveTitleColor = JSColor.initWithRGBA(51/255,51/255,51/255);
439
- UIRadioButtonDefaultStyler.DisabledTitleColor = JSColor.initWithRGBA(152/255,152/255,152/255);
440
-
441
430
  var images = Object.create({}, {
442
431
 
443
432
  bundle: {
@@ -16,6 +16,7 @@
16
16
  // #import "UIControl.js"
17
17
  // #import "UIViewPropertyAnimator.js"
18
18
  // #import "UIDevice.js"
19
+ // #import "JSColor+UIKit.js"
19
20
  'use strict';
20
21
 
21
22
  JSClass("UIScroller", UIControl, {
@@ -287,9 +288,9 @@ JSClass("UIScrollerDefaultStyler", UIScrollerStyler, {
287
288
  this.knobInsets = JSInsets(2, 3, 2, 2);
288
289
  var maxKnobWidth = this.expandedSize - this.knobInsets.left - this.knobInsets.right;
289
290
  this.minimumKnobLength = maxKnobWidth * 2;
290
- this.trackColor = JSColor.initWithWhite(0, 0.1);
291
- this.trackBorderColor = JSColor.initWithWhite(0, 0.15);
292
- this.knobColor = JSColor.initWithWhite(0, 0.6);
291
+ this.trackColor = JSColor.initWithUIStyles(JSColor.initWithWhite(0, 0.1), JSColor.initWithWhite(1, 0.1));
292
+ this.trackBorderColor = JSColor.initWithUIStyles(JSColor.initWithWhite(0, 0.15), JSColor.initWithWhite(1, 0.05));
293
+ this.knobColor = JSColor.initWithUIStyles(JSColor.initWithWhite(0, 0.6), JSColor.initWithWhite(1, 0.6));
293
294
  if (UIDevice.shared && UIDevice.shared.primaryPointerType === UIUserInterface.PointerType.touch){
294
295
  this.collapsedSize = 8;
295
296
  }
@@ -17,6 +17,7 @@
17
17
  // #import "UILabel.js"
18
18
  // #import "UIImageView.js"
19
19
  // #import "UIEvent.js"
20
+ // #import "JSColor+UIKit.js"
20
21
  'use strict';
21
22
 
22
23
  JSClass("UISegmentedControl", UIControl, {
@@ -662,21 +663,21 @@ JSClass("UISegmentedControlDefaultStyler", UISegmentedControlStyler, {
662
663
  cornerRadius: 3,
663
664
 
664
665
  init: function(){
665
- this.normalBackgroundColor = JSColor.initWithRGBA(250/255,250/255,250/255);
666
- this.activeBackgroundColor = JSColor.initWithRGBA(224/255,224/255,224/255);
667
- this.disabledBackgroundColor = JSColor.initWithRGBA(240/255,240/255,240/255);
668
- this.selectedBackgroundColor = JSColor.initWithRGBA(128/255,128/255,128/255);
669
- this.selectedActiveBackgroundColor = JSColor.initWithRGBA(102/255,102/255,102/255);
670
- this.normalBorderColor = JSColor.initWithRGBA(204/255,204/255,204/255);
671
- this.activeBorderColor = JSColor.initWithRGBA(192/255,192/255,192/255);
672
- this.disabledBorderColor = JSColor.initWithRGBA(224/255,224/255,224/255);
673
- this.selectedBorderColor = this.selectedBackgroundColor;
674
- this.selectedActiveBorderColor = this.selectedActiveBackgroundColor;
675
- this.normalTitleColor = JSColor.initWithRGBA(51/255,51/255,51/255);
676
- this.activeTitleColor = JSColor.initWithRGBA(51/255,51/255,51/255);
677
- this.disabledTitleColor = JSColor.initWithRGBA(152/255,152/255,152/255);
678
- this.selectedTitleColor = JSColor.initWithRGBA(240/255,240/255,240/255);
679
- this.selectedActiveTitleColor = this.selectedTitleColor;
666
+ this.normalBackgroundColor = JSColor.controlBackground;
667
+ this.activeBackgroundColor = JSColor.activeControlBackground;
668
+ this.disabledBackgroundColor = JSColor.disabledControlBackground;
669
+ this.selectedBackgroundColor = JSColor.selectedControlBackground;
670
+ this.selectedActiveBackgroundColor = JSColor.activeSelectedControlBackground;
671
+ this.normalBorderColor = JSColor.controlBorder;
672
+ this.activeBorderColor = JSColor.activeControlBorder;
673
+ this.disabledBorderColor = JSColor.disabledControlBorder;
674
+ this.selectedBorderColor = JSColor.selectedControlBorder;
675
+ this.selectedActiveBorderColor = JSColor.activeSelectedControlBorder;
676
+ this.normalTitleColor = JSColor.controlTitle;
677
+ this.activeTitleColor = JSColor.activeControlTitle;
678
+ this.disabledTitleColor = JSColor.disabledControlTitle;
679
+ this.selectedTitleColor = JSColor.selectedControlTitle;
680
+ this.selectedActiveTitleColor = JSColor.activeSelectedControlTitle;
680
681
  this.shadowColor = JSColor.initWithRGBA(0, 0, 0, 0.1);
681
682
  this.shadowOffset = JSPoint(0, 1);
682
683
  this.titleInsets = JSInsets(3, 7);
@@ -290,7 +290,15 @@ JSClass("UISliderLayerBasedStyler", UIControlStyler, {
290
290
  return knobLayer.containsPoint(point);
291
291
  },
292
292
 
293
- intrinsicSizeOfControl: function(styler){
293
+ sizeControlToFitSize: function(slider, maxSize){
294
+ var size = JSSize(slider.bounds.size.width, this.intrinsicSizeOfControl(slider).height);
295
+ if (size.width > maxSize.width){
296
+ size.width = maxSize.width;
297
+ }
298
+ slider.bounds = JSRect(JSPoint.Zero, size);
299
+ },
300
+
301
+ intrinsicSizeOfControl: function(slider){
294
302
  return JSSize(UIView.noIntrinsicSize, Math.max(this.trackWidth, this.knobSize.height));
295
303
  }
296
304
 
@@ -330,21 +338,21 @@ JSClass("UISliderDefaultStyler", UISliderLayerBasedStyler, {
330
338
  init: function(){
331
339
  UISliderDefaultStyler.$super.init.call(this);
332
340
  this.knobSize = JSSize(16, 16);
333
- this.normalTrackColor = UISliderDefaultStyler.NormalTrackColor;
334
- this.activeTrackColor = UISliderDefaultStyler.ActiveTrackColor;
335
- this.disabledTrackColor = UISliderDefaultStyler.DisabledTrackColor;
336
- this.normalTrackBorderColor = UISliderDefaultStyler.NormalTrackBorderColor;
337
- this.activeTrackBorderColor = UISliderDefaultStyler.ActiveTrackBorderColor;
338
- this.disabledTrackBorderColor = UISliderDefaultStyler.DisabledTrackBorderColor;
341
+ this.normalTrackColor = JSColor.initWithUIStyles(JSColor.controlBackground.colorDarkenedByPercentage(0.02), JSColor.controlBackground.colorDarkenedByPercentage(0.3), JSColor.controlBackground, JSColor.controlBackground);
342
+ this.activeTrackColor = this.normalTrackColor;
343
+ this.disabledTrackColor = JSColor.disabledControlBackground;
344
+ this.normalTrackBorderColor = JSColor.controlBorder;
345
+ this.activeTrackBorderColor = JSColor.controlBorder;
346
+ this.disabledTrackBorderColor = JSColor.disabledControlBorder;
339
347
  this.trackInnerShadowColor = JSColor.black.colorWithAlpha(0.4);
340
348
  this.trackInnerShadowOffset = JSPoint(0, 1);
341
- this.normalKnobBackgroundColor = UISliderDefaultStyler.NormalKnobBackgroundColor;
342
- this.disabledKnobBackgroundColor = UISliderDefaultStyler.DisabledKnobBackgroundColor;
343
- this.activeKnobBackgroundColor = UISliderDefaultStyler.ActiveKnobBackgroundColor;
344
- this.normalKnobBorderColor = UISliderDefaultStyler.NormalKnobBorderColor;
345
- this.disabledKnobBorderColor = UISliderDefaultStyler.DisabledKnobBorderColor;
346
- this.activeKnobBorderColor = UISliderDefaultStyler.ActiveKnobBorderColor;
347
- this.knobShadowColor = JSColor.black.colorWithAlpha(0.1);
349
+ this.normalKnobBackgroundColor = JSColor.controlBackground;
350
+ this.disabledKnobBackgroundColor = JSColor.disabledControlBackground;
351
+ this.activeKnobBackgroundColor = JSColor.activeControlBackground;
352
+ this.normalKnobBorderColor = JSColor.controlBorder;
353
+ this.disabledKnobBorderColor = JSColor.disabledControlBorder;
354
+ this.activeKnobBorderColor = JSColor.activeControlBorder;
355
+ this.knobShadowColor = JSColor.controlShadow;
348
356
  this.knobShadowOffset = JSPoint(0, 1);
349
357
  },
350
358
 
@@ -534,22 +542,6 @@ JSClass("UISliderDefaultStyler", UISliderLayerBasedStyler, {
534
542
 
535
543
  });
536
544
 
537
- UISliderDefaultStyler.NormalTrackColor = JSColor.initWithRGBA(245/255,245/255,245/255);
538
- UISliderDefaultStyler.ActiveTrackColor = UISliderDefaultStyler.NormalTrackColor;
539
- UISliderDefaultStyler.DisabledTrackColor = JSColor.initWithRGBA(240/255,240/255,240/255);
540
-
541
- UISliderDefaultStyler.NormalTrackBorderColor = JSColor.initWithRGBA(204/255,204/255,204/255);
542
- UISliderDefaultStyler.ActiveTrackBorderColor = UISliderDefaultStyler.NormalTrackBorderColor;
543
- UISliderDefaultStyler.DisabledTrackBorderColor = JSColor.initWithRGBA(224/255,224/255,224/255);
544
-
545
- UISliderDefaultStyler.NormalKnobBackgroundColor = JSColor.initWithRGBA(250/255,250/255,250/255);
546
- UISliderDefaultStyler.ActiveKnobBackgroundColor = JSColor.initWithRGBA(224/255,224/255,224/255);
547
- UISliderDefaultStyler.DisabledKnobBackgroundColor = JSColor.initWithRGBA(240/255,240/255,240/255);
548
-
549
- UISliderDefaultStyler.NormalKnobBorderColor = JSColor.initWithRGBA(204/255,204/255,204/255);
550
- UISliderDefaultStyler.ActiveKnobBorderColor = JSColor.initWithRGBA(192/255,192/255,192/255);
551
- UISliderDefaultStyler.DisabledKnobBorderColor = JSColor.initWithRGBA(224/255,224/255,224/255);
552
-
553
545
  JSClass("UISliderColorStyler", UISliderLayerBasedStyler, {
554
546
 
555
547
  gradient: null,
@@ -595,13 +587,13 @@ JSClass("UISliderColorStyler", UISliderLayerBasedStyler, {
595
587
  this.knobSize = JSSize(this.trackWidth + 6, this.trackWidth + 6);
596
588
  }
597
589
  this.trackRadius = this.trackWidth / 2;
598
- this.normalKnobBackgroundColor = JSColor.white;
599
- this.activeKnobBackgroundColor = JSColor.white;
600
- this.disabledKnobBackgroundColor = this.normalKnobBackgroundColor.colorWithAlpha(0.5);
601
- this.normalKnobBorderColor = JSColor.black.colorWithAlpha(0.2);
602
- this.activeKnobBorderColor = JSColor.black.colorWithAlpha(0.3);
603
- this.disabledKnobBorderColor = JSColor.black.colorWithAlpha(0.1);
604
- this.checkerColor = JSColor.initWithWhite(0.9);
590
+ this.normalKnobBackgroundColor = JSColor.controlBackground;
591
+ this.activeKnobBackgroundColor = JSColor.activeControlBackground;
592
+ this.disabledKnobBackgroundColor = JSColor.disabledControlBackground;
593
+ this.normalKnobBorderColor = JSColor.controlBorder;
594
+ this.activeKnobBorderColor = JSColor.activeControlBorder;
595
+ this.disabledKnobBorderColor = JSColor.disabledControlBorder;
596
+ this.checkerColor = JSColor.initWithUIStyles(JSColor.initWithWhite(0.9), JSColor.initWithWhite(0.1));
605
597
  },
606
598
 
607
599
  setColors: function(colors){
@@ -497,10 +497,18 @@ JSClass("UISplitView", UIView, {
497
497
  if (this._leadingCollapses && leadingSize < this._minimumLeadingSize / 2){
498
498
  if (this._leadingViewOpen){
499
499
  this.leadingViewOpen = false;
500
+ this.leadingSize = this._previousLeadingSize;
501
+ if (this.delegate && this.delegate.splitViewDidToggleView){
502
+ this.delegate.splitViewDidToggleView(this, this._leadingView);
503
+ }
500
504
  }
501
505
  }else{
502
506
  if (!this._leadingViewOpen){
503
507
  this.leadingViewOpen = true;
508
+ this.leadingSize = this._minimumLeadingSize;
509
+ if (this.delegate && this.delegate.splitViewDidToggleView){
510
+ this.delegate.splitViewDidToggleView(this, this._leadingView);
511
+ }
504
512
  }
505
513
  if (leadingSize >= this._minimumLeadingSize && leadingSize <= maximumLeadingSize){
506
514
  this._leadingSize = leadingSize;
@@ -519,10 +527,18 @@ JSClass("UISplitView", UIView, {
519
527
  if (this._trailingCollapses && trailingSize < this._minimumTrailingSize / 2){
520
528
  if (this._trailingViewOpen){
521
529
  this.trailingViewOpen = false;
530
+ this.trailingSize = this._previousTrailingSize;
531
+ if (this.delegate && this.delegate.splitViewDidToggleView){
532
+ this.delegate.splitViewDidToggleView(this, this._trailingView);
533
+ }
522
534
  }
523
535
  }else{
524
536
  if (!this._trailingViewOpen){
525
537
  this.trailingViewOpen = true;
538
+ this.trailingSize = this._minimumTrailingSize;
539
+ if (this.delegate && this.delegate.splitViewDidToggleView){
540
+ this.delegate.splitViewDidToggleView(this, this._trailingView);
541
+ }
526
542
  }
527
543
  if (trailingSize >= this._minimumTrailingSize && trailingSize <= maximumTrailingSize){
528
544
  this._trailingSize = trailingSize;