Class: UnderOs::UI::Icon
Constant Summary
Constants included
from Wrap
Wrap::INSTANCES_CACHE, Wrap::RAW_WRAPS_MAP, Wrap::WRAPS_TAGS_MAP
Instance Method Summary
collapse
Methods included from IconEngine
included
Methods inherited from View
#inspect
#append, #clear, #insert, #insertTo, #prepend, #remove
Methods included from Traversing
#children, #empty?, #find, #first, #matches, #parent, #siblings
Methods included from Dimensions
#position, #position=
Methods included from Animation
#animate, #fade_in, #fade_out, #highlight
Methods included from Commons
#data, #data=, #hidden, #hide, #id, #id=, #page, #show, #tagName, #toggle, #visible
Methods included from Styles
#addClass, #className, #className=, #classNames, #classNames=, #hasClass, #radioClass, #removeClass, #repaint, #style, #style=, #toggleClass
Methods included from Events
#emit, #off, #on, #on=
Methods included from Wrap
included
Constructor Details
#initialize(options) ⇒ Icon
Returns a new instance of Icon.
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/under_os/ui/icon.rb', line 7
def initialize(options)
options = {type: options} if ! options.is_a?(Hash)
super(options)
self.type = options.delete(:type) || :bug
self.size = options.delete(:size) || 20
self.disable if options[:disabled]
@_.sizeToFit
@_.showsTouchWhenHighlighted = true
end
|
Instance Method Details
54
55
56
|
# File 'lib/under_os/ui/icon.rb', line 54
def disable
self.disabled = true
end
|
#disabled ⇒ Object
Also known as:
disabled?
44
45
46
|
# File 'lib/under_os/ui/icon.rb', line 44
def disabled
! @_.isEnabled
end
|
#disabled=(value) ⇒ Object
50
51
52
|
# File 'lib/under_os/ui/icon.rb', line 50
def disabled=(value)
@_.enabled = ! value
end
|
58
59
60
|
# File 'lib/under_os/ui/icon.rb', line 58
def enable
self.disabled = false
end
|
#size(size = nil) ⇒ Object
29
30
31
32
33
34
35
36
|
# File 'lib/under_os/ui/icon.rb', line 29
def size(size=nil)
if size
self.size = size
self
else
@size
end
end
|
#size=(size) ⇒ Object
38
39
40
41
42
|
# File 'lib/under_os/ui/icon.rb', line 38
def size=(size)
@size = size
@_.setFont self.class.engine.font(size)
@_.sizeToFit
end
|
20
21
22
|
# File 'lib/under_os/ui/icon.rb', line 20
def type
@type
end
|
#type=(type) ⇒ Object
24
25
26
27
|
# File 'lib/under_os/ui/icon.rb', line 24
def type=(type)
@type = type
@_.setTitle self.class.engine.text(type), forState:UIControlStateNormal
end
|