teacup 0.3.11 → 0.3.12
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.
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/dummy.rb +7 -0
- data/lib/teacup/version.rb +1 -1
- data/lib/teacup/z_core_extensions/ui_view_getters.rb +15 -7
- data/lib/teacup/z_core_extensions/z_handlers.rb +11 -0
- metadata +17 -8
- data/Dofile +0 -6
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/dummy.rb
CHANGED
data/lib/teacup/version.rb
CHANGED
@@ -4,14 +4,18 @@ class UIView
|
|
4
4
|
|
5
5
|
# get one stylesheet by stylename
|
6
6
|
# my_view[:button] :button => #<UIButton..>
|
7
|
-
def viewWithStylename
|
8
|
-
|
7
|
+
def viewWithStylename name_or_class
|
8
|
+
if name_or_class.is_a? Class
|
9
|
+
view = subviews.find { |view| view.is_a? name_or_class }
|
10
|
+
else
|
11
|
+
view = subviews.find { |view| view.stylename == name_or_class }
|
12
|
+
end
|
9
13
|
return view if view
|
10
14
|
|
11
15
|
# found_subview will get assigned to the view we want, but the subview is
|
12
16
|
# what is returned.
|
13
17
|
found_subview = nil
|
14
|
-
view = subviews.find {|subview| found_subview = subview.viewWithStylename(
|
18
|
+
view = subviews.find {|subview| found_subview = subview.viewWithStylename(name_or_class) }
|
15
19
|
return found_subview if view
|
16
20
|
|
17
21
|
nil # couldn't find it
|
@@ -19,13 +23,17 @@ class UIView
|
|
19
23
|
|
20
24
|
# get stylesheets by stylename
|
21
25
|
# my_view.all :button => [#<UIButton..>, #<UIButton...>]
|
22
|
-
def viewsWithStylename
|
26
|
+
def viewsWithStylename name_or_class
|
23
27
|
r = []
|
24
28
|
subviews.each do |view|
|
25
|
-
if
|
26
|
-
|
29
|
+
if name_or_class.is_a? Class
|
30
|
+
if view.is_a? name_or_class
|
31
|
+
r << view
|
32
|
+
end
|
33
|
+
else view.stylename == name_or_class
|
34
|
+
r << view
|
27
35
|
end
|
28
|
-
r += view.viewsWithStylename
|
36
|
+
r += view.viewsWithStylename name_or_class
|
29
37
|
end
|
30
38
|
r
|
31
39
|
end
|
@@ -85,3 +85,14 @@ Teacup.handler UIView, :frame { |frame|
|
|
85
85
|
Teacup.handler UIButton, :title { |title|
|
86
86
|
self.setTitle(title, forState: UIControlStateNormal)
|
87
87
|
}
|
88
|
+
|
89
|
+
|
90
|
+
Teacup.handler UIButton, :titleColor { |color|
|
91
|
+
self.setTitleColor(color.uicolor, forState: UIControlStateNormal)
|
92
|
+
}
|
93
|
+
|
94
|
+
|
95
|
+
Teacup.handler UIButton, :titleFont { |font|
|
96
|
+
font = font.uifont
|
97
|
+
self.titleLabel.font = font
|
98
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teacup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rspec
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: ! 'Teacup is a community-driven DSL for making CSS-like styling, and
|
37
47
|
layouts for
|
38
48
|
|
@@ -51,7 +61,6 @@ extra_rdoc_files: []
|
|
51
61
|
files:
|
52
62
|
- .gitignore
|
53
63
|
- CHANGES.md
|
54
|
-
- Dofile
|
55
64
|
- Gemfile
|
56
65
|
- Gemfile.lock
|
57
66
|
- LICENSE
|
@@ -112,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
121
|
version: '0'
|
113
122
|
requirements: []
|
114
123
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.8.
|
124
|
+
rubygems_version: 1.8.19
|
116
125
|
signing_key:
|
117
126
|
specification_version: 3
|
118
127
|
summary: A community-driven DSL for creating user interfaces on iOS.
|