sugarcube 2.9.1 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a0e6febb6aacdab99ba33a9b6c0cd0b454b12da
4
- data.tar.gz: 0c9dbcb46e81cb7ba3f85e695c0940b7bd19cc9b
3
+ metadata.gz: edbf069e18731e7ae27cf805c765176069145cea
4
+ data.tar.gz: 9f7d20f7ec6eaf89bebcdb3636ed9e5b8d65dc79
5
5
  SHA512:
6
- metadata.gz: a7f0cee0a51409f9e4c48fe257bb89577e5e2ee651862b7fe1e218a69fed9183524fd1191180988cf9d5ff99bf9936b82d26103aafbb3ce62344c1b66e77762e
7
- data.tar.gz: fabd1cf378ee275c5358e4ee23e4a09e1e6c3ca749deafa9e46953e29e6f0d0fe539f2e38e5bea754879e1ad311e58c41473d85fdcfa1bae0e772da8eaff8000
6
+ metadata.gz: 9de9e1809c679e49a68561eeecdc488bf9384d2e2798e663bbe24314d779cc5b91301a82eeffda4704b5677eaf3a4261fe05d81762acd4600c7b05a11d2089b3
7
+ data.tar.gz: d9aca20f973bfcd4d13d58cfeac4b65b5fa0c7fbc1503e2ef1246e198b73c67c32432090031f911e7b7fd8675a22abf649e19350bf2eae16b2a8dab7bbca6271
@@ -183,6 +183,14 @@ class Symbol
183
183
  SugarCube.look_in(self, Symbol.uitablecellseparatorstyle, Symbol.uitablecellseparatorstyle__deprecated)
184
184
  end
185
185
 
186
+ def presentationstyle
187
+ SugarCube.look_in(self, Symbol.presentationstyle)
188
+ end
189
+
190
+ def transitionstyle
191
+ SugarCube.look_in(self, Symbol.transitionstyle)
192
+ end
193
+
186
194
  def uialertstyle
187
195
  SugarCube.look_in(self, Symbol.uialertstyle)
188
196
  end
@@ -294,6 +302,9 @@ class Symbol
294
302
  attr :uitablecellseparatorstyle
295
303
  attr :uitablecellseparatorstyle__deprecated
296
304
 
305
+ attr :presentationstyle
306
+ attr :transitionstyle
307
+
297
308
  attr :uialertstyle
298
309
  attr :uiactionstyle
299
310
 
@@ -767,6 +778,25 @@ class Symbol
767
778
  etched: UITableViewCellSeparatorStyleSingleLineEtched,
768
779
  }
769
780
 
781
+ @presentationstyle = {
782
+ fullscreen: UIModalPresentationFullScreen,
783
+ page_sheet: UIModalPresentationPageSheet,
784
+ form_sheet: UIModalPresentationFormSheet,
785
+ current_context: UIModalPresentationCurrentContext,
786
+ custom: UIModalPresentationCustom,
787
+ over_fullscreen: UIModalPresentationOverFullScreen,
788
+ over_current_context: UIModalPresentationOverCurrentContext,
789
+ popover: UIModalPresentationPopover,
790
+ none: UIModalPresentationNone
791
+ }
792
+
793
+ @transitionstyle = {
794
+ cover_vertical: UIModalTransitionStyleCoverVertical,
795
+ flip_horizontal: UIModalTransitionStyleFlipHorizontal,
796
+ cross_dissolve: UIModalTransitionStyleCrossDissolve,
797
+ partial_curl: UIModalTransitionStylePartialCurl
798
+ }
799
+
770
800
  @uialertstyle = {
771
801
  default: UIAlertViewStyleDefault,
772
802
  secure_text_input: UIAlertViewStyleSecureTextInput,
@@ -4,6 +4,23 @@ module SugarCube
4
4
  def present_modal(view_ctlr, options={}, &block)
5
5
  target = options[:target] || UIApplication.sharedApplication.keyWindow.rootViewController
6
6
  animated = options.fetch(:animated, true)
7
+
8
+ presentation_style = options[:presentation]
9
+ if presentation_style
10
+ if presentation_style.respond_to?(:presentationstyle)
11
+ presentation_style = presentation_style.presentationstyle
12
+ end
13
+ view_ctlr.modalPresentationStyle = presentation_style
14
+ end
15
+
16
+ transition_style = options[:transition]
17
+ if transition_style
18
+ if transition_style.respond_to?(:transitionstyle)
19
+ transition_style = transition_style.transitionstyle
20
+ end
21
+ view_ctlr.modalTransitionStyle = transition_style
22
+ end
23
+
7
24
  target.presentViewController(view_ctlr, animated:animated, completion:block)
8
25
  end
9
26
 
@@ -14,12 +14,24 @@ class NSColor
14
14
 
15
15
  def nscolor(alpha=nil)
16
16
  if alpha
17
- self.colorWithAlphaComponent(alpha.to_f)
17
+ if named_color_space?
18
+ self.colorUsingColorSpace(NSColorSpace.genericRGBColorSpace).colorWithAlphaComponent(alpha.to_f)
19
+ else
20
+ self.colorWithAlphaComponent(alpha.to_f)
21
+ end
18
22
  else
19
- self
23
+ if named_color_space?
24
+ self.colorUsingColorSpace(NSColorSpace.genericRGBColorSpace)
25
+ else
26
+ self
27
+ end
20
28
  end
21
29
  end
22
30
 
31
+ def named_color_space?
32
+ colorSpaceName == "NSNamedColorSpace"
33
+ end
34
+
23
35
  def cgcolor(alpha=nil)
24
36
  nscolor(alpha).CGColor
25
37
  end
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '2.9.1'
2
+ Version = '2.10.0'
3
3
  end
@@ -95,6 +95,10 @@ describe 'NSColor' do
95
95
  :black.nscolor.invert.blue.should == 1
96
96
  end
97
97
 
98
+ it "should process system colors with a NSNamedColorSpace correctly" do
99
+ NSColor.controlTextColor.invert.should.not.raise(StandardError)
100
+ end
101
+
98
102
  it "should have a #mix_with method" do
99
103
  white = :white.nscolor
100
104
  black = :black.nscolor
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugarcube
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.1
4
+ version: 2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin T.A. Gray
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-10-29 00:00:00.000000000 Z
14
+ date: 2014-11-01 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: |
17
17
  == Description