Subject: | Erase to background for consistent display |
Remember to erase to background colour so we get a nice consistent display.
Patch attached. Also removes some old redundant (commented-out) code.
--
Paul Evans
Subject: | erase-to-background.patch |
=== modified file 'lib/Tickit/Widget/Statusbar.pm'
--- lib/Tickit/Widget/Statusbar.pm 2019-07-08 22:29:32 +0000
+++ lib/Tickit/Widget/Statusbar.pm 2019-07-08 22:30:00 +0000
@@ -144,10 +144,10 @@
sub render_to_rb {
my ($self, $rb, $rect) = @_;
- my $txt = substrwidth $self->status, $rect->left, $rect->cols;
my $base_pen = $self->get_style_pen;
+
+ $rb->goto(0, 0);
if(defined(my $v = $self->status)) {
- $rb->goto($rect->top, $rect->left);
$v->iter_substr_nooverlap(sub {
my ($substr, %tags) = @_;
my $pen = Tickit::Pen::Immutable->new(
@@ -158,9 +158,7 @@
});
}
-# $rb->text_at($rect->top, $rect->left, $txt, $self->get_style_pen);
- # $rb->erase_at($rect->top, $rect->left + textwidth($txt), $rect->cols - textwidth($txt), $self->get_style_pen);
-# $rb->text_at($rect->top, $rect->left + textwidth($txt), ' ' x ($rect->cols - textwidth($txt)));
+ $rb->erase_to($self->window->cols, $base_pen);
}
=head2 update_status