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 +4 -4
- data/lib/ios/sugarcube-constants/symbol.rb +30 -0
- data/lib/ios/sugarcube-modal/modal.rb +17 -0
- data/lib/osx/sugarcube-color/nscolor.rb +14 -2
- data/lib/version.rb +1 -1
- data/spec/osx/color_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbf069e18731e7ae27cf805c765176069145cea
|
4
|
+
data.tar.gz: 9f7d20f7ec6eaf89bebcdb3636ed9e5b8d65dc79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
data/lib/version.rb
CHANGED
data/spec/osx/color_spec.rb
CHANGED
@@ -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.
|
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-
|
14
|
+
date: 2014-11-01 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: |
|
17
17
|
== Description
|