summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-12-17 14:59:49 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-12-17 14:59:49 +0000
commitd34211f0039c88fc737067c8adebfb2a3b910ac6 (patch)
tree76b2750ef8616fbcf512df56b662b8ae43dab44d
parentc3e30bc442c1c7542c439b9ccf5eca2cc03bff32 (diff)
downloadcontrol-center-d34211f0039c88fc737067c8adebfb2a3b910ac6.tar
control-center-d34211f0039c88fc737067c8adebfb2a3b910ac6.tar.gz
control-center-d34211f0039c88fc737067c8adebfb2a3b910ac6.tar.bz2
control-center-d34211f0039c88fc737067c8adebfb2a3b910ac6.tar.xz
control-center-d34211f0039c88fc737067c8adebfb2a3b910ac6.zip
compute offsets only once, not once per state anymore since we always
reuse the same layout
-rwxr-xr-xcontrol-center4
1 files changed, 2 insertions, 2 deletions
diff --git a/control-center b/control-center
index eae73495..e1f6512c 100755
--- a/control-center
+++ b/control-center
@@ -616,7 +616,7 @@ foreach (@tree) {
my @icon_pixbufs = ($icon_pixbuf, render_shiner($icon_pixbuf, 1.89), $icon_pixbuf);
my @fonts = map { Gtk2::Pango::FontDescription->from_string($_) } '', 'Bold', 'Bold';
- my ($lines, $widths, $heights, @dbl_area_left);
+ my ($lines, $widths, $heights, $offset, @dbl_area_left);
push @curr_state, 0;
push @old_state, -1;
@@ -629,6 +629,7 @@ foreach (@tree) {
unless ($lines) {
$darea_left->modify_font($fonts[1]);
($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];
+ $offset = -($d_height - string_height($darea_left, $lines->[0]) * (listlength(@$lines) + 0.2)) / 2; # text lines are offsetted
}
# Redraw double buffer on first expose in that particular state (selected <=> not selected): render background, then icon, then text
unless ($dbl_area_left[$curr_state]) {
@@ -641,7 +642,6 @@ foreach (@tree) {
$darea_left->modify_font($fonts[$curr_state]);
- 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;