Tickit-Widget-Layout-Desktop
view release on metacpan or search on metacpan
* ::Desktop::Taskbar - a subclass of statusbar which provides window
lists and launchers
METHODS
render_to_rb
Clears the exposed area. All rendering happens in the floating windows
on top of this widget.
overlay
Render all window outlines on top of the target widget.
Takes the following parameters:
* $rb - the Tickit::RenderBuffer we will be drawing into
* $exclude - the current Tickit::Widget we are drawing - this will be
used to check for intersections so we don't waste time drawing
unrelated areas
lib/Tickit/Widget/Layout/Desktop.pm view on Meta::CPAN
floating windows on top of this widget.
=cut
method render_to_rb ($rb, $rect) {
$rb->eraserect($rect);
}
method children { @{$self->{widgets}} }
=head2 overlay
Render all window outlines on top of the target widget.
Takes the following parameters:
=over 4
=item * $rb - the L<Tickit::RenderBuffer> we will be drawing into
=item * $exclude - the current L<Tickit::Widget> we are drawing - this will be used
to check for intersections so we don't waste time drawing unrelated areas
=back
=cut
method overlay ($rb, $rect, $exclude) {
my $target = $exclude->window->rect;
# TODO change this when proper accessors are available
my %win_map = map {
refaddr($_->window) => $_
} @{$self->{widgets}};
delete $win_map{refaddr($exclude->window)};
# Each child widget, from back to front
CHILD:
lib/Tickit/Widget/Layout/Desktop.pod view on Meta::CPAN
=back
=head1 METHODS
=head2 render_to_rb
Clears the exposed area. All rendering happens in the
floating windows on top of this widget.
=head2 overlay
Render all window outlines on top of the target widget.
Takes the following parameters:
=over 4
=item * $rb - the L<Tickit::RenderBuffer> we will be drawing into
=item * $exclude - the current L<Tickit::Widget> we are drawing - this will be used
lib/Tickit/Widget/Layout/Desktop/Window.pm view on Meta::CPAN
$self->with_rb($rb => sub {
my $rb = shift;
my ($top, $left) = ($win->top, $win->left);
# We'll be rendering relative to the container
$rb->translate(-$top, -$left);
# Ask our container to ask all other floating
# windows to render their frames on our context,
# so we join line segments where expected
$self->{container}->overlay($rb, $rect, $self);
# Restore our origin
# TODO would've thought ->restore should handle this?
$rb->translate($top, $left);
});
my ($w, $h) = map $win->$_ - 1, qw(cols lines);
my $text_pen = $self->get_style_pen('title');
# This is a nasty hack - we want to know whether it's safe to draw
lib/Tickit/Widget/Layout/Desktop/Window.pm view on Meta::CPAN
# ... then we render our actual border, possibly using a different style for
# active window...
my $line = {
round => LINE_SINGLE,
single => LINE_SINGLE,
thick => LINE_THICK,
double => LINE_DOUBLE,
}->{$self->get_style_values('linetype')};
# So we first render the frame. This will pick up any adjoining lines from
# our overlay, all being well.
$rb->linebox_at(0, $h, 0, $w, $line);
if($self->get_style_values('linetype') eq 'round') {
my $limit = [
$win->root->bottom,
$win->root->right
];
my @corner_char;
CORNER:
( run in 2.227 seconds using v1.01-cache-2.11-cpan-49f99fa48dc )