side panel splitter

This commit is contained in:
Eduardo Bart
2012-03-26 15:33:00 -03:00
parent 9309d6e7f3
commit ee869bb279
15 changed files with 126 additions and 62 deletions

View File

@@ -2,8 +2,9 @@ Effects = {}
function Effects.fadeIn(widget, time, elapsed)
if not elapsed then elapsed = 0 end
if not time then time = 250 end
if not time then time = 300 end
widget:setOpacity(math.min(elapsed/time, 1))
removeEvent(widget.fadeEvent)
if elapsed < time then
removeEvent(widget.fadeEvent)
widget.fadeEvent = scheduleEvent(function()
@@ -16,19 +17,20 @@ end
function Effects.fadeOut(widget, time, elapsed)
if not elapsed then elapsed = 0 end
if not time then time = 250 end
if not time then time = 300 end
elapsed = math.max((1 - widget:getOpacity()) * time, elapsed)
removeEvent(widget.fadeEvent)
widget:setOpacity(math.max((time - elapsed)/time, 0))
if elapsed < time then
removeEvent(widget.fadeEvent)
widget.fadeEvent = scheduleEvent(function()
Effects.fadeOut(widget, time, elapsed + 30)
end, 30)
else
widget.fadeEvent = nil
widget:destroy()
end
end
function Effects.cancelFade(widget)
removeEvent(widget.fadeEvent)
widget.fadeEvent = nil
end

View File

@@ -74,12 +74,12 @@ function ToolTip.display(text)
toolTipLabel:show()
toolTipLabel:raise()
toolTipLabel:enable()
Effects.fadeIn(toolTipLabel, 100)
moveToolTip(toolTipLabel)
end
function ToolTip.hide()
toolTipLabel:hide()
Effects.fadeOut(toolTipLabel, 100)
end
-- UIWidget extensions