diff options
Diffstat (limited to 'src/Agent.pm')
-rw-r--r-- | src/Agent.pm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Agent.pm b/src/Agent.pm index 75cf616..4a38434 100644 --- a/src/Agent.pm +++ b/src/Agent.pm @@ -14,7 +14,7 @@ use strict; #---------------------------------------------------------------------- my ($x0, $y0, $wmax, $dx, $dy, $cmin, $rmax, @matrix, @hosts, $tempo_id, $mw, $bg, $fg, $selcolor, $hlbg, $darkbg, $fontspec, @fontspec, - $on_img, $off_img, %instances, @instances, $bus, + $on_img, $off_img, %instances, @instances, $bus, $coef, $hosts_tl, $selected_host, $preselected_host); @@ -22,7 +22,7 @@ my ($x0, $y0, $wmax, $dx, $dy, $cmin, $rmax, @matrix, @hosts, $tempo_id, sub configure { shift; ($mw, $bg, $fg, $selcolor, $hlbg, $darkbg, - $fontspec, $x0, $y0, $wmax, $dy, $cmin, $rmax, $bus) = @_; + $fontspec, $x0, $y0, $wmax, $dy, $cmin, $rmax, $bus, $coef) = @_; @fontspec = @$fontspec if $fontspec; $off_img = $mw->Bitmap('off', -file => Tk::findINC('led.bmp'), -foreground => $bg); @@ -194,15 +194,15 @@ sub setposition { } $matrix[$r][$c]->[0] = $self; my ($x, $y) = ($matrix[$r][$c]->[1], $matrix[$r][$c]->[2]); - my $y2 = $y - 5; - $y2 -= 12 if ($self->{label}->cget(-text) =~ /\n/); + my $y2 = $y - 5*$coef; + $y2 -= 12*$coef if ($self->{label}->cget(-text) =~ /\n/); if ($self->{command}) { - $self->{led}->configure(-highlightthickness => 6); - $self->{led}->place(-x => $x+3, -y => $y+3); + $self->{led}->configure(-highlightthickness => 6*$coef); + $self->{led}->place(-x => $x+3*$coef, -y => $y+3*$coef); } else { - $self->{led}->configure(-highlightthickness => 2); - $self->{led}->place(-x => $x+6, -y => $y+6); + $self->{led}->configure(-highlightthickness => 2*$coef); + $self->{led}->place(-x => $x+6*$coef, -y => $y+6*$coef); } $self->{label}->place(-x => $x + 38, -y => $y2); @@ -219,7 +219,7 @@ sub createlabel { ); $self->{label} = $mw->Label(-text => $self->formatlabel, - -pady => 10, + -pady => 10*$coef, -justify => 'left', -relief => 'flat', -highlightthickness => 0, |