lib/under_os/ui/icon.rb in under-os-1.1.0 vs lib/under_os/ui/icon.rb in under-os-1.2.0
- old
+ new
@@ -9,10 +9,11 @@
super(options)
self.type = options.delete(:type) || :bug
self.size = options.delete(:size) || 20
+ self.disable if options[:disabled]
@_.sizeToFit
@_.showsTouchWhenHighlighted = true
end
@@ -36,7 +37,25 @@
def size=(size)
@size = size
@_.setFont self.class.engine.font(size)
@_.sizeToFit
+ end
+
+ def disabled
+ ! @_.isEnabled
+ end
+
+ alias :disabled? :disabled
+
+ def disabled=(value)
+ @_.enabled = ! value
+ end
+
+ def disable
+ self.disabled = true
+ end
+
+ def enable
+ self.disabled = false
end
end