motion-kit 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/motion-kit-cocoa/helpers/calayer_helpers.rb +1 -1
- data/lib/motion-kit-osx/helpers/nsmenu_helpers.rb +1 -1
- data/lib/motion-kit-osx/helpers/nsview_helpers.rb +10 -2
- data/lib/motion-kit-osx/helpers/nswindow_helpers.rb +10 -2
- data/lib/motion-kit-tvos/helpers/uiview_helpers.rb +10 -2
- data/lib/motion-kit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83fe321ba3c1652135459011ec16be84e16630ab
|
4
|
+
data.tar.gz: b36491239ecac26f6d59c198d0c5ec903075a084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d059ec845e5cacdf766d99223ebdd58ecd8ea591cc2ae2090de0dbcb2238b2f5cb1a5b0f7fa04d8c5fe9f74e542e55df97207d1d5eea23bf2c7a3980d97d72c
|
7
|
+
data.tar.gz: c8f31b25c8d1fc9224c8c4afe56b5f0a05a78fe7d3933fcae5ef8f2d93958681dc6295c5f2c9c2a45301c8ec62c44d412572fbcb039c022bc99be2589bbe2461
|
data/README.md
CHANGED
@@ -220,7 +220,7 @@ def add_button style, button_title
|
|
220
220
|
end
|
221
221
|
```
|
222
222
|
|
223
|
-
During layout, z-order is determined by the sequence in which views are added to the hierarchy. You can control this dynamically by supplying :behind, :in_front_of, or :z_index options
|
223
|
+
During layout, z-order is determined by the sequence in which views are added to the hierarchy. You can control this dynamically by supplying :behind, :in_front_of, or :z_index options (:z_index not supported in OS X)
|
224
224
|
```ruby
|
225
225
|
add UIImageView, :highlight_square, behind: get(:dynamic_button)
|
226
226
|
add UIImageView, :x_marks_the_spot, in_front_of: @selected_label
|
@@ -11,8 +11,16 @@ module MotionKit
|
|
11
11
|
view_class.alloc.initWithFrame([[0, 0], [0, 0]])
|
12
12
|
end
|
13
13
|
|
14
|
-
def add_child(subview)
|
15
|
-
|
14
|
+
def add_child(subview, options={})
|
15
|
+
if (sibling = options[:behind])
|
16
|
+
target.addSubview(subview, positioned: NSWindowBelow, relativeTo: sibling)
|
17
|
+
elsif (sibling = options[:in_front_of])
|
18
|
+
target.addSubview(subview, positioned: NSWindowAbove, relativeTo: sibling)
|
19
|
+
elsif (z_index = options[:z_index])
|
20
|
+
NSLog('Warning! :z_index option not supported in OS X when adding a child view')
|
21
|
+
else
|
22
|
+
target.addSubview(subview)
|
23
|
+
end
|
16
24
|
end
|
17
25
|
|
18
26
|
def remove_child(subview)
|
@@ -19,8 +19,16 @@ module MotionKit
|
|
19
19
|
defer: false)
|
20
20
|
end
|
21
21
|
|
22
|
-
def add_child(subview)
|
23
|
-
|
22
|
+
def add_child(subview, options={})
|
23
|
+
if (sibling = options[:behind])
|
24
|
+
target.contentView.addSubview(subview, positioned: NSWindowBelow, relativeTo: sibling)
|
25
|
+
elsif (sibling = options[:in_front_of])
|
26
|
+
target.contentView.addSubview(subview, positioned: NSWindowAbove, relativeTo: sibling)
|
27
|
+
elsif (z_index = options[:z_index])
|
28
|
+
NSLog('Warning! :z_index option not supported in OS X when adding a child view')
|
29
|
+
else
|
30
|
+
target.contentView.addSubview(subview)
|
31
|
+
end
|
24
32
|
end
|
25
33
|
|
26
34
|
def remove_child(subview)
|
@@ -11,8 +11,16 @@ module MotionKit
|
|
11
11
|
view_class.alloc.initWithFrame(UIScreen.mainScreen.applicationFrame)
|
12
12
|
end
|
13
13
|
|
14
|
-
def add_child(subview)
|
15
|
-
|
14
|
+
def add_child(subview, options={})
|
15
|
+
if (sibling = options[:behind])
|
16
|
+
target.insertSubview(subview, belowSubview: sibling)
|
17
|
+
elsif (sibling = options[:in_front_of])
|
18
|
+
target.insertSubview(subview, aboveSubview: sibling)
|
19
|
+
elsif (z_index = options[:z_index])
|
20
|
+
target.insertSubview(subview, atIndex: z_index)
|
21
|
+
else
|
22
|
+
target.addSubview(subview)
|
23
|
+
end
|
16
24
|
end
|
17
25
|
|
18
26
|
def remove_child(subview)
|
data/lib/motion-kit/version.rb
CHANGED