Prima::...::Fader(3)
π¦ Prima::Widget::Fader β bestie, it's giving fade β¨
okay so real talk, this is the Prima::...::Fader(3) page (yes the header literally calls it Prima::...::Fader(3) in the corner, and the real class name is Prima::Widget::Fader, don't @ me, that's just how the docs roll π
). It lives in the User Contributed Perl Documentation section, and it's about making widgets fade in and out like the main characters they are.
πΈ NAME πΈ
Prima::Widget::Fader</p> β the fading-in/fading-out functions module. that's it, that's the vibe.
π DESCRIPTION π
So this role? It implements fading effects in widgets. that's the whole personality. a widget gets this role and suddenly it can glow up gradually instead of just appearing like some kind of jump-scare π iconic behavior honestly.
β¨ SYNOPSIS β¨
here's the whole ~look~ β literally copy this energy:
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;
}
see how on_mouseenter kicks off fader_in_mouse_enter and on_mouseleave kicks off fader_out_mouse_leave? and on_paint grabs fader_prelight_color off of hiliteBackColor for that backColor glow-up? yeah. that's the whole demo. slay. π«Ά
π₯ API π₯
ngl, the API is currently under design, so the only parts documented here are the ones that are expected to be staying intact. translation: don't get too attached to anything that isn't on this page, bestie π
π Methods π
fader_in_mouse_enterβ initiates a fade-in transition, and calls repaint on each and every step. every step! committed. β¨fader_out_mouse_leaveβ initiates a fade-out transition, and yep, calls repaint on each step too. symmetrical queen. πfader_current_valueβ returns the current fader value, in the range from0to1. and if there's no current fading transition in effect? it returns"undef". sad but honest πfader_prelight_color $COLOR [, $MULTIPLIER ]β given a base$COLOR, this increases (or decreases) its brightness according tofader_current_value, plus an eventual$MULTIPLIERthat's expected to be in the range from0to1. yes you can dial the drama up or down. obsessed. π
π¦ Events π¦
FadeIn $ENDS_OKβ called whenfader_in_mouse_enterfinishes the fading. the$ENDS_OKflag is set to0if the process was overridden by another fader call, and1otherwise. so like, did you actually finish or did someone else cut in? πFadeOut $ENDS_OKβ called whenfader_out_mouse_leavefinishes the fading. same deal:$ENDS_OKis0if the process was overridden by another fader call,1otherwise. fr fr. πFadeRepaintβ by default this repaints the whole widget, but you can overload it if only some widget parts need to reflect the fader effect. like if only the cheekbones need highlight, yk? highkey useful. π
π AUTHOR π
Dmitry Karasik, <dmitry@karasik.eu.org>. respect the icon who wrote the fade. π
π« SEE ALSO π«
Prima::Widgetβ go read it, iykyk π§
and that's the page!! β¨ sourced from perl v5.42.0, dated 2024-08-20, and filed under Prima::...::Fader(3) in the manual. mwah, go make something fade π
π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms