summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2012-02-04 23:42:21 +0100
committerPaul Buetow <paul@buetow.org>2012-02-04 23:42:21 +0100
commit30a69d43ffe9e72ef52b6886514cebbcca678c8c (patch)
tree029301dd8889d3ee93b6a30a3d656dcde7e1ed29
parentae3119fcbad12751dd1fee051dd965a6893e79df (diff)
fix auto off text
-rwxr-xr-xloadbars16
1 files changed, 7 insertions, 9 deletions
diff --git a/loadbars b/loadbars
index c33d016..15af568 100755
--- a/loadbars
+++ b/loadbars
@@ -310,29 +310,27 @@ sub draw_background ($$) {
}
sub create_threads (@) {
- return map {
- $_->detach();
- $_;
-
- } map {
- threads->create( 'thread_get_stats', split /:/ );
-
- } @_;
+ return
+ map { $_->detach(); $_ }
+ map { threads->create( 'thread_get_stats', split ':' ) } @_;
}
sub auto_off_text ($) {
my ($barwidth) = @_;
if ($barwidth < $C{barwidth} - 1 && $I{showtextoff} == 0) {
+ return if $C{showtext} == 0;
display_warn 'Disabling text display, text does not fit into window. Use \'t\' to re-enable.';
$I{showtextoff} = 1;
$C{showtext} = 0;
- } elsif ($I{showtextoff} && $barwidth >= $C{barwidth} - 1) {
+ } elsif ($I{showtextoff} == 1 && $barwidth >= $C{barwidth} - 1) {
display_info 'Re-enabling text display, text fits into window now.';
$C{showtext} = 1;
$I{showtextoff} = 0;
}
+
+ return undef;
}
sub set_dimensions ($$) {