Re: [PATCH] Icon view RTL layout
- From: Christian Neumair <chris gnome-de org>
- To: Alexander Larsson <alexl redhat com>
- Cc: nautilus-list gnome org
- Subject: Re: [PATCH] Icon view RTL layout
- Date: Wed, 01 Mar 2006 20:28:04 +0100
Am Dienstag, den 28.02.2006, 12:02 +0100 schrieb Christian Neumair:
> Am Dienstag, den 28.02.2006, 10:59 +0100 schrieb Alexander Larsson:
> > On Tue, 2006-02-28 at 10:49 +0100, Christian Neumair wrote:
> > > Am Dienstag, den 28.02.2006, 10:43 +0100 schrieb Alexander Larsson:
> > > > Maybe this just should wait until after 2.14. We're only one week from
> > > > total code freeze.
> > >
> > > At the moment Nautilus is totally unusable for people with RTL layouts
> > > with text besides icon. I think the situation can't get much worse.
> >
> > It can definitely get worse. For instance it might be unusable for
> > people in both RTL and LTR layouts. Or it might randomly crash.
> >
> > I'm not saying you patch causes this, I'm just saying, this is why we
> > have freezes, and do as little as possible at the end. We have *no* new
> > release before the final 2.14 tarball now, so changes will get zero
> > testing. We already have a major regression in 2.13.92:
> > http://bugzilla.gnome.org/show_bug.cgi?id=332784
> > Lets make sure we don't have any more...
> >
> > I'm sure you think this is boring, and RTL people won't like it, but
> > release management is not done to piss people off, its very important to
> > not fuck up the release for everyone.
>
> I see...so maybe we can get the attached patch in which at least fixes
> the icon text alignment for RTL environments (i.e. all filenames can be
> read)? This is neccessary because we use the layout both for measurement
> and for drawing. The offset modification slightly prettifies the
> alignment.
Yeah, and of course it *had* to break. The attached patch ensures that
the layout code is completely identical with text below icon, which
hopefully qualifies it for 2.14.
--
Christian Neumair <chris gnome-de org>
Index: libnautilus-private/nautilus-icon-canvas-item.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-canvas-item.c,v
retrieving revision 1.196
diff -u -p -r1.196 nautilus-icon-canvas-item.c
--- libnautilus-private/nautilus-icon-canvas-item.c 27 Feb 2006 12:45:41 -0000 1.196
+++ libnautilus-private/nautilus-icon-canvas-item.c 1 Mar 2006 19:23:17 -0000
@@ -1003,18 +1003,26 @@ draw_or_measure_label_text (NautilusIcon
if (have_editable) {
editable_layout = get_label_layout (&details->editable_text_layout, item, details->editable_text);
-
+
+ pango_layout_set_width (editable_layout, max_text_width * PANGO_SCALE);
pango_layout_get_pixel_size (editable_layout,
&editable_width,
&editable_height);
+ if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
+ pango_layout_set_width (editable_layout, editable_width * PANGO_SCALE);
+ }
}
if (have_additional) {
additional_layout = get_label_layout (&details->additional_text_layout, item, details->additional_text);
+ pango_layout_set_width (additional_layout, max_text_width * PANGO_SCALE);
pango_layout_get_pixel_size (additional_layout,
&additional_width,
&additional_height);
+ if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
+ pango_layout_set_width (editable_layout, editable_width * PANGO_SCALE);
+ }
}
details->text_width = MAX (editable_width, additional_width);
@@ -1068,7 +1076,7 @@ draw_or_measure_label_text (NautilusIcon
if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
- x = text_rect.x0 + 2;
+ x = text_rect.x0 + text_back_padding_x;
} else {
x = text_rect.x0 + ((text_rect.x1 - text_rect.x0) - max_text_width) / 2;
}
@@ -1635,8 +1643,7 @@ create_label_layout (NautilusIconCanvasI
}
pango_layout_set_text (layout, zeroified_text, -1);
- pango_layout_set_width (layout, floor (nautilus_icon_canvas_item_get_max_text_width (item)) * PANGO_SCALE);
-
+
if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]