X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=bin%2Fembrace;h=1d28c908d65f5b274d92dfc4068b3529332ba85e;hb=633df2fe37fade5c825f3829386fefff357f592e;hp=f7ae62b0cf9ac72c17113b558c37a80e033e568d;hpb=b0551cddd6ab569d3ef743946b7a6720ae8bc9e7;p=embrace.git diff --git a/bin/embrace b/bin/embrace index f7ae62b..1d28c90 100755 --- a/bin/embrace +++ b/bin/embrace @@ -40,10 +40,6 @@ class Evas::EvasObject move_relative(obj, (b[2] / 2) - (a[2] / 2), (b[3] / 2) - (a[3] / 2)) end - - def alpha=(alpha) - set_color(*(get_color[0..-2] << alpha)) - end end module Embrace @@ -81,10 +77,10 @@ module Embrace # an animator that runs for the specified number of seconds, # and yields values between 0 and 255 class AlphaAnimator < ZeroToOneAnimator - def initialize(duration, *objects) + def initialize(duration, object) super(duration) do |v| a = compute_alpha(v) - objects.each { |o| o.alpha = a } + object.set_color(a, a, a, a) end end @@ -142,9 +138,7 @@ module Embrace @objects = [@img, @label] @objects.each { |o| add_member(o) } - set_color(255, 255, 255, 0) - @img.set_color(255, 255, 255, 0) - @label.set_color(255, 0, 0, 0) + set_color(0, 0, 0, 0) @img.set_file(ICON_FILE) @img.set_fill(0, 0, *@img.get_size) @@ -202,7 +196,8 @@ module Embrace end def smart_color_set(r, g, b, a) - @objects.each { |o| o.alpha = a } + @img.set_color(r, g, b, a) + @label.set_color(r, 0, 0, a) end end