summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-07-01 08:41:06 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-07-01 08:41:06 +0000
commitc5010442d3861b350455e8d612e1dcfeea14c862 (patch)
treee6762635269ec7be2040455ddaa9aacbb5e4fc4b
parent673be3bb9805ca637b337d7a5de1822efa404029 (diff)
downloadcontrol-center-c5010442d3861b350455e8d612e1dcfeea14c862.tar
control-center-c5010442d3861b350455e8d612e1dcfeea14c862.tar.gz
control-center-c5010442d3861b350455e8d612e1dcfeea14c862.tar.bz2
control-center-c5010442d3861b350455e8d612e1dcfeea14c862.tar.xz
control-center-c5010442d3861b350455e8d612e1dcfeea14c862.zip
optimize left text alignment
-rwxr-xr-xcontrol-center2
1 files changed, 1 insertions, 1 deletions
diff --git a/control-center b/control-center
index bc4ed729..9d1b1956 100755
--- a/control-center
+++ b/control-center
@@ -494,7 +494,7 @@ foreach (@tree) {
$darea_left->modify_font($fonts[$curr_state]);
($lines, $widths, $heights) = (get_text_coord($text, $darea_left, $d_width-$left_txt_offset-$right_text_offset, $d_height, 0, 0, 0, 0))[2..4];
- my $offset = -12 + (listlength(@$lines) > 1 ? $heights->[0]/2 +7 : 0); # multi line texts are offsetted; but -12 and +7 are pure black magic
+ my $offset = -($d_height - string_height($darea_left, $lines->[0]) * (listlength(@$lines) +0.2)) / 2 ; # text lines are offsetted
mapn {
$dbl_area_left[$curr_state]->draw_layout($darea_left->style->black_gc, $_[1]+$left_txt_offset, $_[2]-$offset, $darea_left->create_pango_layout($_[0]));
} $lines, $widths, $heights;