motion-kit 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -8
- data/lib/{motion-kit → motion-kit-cocoa}/calculator/view_calculator.rb +0 -0
- data/lib/motion-kit-cocoa/constraints/constraint.rb +3 -1
- data/lib/motion-kit-cocoa/{layouts → helpers}/accessibility_compat.rb +0 -0
- data/lib/motion-kit-cocoa/{layouts → helpers}/cagradientlayer_helpers.rb +0 -0
- data/lib/motion-kit-cocoa/{layouts → helpers}/calayer_helpers.rb +0 -0
- data/lib/motion-kit-cocoa/{layouts → helpers}/sugarcube_compat.rb +0 -0
- data/lib/motion-kit-ios/{layouts → helpers}/constraints_helpers.rb +0 -0
- data/lib/motion-kit-ios/{layouts → helpers}/layout_device.rb +0 -0
- data/lib/motion-kit-ios/{layouts → helpers}/layout_orientation.rb +0 -0
- data/lib/motion-kit-ios/{layouts → helpers}/uibutton_helpers.rb +0 -0
- data/lib/motion-kit-ios/{layouts/uiview_layout_autoresizing.rb → helpers/uiview_autoresizing_helpers.rb} +0 -0
- data/lib/motion-kit-ios/{layouts/uiview_layout_constraints.rb → helpers/uiview_constraints_helpers.rb} +0 -0
- data/lib/motion-kit-ios/{layouts/uiview_layout_frame.rb → helpers/uiview_frame_helpers.rb} +0 -0
- data/lib/motion-kit-ios/{layouts/uiview_layout_gradient.rb → helpers/uiview_gradient_helpers.rb} +0 -0
- data/lib/motion-kit-ios/{layouts → helpers}/uiview_helpers.rb +0 -0
- data/lib/motion-kit-osx/{layouts → helpers}/constraints_helpers.rb +0 -0
- data/lib/motion-kit-osx/{layouts → helpers}/nsmenu_extensions.rb +0 -0
- data/lib/motion-kit-osx/{layouts → helpers}/nsmenu_helpers.rb +0 -0
- data/lib/motion-kit-osx/{layouts → helpers}/nsmenuitem_extensions.rb +0 -0
- data/lib/motion-kit-osx/{layouts → helpers}/nstablecolumn_helpers.rb +0 -0
- data/lib/motion-kit-osx/{layouts → helpers}/nstableview_helpers.rb +0 -0
- data/lib/motion-kit-osx/{layouts/nsview_layout_autoresizing.rb → helpers/nsview_autoresizing_helpers.rb} +0 -0
- data/lib/motion-kit-osx/{layouts/nsview_layout_constraints.rb → helpers/nsview_constraints_helpers.rb} +0 -0
- data/lib/motion-kit-osx/{layouts/nsview_layout_frame.rb → helpers/nsview_frame_helpers.rb} +0 -0
- data/lib/motion-kit-osx/{layouts → helpers}/nsview_helpers.rb +0 -0
- data/lib/motion-kit-osx/helpers/nswindow_frame_helpers.rb +361 -0
- data/lib/motion-kit-osx/{layouts → helpers}/nswindow_helpers.rb +0 -0
- data/lib/motion-kit/{layouts → helpers}/base_layout.rb +0 -0
- data/lib/motion-kit/{layouts → helpers}/base_layout_class_methods.rb +0 -0
- data/lib/motion-kit/{layouts → helpers}/parent.rb +0 -0
- data/lib/motion-kit/{layouts → helpers}/tree_layout.rb +21 -4
- data/lib/motion-kit/object.rb +11 -0
- data/lib/motion-kit/version.rb +1 -1
- data/spec/ios/layout_spec.rb +6 -6
- data/spec/ios/motion_kit_id_spec.rb +15 -0
- data/spec/ios/remove_layout_spec.rb +9 -5
- data/spec/osx/{frame_helper_spec.rb → nsview_frame_helper_spec.rb} +69 -69
- data/spec/osx/nswindow_frame_helper_spec.rb +1288 -0
- metadata +38 -34
- data/lib/motion-kit-osx/layouts/nswindow_frame.rb +0 -14
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -182,6 +182,7 @@ module MotionKit
|
|
182
182
|
end
|
183
183
|
|
184
184
|
def name_element(element, element_id)
|
185
|
+
element.motion_kit_id = element_id
|
185
186
|
@elements[element_id] ||= []
|
186
187
|
@elements[element_id] << element
|
187
188
|
end
|
@@ -213,7 +214,7 @@ module MotionKit
|
|
213
214
|
|
214
215
|
# Retrieves a view by its element id. This will return the *first* view
|
215
216
|
# with this element_id in the tree, where *first* means the first object
|
216
|
-
# that was added with
|
217
|
+
# that was added with that name.
|
217
218
|
def get(element_id)
|
218
219
|
unless is_parent_layout?
|
219
220
|
return parent_layout.get(element_id)
|
@@ -234,7 +235,7 @@ module MotionKit
|
|
234
235
|
|
235
236
|
# Retrieves a view by its element id. This will return the *last* view with
|
236
237
|
# this element_id in the tree, where *last* means the last object that was
|
237
|
-
# added with
|
238
|
+
# added with that name.
|
238
239
|
def last(element_id)
|
239
240
|
unless is_parent_layout?
|
240
241
|
return parent_layout.last(element_id)
|
@@ -270,7 +271,8 @@ module MotionKit
|
|
270
271
|
element
|
271
272
|
end
|
272
273
|
|
273
|
-
# Returns
|
274
|
+
# Returns the ‘N’th element with a given element_id, where "‘N’th" is passed
|
275
|
+
# in as `index`
|
274
276
|
def nth(element_id, index)
|
275
277
|
self.all(element_id)[index]
|
276
278
|
end
|
@@ -291,12 +293,27 @@ module MotionKit
|
|
291
293
|
unless is_parent_layout?
|
292
294
|
return parent_layout.remove(element_id)
|
293
295
|
end
|
296
|
+
removed = forget(element_id)
|
294
297
|
context(self.view) do
|
295
|
-
|
298
|
+
removed.each do |element|
|
296
299
|
self.apply(:remove_child, element)
|
297
300
|
end
|
301
|
+
end
|
302
|
+
removed
|
303
|
+
end
|
304
|
+
|
305
|
+
# Removes a view from the list of elements this layout is "tracking", but
|
306
|
+
# leaves it in the view hierarchy. Returns the views that were removed.
|
307
|
+
def forget(element_id)
|
308
|
+
unless is_parent_layout?
|
309
|
+
return parent_layout.remove(element_id)
|
310
|
+
end
|
311
|
+
removed = nil
|
312
|
+
context(self.view) do
|
313
|
+
removed = all(element_id)
|
298
314
|
@elements[element_id] = nil
|
299
315
|
end
|
316
|
+
removed
|
300
317
|
end
|
301
318
|
|
302
319
|
def create_default_root_context
|
data/lib/motion-kit/object.rb
CHANGED
@@ -4,4 +4,15 @@ class Object
|
|
4
4
|
@motion_kit_meta ||= {}
|
5
5
|
end
|
6
6
|
|
7
|
+
def motion_kit_id=(id)
|
8
|
+
motion_kit_meta[:motion_kit_ids] ||= []
|
9
|
+
motion_kit_meta[:motion_kit_ids] << id
|
10
|
+
end
|
11
|
+
|
12
|
+
def motion_kit_id
|
13
|
+
if motion_kit_meta[:motion_kit_ids]
|
14
|
+
motion_kit_meta[:motion_kit_ids][-1]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
7
18
|
end
|
data/lib/motion-kit/version.rb
CHANGED
data/spec/ios/layout_spec.rb
CHANGED
@@ -35,17 +35,17 @@ describe 'Simple Layout' do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it "should allow getting the subviews by first, last and nth child" do
|
38
|
-
@subject.first(:repeated_label_3).should.
|
39
|
-
@subject.nth(:repeated_label_3,
|
40
|
-
@subject.last(:repeated_label_3).should.
|
38
|
+
@subject.first(:repeated_label_3).should == @subject.first_view
|
39
|
+
@subject.nth(:repeated_label_3, 3).should == @subject.nth_view
|
40
|
+
@subject.last(:repeated_label_3).should == @subject.last_view
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should allow getting all the subviews by name" do
|
44
44
|
views = @subject.all(:repeated_label_3)
|
45
|
-
views.length.should
|
45
|
+
views.length.should > 1
|
46
46
|
views[0].should.be.kind_of UIView
|
47
|
-
views[
|
48
|
-
views[
|
47
|
+
views[3].should.be.kind_of UIButton
|
48
|
+
views[-1].should.be.kind_of UILabel
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should support missing methods" do
|
@@ -0,0 +1,15 @@
|
|
1
|
+
describe "MotionKit id" do
|
2
|
+
|
3
|
+
before do
|
4
|
+
@layout = TestIdsLayout.new.build
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'should have a label' do
|
8
|
+
@layout.get(:label).should.be.kind_of UILabel
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should have a label with id :label' do
|
12
|
+
@layout.get(:label).motion_kit_id.should == :label
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -9,16 +9,20 @@ describe 'Remove views' do
|
|
9
9
|
@subject.get(:label).should.be.nil
|
10
10
|
end
|
11
11
|
|
12
|
-
it 'should
|
13
|
-
@subject.get(:image)
|
14
|
-
|
12
|
+
it 'should forget the #image view' do
|
13
|
+
image = @subject.get(:image)
|
14
|
+
image.should.be.kind_of(UIImageView)
|
15
|
+
@subject.forget_image
|
15
16
|
@subject.get(:image).should.be.nil
|
17
|
+
image.superview.should.not.be.nil
|
16
18
|
end
|
17
19
|
|
18
|
-
it 'should remove the #view
|
19
|
-
@subject.get(:view)
|
20
|
+
it 'should remove the #view from the hierarchy' do
|
21
|
+
view = @subject.get(:view)
|
22
|
+
view.should.be.kind_of(UIView)
|
20
23
|
@subject.remove_view
|
21
24
|
@subject.get(:view).should.be.nil
|
25
|
+
view.superview.should.be.nil
|
22
26
|
end
|
23
27
|
|
24
28
|
end
|
@@ -349,14 +349,14 @@ describe 'Frame helpers' do
|
|
349
349
|
@view.frame = [[0, 0], [2, 2]]
|
350
350
|
@layout.context(@view) do
|
351
351
|
retval = @layout.center [1, 2]
|
352
|
-
retval.x.should == @view.frame
|
353
|
-
retval.y.should == @view.frame
|
352
|
+
retval.x.should == CGRectGetMidX(@view.frame)
|
353
|
+
retval.y.should == CGRectGetMidY(@view.frame)
|
354
354
|
@view.frame.origin.x.should == 0
|
355
355
|
@view.frame.origin.y.should == 1
|
356
356
|
|
357
357
|
retval = @layout.center ['100% - 1', '100% - 2']
|
358
|
-
retval.x.should == @view.frame
|
359
|
-
retval.y.should == @view.frame
|
358
|
+
retval.x.should == CGRectGetMidX(@view.frame)
|
359
|
+
retval.y.should == CGRectGetMidY(@view.frame)
|
360
360
|
@view.frame.origin.x.should == @superview_size.width - 2
|
361
361
|
@view.frame.origin.y.should == @superview_size.height - 3
|
362
362
|
end
|
@@ -366,14 +366,14 @@ describe 'Frame helpers' do
|
|
366
366
|
@view.frame = [[0, 0], [2, 2]]
|
367
367
|
@layout.context(@view) do
|
368
368
|
retval = @layout.center x: 1, y: 2
|
369
|
-
retval.x.should == @view.frame
|
370
|
-
retval.y.should == @view.frame
|
369
|
+
retval.x.should == CGRectGetMidX(@view.frame)
|
370
|
+
retval.y.should == CGRectGetMidY(@view.frame)
|
371
371
|
@view.frame.origin.x.should == 0
|
372
372
|
@view.frame.origin.y.should == 1
|
373
373
|
|
374
374
|
retval = @layout.center x: '100% - 1', y: '100% - 2'
|
375
|
-
retval.x.should == @view.frame
|
376
|
-
retval.y.should == @view.frame
|
375
|
+
retval.x.should == CGRectGetMidX(@view.frame)
|
376
|
+
retval.y.should == CGRectGetMidY(@view.frame)
|
377
377
|
@view.frame.origin.x.should == @superview_size.width - 2
|
378
378
|
@view.frame.origin.y.should == @superview_size.height - 3
|
379
379
|
end
|
@@ -383,14 +383,14 @@ describe 'Frame helpers' do
|
|
383
383
|
@view.frame = [[0, 0], [2, 2]]
|
384
384
|
@layout.context(@view) do
|
385
385
|
retval = @layout.center x: 1, y: 1, right: 1, up: 2, relative: true
|
386
|
-
retval.x.should == @view.frame
|
387
|
-
retval.y.should == @view.frame
|
386
|
+
retval.x.should == CGRectGetMidX(@view.frame)
|
387
|
+
retval.y.should == CGRectGetMidY(@view.frame)
|
388
388
|
@view.frame.origin.x.should == 1
|
389
389
|
@view.frame.origin.y.should == 2
|
390
390
|
|
391
391
|
retval = @layout.center x: '100%', y: '100%', left: 1, down: 2, relative: true
|
392
|
-
retval.x.should == @view.frame
|
393
|
-
retval.y.should == @view.frame
|
392
|
+
retval.x.should == CGRectGetMidX(@view.frame)
|
393
|
+
retval.y.should == CGRectGetMidY(@view.frame)
|
394
394
|
@view.frame.origin.x.should == @superview_size.width - 2
|
395
395
|
@view.frame.origin.y.should == @superview_size.height - 3
|
396
396
|
end
|
@@ -1447,8 +1447,8 @@ describe 'Frame helpers' do
|
|
1447
1447
|
retval = @layout.frame @layout.above(@another_view)
|
1448
1448
|
retval.should == @view.frame
|
1449
1449
|
end
|
1450
|
-
@view.frame.origin.x.should ==
|
1451
|
-
@view.frame.origin.y.should ==
|
1450
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1451
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + @another_view.frame.size.height
|
1452
1452
|
@view.frame.size.width.should == @view_size.width
|
1453
1453
|
@view.frame.size.height.should == @view_size.height
|
1454
1454
|
end
|
@@ -1458,7 +1458,7 @@ describe 'Frame helpers' do
|
|
1458
1458
|
retval = @layout.frame @layout.above(@another_view)
|
1459
1459
|
retval.should == @flipped_view.frame
|
1460
1460
|
end
|
1461
|
-
@flipped_view.frame.origin.x.should ==
|
1461
|
+
@flipped_view.frame.origin.x.should == @another_view.frame.origin.x
|
1462
1462
|
@flipped_view.frame.origin.y.should == -78
|
1463
1463
|
@flipped_view.frame.size.width.should == @view_size.width
|
1464
1464
|
@flipped_view.frame.size.height.should == @view_size.height
|
@@ -1474,8 +1474,8 @@ describe 'Frame helpers' do
|
|
1474
1474
|
retval = @layout.frame @layout.above(@another_view)
|
1475
1475
|
retval.should == @view.frame
|
1476
1476
|
end
|
1477
|
-
@view.frame.origin.x.should ==
|
1478
|
-
@view.frame.origin.y.should ==
|
1477
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1478
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + @another_view.frame.size.height
|
1479
1479
|
@view.frame.size.width.should == @view_size.width
|
1480
1480
|
@view.frame.size.height.should == @view_size.height
|
1481
1481
|
end
|
@@ -1485,8 +1485,8 @@ describe 'Frame helpers' do
|
|
1485
1485
|
retval = @layout.frame @layout.above(@another_view, down: 8)
|
1486
1486
|
retval.should == @view.frame
|
1487
1487
|
end
|
1488
|
-
@view.frame.origin.x.should ==
|
1489
|
-
@view.frame.origin.y.should ==
|
1488
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1489
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + @another_view.frame.size.height - 8
|
1490
1490
|
@view.frame.size.width.should == @view_size.width
|
1491
1491
|
@view.frame.size.height.should == @view_size.height
|
1492
1492
|
end
|
@@ -1496,8 +1496,8 @@ describe 'Frame helpers' do
|
|
1496
1496
|
retval = @layout.frame @layout.above(@another_view, width: 10, height: 20)
|
1497
1497
|
retval.should == @view.frame
|
1498
1498
|
end
|
1499
|
-
@view.frame.origin.x.should ==
|
1500
|
-
@view.frame.origin.y.should ==
|
1499
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1500
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + @another_view.frame.size.height
|
1501
1501
|
@view.frame.size.width.should == 10
|
1502
1502
|
@view.frame.size.height.should == 20
|
1503
1503
|
end
|
@@ -1507,8 +1507,8 @@ describe 'Frame helpers' do
|
|
1507
1507
|
retval = @layout.frame @layout.above(@another_view, x: 10, y: 20, width: 22, height: 12)
|
1508
1508
|
retval.should == @view.frame
|
1509
1509
|
end
|
1510
|
-
@view.frame.origin.x.should ==
|
1511
|
-
@view.frame.origin.y.should ==
|
1510
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + 10
|
1511
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + @another_view.frame.size.height + 20
|
1512
1512
|
@view.frame.size.width.should == 22
|
1513
1513
|
@view.frame.size.height.should == 12
|
1514
1514
|
end
|
@@ -1518,8 +1518,8 @@ describe 'Frame helpers' do
|
|
1518
1518
|
retval = @layout.frame @layout.above(@another_view, right: 10, up: 20, width: 22, height: 12)
|
1519
1519
|
retval.should == @view.frame
|
1520
1520
|
end
|
1521
|
-
@view.frame.origin.x.should ==
|
1522
|
-
@view.frame.origin.y.should ==
|
1521
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + 10
|
1522
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + @another_view.frame.size.height + 20
|
1523
1523
|
@view.frame.size.width.should == 22
|
1524
1524
|
@view.frame.size.height.should == 12
|
1525
1525
|
end
|
@@ -1529,8 +1529,8 @@ describe 'Frame helpers' do
|
|
1529
1529
|
retval = @layout.frame @layout.above(@another_view, left: 10, down: 20, width: 22, height: 12)
|
1530
1530
|
retval.should == @view.frame
|
1531
1531
|
end
|
1532
|
-
@view.frame.origin.x.should ==
|
1533
|
-
@view.frame.origin.y.should ==
|
1532
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x - 10
|
1533
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + @another_view.frame.size.height - 20
|
1534
1534
|
@view.frame.size.width.should == 22
|
1535
1535
|
@view.frame.size.height.should == 12
|
1536
1536
|
end
|
@@ -1562,8 +1562,8 @@ describe 'Frame helpers' do
|
|
1562
1562
|
retval = @layout.frame @layout.below(@another_view)
|
1563
1563
|
retval.should == @view.frame
|
1564
1564
|
end
|
1565
|
-
@view.frame.origin.x.should ==
|
1566
|
-
@view.frame.origin.y.should ==
|
1565
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1566
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y - @view.frame.size.height
|
1567
1567
|
@view.frame.size.width.should == @view_size.width
|
1568
1568
|
@view.frame.size.height.should == @view_size.height
|
1569
1569
|
end
|
@@ -1589,8 +1589,8 @@ describe 'Frame helpers' do
|
|
1589
1589
|
retval = @layout.frame @layout.below(@another_view)
|
1590
1590
|
retval.should == @view.frame
|
1591
1591
|
end
|
1592
|
-
@view.frame.origin.x.should ==
|
1593
|
-
@view.frame.origin.y.should ==
|
1592
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1593
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y - @view.frame.size.height
|
1594
1594
|
@view.frame.size.width.should == @view_size.width
|
1595
1595
|
@view.frame.size.height.should == @view_size.height
|
1596
1596
|
end
|
@@ -1600,8 +1600,8 @@ describe 'Frame helpers' do
|
|
1600
1600
|
retval = @layout.frame @layout.below(@another_view, up: 8)
|
1601
1601
|
retval.should == @view.frame
|
1602
1602
|
end
|
1603
|
-
@view.frame.origin.x.should ==
|
1604
|
-
@view.frame.origin.y.should ==
|
1603
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1604
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y - @view.frame.size.height + 8
|
1605
1605
|
@view.frame.size.width.should == @view_size.width
|
1606
1606
|
@view.frame.size.height.should == @view_size.height
|
1607
1607
|
end
|
@@ -1611,8 +1611,8 @@ describe 'Frame helpers' do
|
|
1611
1611
|
retval = @layout.frame @layout.below(@another_view, width: 10, height: 20)
|
1612
1612
|
retval.should == @view.frame
|
1613
1613
|
end
|
1614
|
-
@view.frame.origin.x.should ==
|
1615
|
-
@view.frame.origin.y.should ==
|
1614
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1615
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y - @view.frame.size.height
|
1616
1616
|
@view.frame.size.width.should == 10
|
1617
1617
|
@view.frame.size.height.should == 20
|
1618
1618
|
end
|
@@ -1622,8 +1622,8 @@ describe 'Frame helpers' do
|
|
1622
1622
|
retval = @layout.frame @layout.below(@another_view, x: 10, y: 20, width: 22, height: 12)
|
1623
1623
|
retval.should == @view.frame
|
1624
1624
|
end
|
1625
|
-
@view.frame.origin.x.should ==
|
1626
|
-
@view.frame.origin.y.should ==
|
1625
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + 10
|
1626
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y - @view.frame.size.height + 20
|
1627
1627
|
@view.frame.size.width.should == 22
|
1628
1628
|
@view.frame.size.height.should == 12
|
1629
1629
|
end
|
@@ -1633,8 +1633,8 @@ describe 'Frame helpers' do
|
|
1633
1633
|
retval = @layout.frame @layout.below(@another_view, right: 10, up: 20, width: 22, height: 12)
|
1634
1634
|
retval.should == @view.frame
|
1635
1635
|
end
|
1636
|
-
@view.frame.origin.x.should ==
|
1637
|
-
@view.frame.origin.y.should ==
|
1636
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + 10
|
1637
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y - @view.frame.size.height + 20
|
1638
1638
|
@view.frame.size.width.should == 22
|
1639
1639
|
@view.frame.size.height.should == 12
|
1640
1640
|
end
|
@@ -1644,8 +1644,8 @@ describe 'Frame helpers' do
|
|
1644
1644
|
retval = @layout.frame @layout.below(@another_view, left: 10, down: 20, width: 22, height: 12)
|
1645
1645
|
retval.should == @view.frame
|
1646
1646
|
end
|
1647
|
-
@view.frame.origin.x.should ==
|
1648
|
-
@view.frame.origin.y.should ==
|
1647
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x - 10
|
1648
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y - @view.frame.size.height - 20
|
1649
1649
|
@view.frame.size.width.should == 22
|
1650
1650
|
@view.frame.size.height.should == 12
|
1651
1651
|
end
|
@@ -1677,8 +1677,8 @@ describe 'Frame helpers' do
|
|
1677
1677
|
retval = @layout.frame @layout.before(@another_view)
|
1678
1678
|
retval.should == @view.frame
|
1679
1679
|
end
|
1680
|
-
@view.frame.origin.x.should ==
|
1681
|
-
@view.frame.origin.y.should ==
|
1680
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x - @view_size.width
|
1681
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1682
1682
|
@view.frame.size.width.should == @view_size.width
|
1683
1683
|
@view.frame.size.height.should == @view_size.height
|
1684
1684
|
end
|
@@ -1693,8 +1693,8 @@ describe 'Frame helpers' do
|
|
1693
1693
|
retval = @layout.frame @layout.before(@another_view)
|
1694
1694
|
retval.should == @view.frame
|
1695
1695
|
end
|
1696
|
-
@view.frame.origin.x.should ==
|
1697
|
-
@view.frame.origin.y.should ==
|
1696
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x - @view_size.width
|
1697
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1698
1698
|
@view.frame.size.width.should == @view_size.width
|
1699
1699
|
@view.frame.size.height.should == @view_size.height
|
1700
1700
|
end
|
@@ -1704,8 +1704,8 @@ describe 'Frame helpers' do
|
|
1704
1704
|
retval = @layout.frame @layout.before(@another_view, left: 8)
|
1705
1705
|
retval.should == @view.frame
|
1706
1706
|
end
|
1707
|
-
@view.frame.origin.x.should == -
|
1708
|
-
@view.frame.origin.y.should ==
|
1707
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x - @view.frame.size.width - 8
|
1708
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1709
1709
|
@view.frame.size.width.should == @view_size.width
|
1710
1710
|
@view.frame.size.height.should == @view_size.height
|
1711
1711
|
end
|
@@ -1715,8 +1715,8 @@ describe 'Frame helpers' do
|
|
1715
1715
|
retval = @layout.frame @layout.before(@another_view, width: 10, height: 20)
|
1716
1716
|
retval.should == @view.frame
|
1717
1717
|
end
|
1718
|
-
@view.frame.origin.x.should ==
|
1719
|
-
@view.frame.origin.y.should ==
|
1718
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x - @view.frame.size.width
|
1719
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1720
1720
|
@view.frame.size.width.should == 10
|
1721
1721
|
@view.frame.size.height.should == 20
|
1722
1722
|
end
|
@@ -1726,8 +1726,8 @@ describe 'Frame helpers' do
|
|
1726
1726
|
retval = @layout.frame @layout.before(@another_view, x: 10, y: 20, width: 22, height: 12)
|
1727
1727
|
retval.should == @view.frame
|
1728
1728
|
end
|
1729
|
-
@view.frame.origin.x.should == -
|
1730
|
-
@view.frame.origin.y.should ==
|
1729
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x - @view.frame.size.width + 10
|
1730
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + 20
|
1731
1731
|
@view.frame.size.width.should == 22
|
1732
1732
|
@view.frame.size.height.should == 12
|
1733
1733
|
end
|
@@ -1750,8 +1750,8 @@ describe 'Frame helpers' do
|
|
1750
1750
|
retval = @layout.frame @layout.after(@another_view)
|
1751
1751
|
retval.should == @view.frame
|
1752
1752
|
end
|
1753
|
-
@view.frame.origin.x.should ==
|
1754
|
-
@view.frame.origin.y.should ==
|
1753
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + @another_view.frame.size.width
|
1754
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1755
1755
|
@view.frame.size.width.should == @view_size.width
|
1756
1756
|
@view.frame.size.height.should == @view_size.height
|
1757
1757
|
end
|
@@ -1766,8 +1766,8 @@ describe 'Frame helpers' do
|
|
1766
1766
|
retval = @layout.frame @layout.after(@another_view)
|
1767
1767
|
retval.should == @view.frame
|
1768
1768
|
end
|
1769
|
-
@view.frame.origin.x.should ==
|
1770
|
-
@view.frame.origin.y.should ==
|
1769
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + @another_view.frame.size.width
|
1770
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1771
1771
|
@view.frame.size.width.should == @view_size.width
|
1772
1772
|
@view.frame.size.height.should == @view_size.height
|
1773
1773
|
end
|
@@ -1777,8 +1777,8 @@ describe 'Frame helpers' do
|
|
1777
1777
|
retval = @layout.frame @layout.after(@another_view, right: 8)
|
1778
1778
|
retval.should == @view.frame
|
1779
1779
|
end
|
1780
|
-
@view.frame.origin.x.should ==
|
1781
|
-
@view.frame.origin.y.should ==
|
1780
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + @another_view.frame.size.width + 8
|
1781
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1782
1782
|
@view.frame.size.width.should == @view_size.width
|
1783
1783
|
@view.frame.size.height.should == @view_size.height
|
1784
1784
|
end
|
@@ -1788,8 +1788,8 @@ describe 'Frame helpers' do
|
|
1788
1788
|
retval = @layout.frame @layout.after(@another_view, width: 10, height: 20)
|
1789
1789
|
retval.should == @view.frame
|
1790
1790
|
end
|
1791
|
-
@view.frame.origin.x.should ==
|
1792
|
-
@view.frame.origin.y.should ==
|
1791
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + @another_view.frame.size.width
|
1792
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1793
1793
|
@view.frame.size.width.should == 10
|
1794
1794
|
@view.frame.size.height.should == 20
|
1795
1795
|
end
|
@@ -1799,8 +1799,8 @@ describe 'Frame helpers' do
|
|
1799
1799
|
retval = @layout.frame @layout.after(@another_view, x: 10, y: 20, width: 22, height: 12)
|
1800
1800
|
retval.should == @view.frame
|
1801
1801
|
end
|
1802
|
-
@view.frame.origin.x.should ==
|
1803
|
-
@view.frame.origin.y.should ==
|
1802
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + @another_view.frame.size.width + 10
|
1803
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + 20
|
1804
1804
|
@view.frame.size.width.should == 22
|
1805
1805
|
@view.frame.size.height.should == 12
|
1806
1806
|
end
|
@@ -1823,8 +1823,8 @@ describe 'Frame helpers' do
|
|
1823
1823
|
retval = @layout.frame @layout.relative_to(@another_view, {})
|
1824
1824
|
retval.should == @view.frame
|
1825
1825
|
end
|
1826
|
-
@view.frame.origin.x.should ==
|
1827
|
-
@view.frame.origin.y.should ==
|
1826
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1827
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1828
1828
|
@view.frame.size.width.should == @view_size.width
|
1829
1829
|
@view.frame.size.height.should == @view_size.height
|
1830
1830
|
end
|
@@ -1850,8 +1850,8 @@ describe 'Frame helpers' do
|
|
1850
1850
|
retval = @layout.frame @layout.relative_to(@another_view, {})
|
1851
1851
|
retval.should == @view.frame
|
1852
1852
|
end
|
1853
|
-
@view.frame.origin.x.should ==
|
1854
|
-
@view.frame.origin.y.should ==
|
1853
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1854
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1855
1855
|
@view.frame.size.width.should == @view_size.width
|
1856
1856
|
@view.frame.size.height.should == @view_size.height
|
1857
1857
|
end
|
@@ -1861,8 +1861,8 @@ describe 'Frame helpers' do
|
|
1861
1861
|
retval = @layout.frame @layout.relative_to(@another_view, width: 10, height: 20)
|
1862
1862
|
retval.should == @view.frame
|
1863
1863
|
end
|
1864
|
-
@view.frame.origin.x.should ==
|
1865
|
-
@view.frame.origin.y.should ==
|
1864
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x
|
1865
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y
|
1866
1866
|
@view.frame.size.width.should == 10
|
1867
1867
|
@view.frame.size.height.should == 20
|
1868
1868
|
end
|
@@ -1872,8 +1872,8 @@ describe 'Frame helpers' do
|
|
1872
1872
|
retval = @layout.frame @layout.relative_to(@another_view, x: 10, y: 20, width: 22, height: 12)
|
1873
1873
|
retval.should == @view.frame
|
1874
1874
|
end
|
1875
|
-
@view.frame.origin.x.should ==
|
1876
|
-
@view.frame.origin.y.should ==
|
1875
|
+
@view.frame.origin.x.should == @another_view.frame.origin.x + 10
|
1876
|
+
@view.frame.origin.y.should == @another_view.frame.origin.y + 20
|
1877
1877
|
@view.frame.size.width.should == 22
|
1878
1878
|
@view.frame.size.height.should == 12
|
1879
1879
|
end
|