Prima::Widget::Fader - fading- in/out functions
The role implements fading effects in widgets
use base qw(Prima::Widget Prima::Widget::Fader); { my %RNT = ( %{Prima::Widget-> notification_types()}, %{Prima::Widget::Fader-> notification_types()}, ); sub notification_types { return \%RNT; } } sub on_mouseenter { shift-> fader_in_mouse_enter } sub on_mouseleave { shift-> fader_out_mouse_leave } sub on_paint { my ( $self, $canvas ) = @_; $canvas->backColor( $self-> fader_prelight_color( $self-> hiliteBackColor )); $canvas->clear; }
The API is currently under design so the parts that are documented are those that expected to be staying intact.
Initiates a fade-in transition, calls repaint on each step.
Initiates a fade-out transition, calls repaint on each step.
Returns the current fader value in the range from 0 to 1. Returns undef if there is no current fading transition in effect
undef
Given a base $COLOR, increases (or decreases) its brightness according to fader_current_value and an eventual $MULTIPLIER that is expected to be in the range from 0 to 1.
$COLOR
fader_current_value
$MULTIPLIER
Called when fader_in_mouse_enter finishes the fading, the $ENDS_OK flag is set to 0 if the process was overridden by another fader call, 1 otherwise.
fader_in_mouse_enter
$ENDS_OK
Called when fader_out_mouse_leave finishes the fading, the $ENDS_OK flag is set to 0 if the process was overridden by another fader call, 1 otherwise.
fader_out_mouse_leave
By default repaints the whole widget, but can be overloaded if only some widget parts need to reflect the fader effect.
Dmitry Karasik, <dmitry@karasik.eu.org>.
Prima::Widget
To install Prima, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima
CPAN shell
perl -MCPAN -e shell install Prima
For more information on module installation, please visit the detailed CPAN module installation guide.