After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 614049 - Allow packing options for GtkExpander label widgets
Allow packing options for GtkExpander label widgets
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.18.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-03-26 19:55 UTC by Usama Akkad
Modified: 2010-08-10 03:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (10.35 KB, image/png)
2010-03-26 19:55 UTC, Usama Akkad
  Details
new task is broken too (12.23 KB, image/png)
2010-03-28 19:35 UTC, Usama Akkad
  Details
Proposed patch (1002 bytes, patch)
2010-03-29 12:56 UTC, Matthew Barnes
none Details | Review
Reproducer program (1.43 KB, patch)
2010-03-29 16:09 UTC, Matthew Barnes
none Details | Review
Proposed patch (6.52 KB, patch)
2010-03-30 00:49 UTC, Matthew Barnes
needs-work Details | Review

Description Usama Akkad 2010-03-26 19:55:49 UTC
Created attachment 157212 [details]
screenshot

https://bugs.launchpad.net/ubuntu/+source/evolution/+bug/545459

Binary package hint: evolution

evolution new message is broken in Arabic locale

steps to reproduce:
1.open evolution with in Arabic locale (you can use "LC_ALL=ar_SA.UTF-8 evolution" if you don't want to change the language of your system)
2.try to open new message

you will be faced with a broken form of new message window with many of the text hidden. see attachment.

what should be:
good looking normal window

this bug seems to effects all the Arabic locale user
Comment 1 André Klapper 2010-03-27 13:27:39 UTC
By starting evolution from the shell, is there any output when doing this?
Comment 2 André Klapper 2010-03-27 13:32:01 UTC
Reproducible in Evolution 2.28 too. Only shell output is:

(evolution:6399): gtkhtml-editor-WARNING **: ar-SA: No such language

New button seems to be broken too (other issue).
Comment 3 Usama Akkad 2010-03-28 19:35:46 UTC
Created attachment 157331 [details]
new task is broken too

I found this bug in the new task window too
Comment 4 Matthew Barnes 2010-03-29 12:56:20 UTC
Created attachment 157378 [details] [review]
Proposed patch

This was caused by an evil hack I pulled in the attachment bar to get the "# Attachments (size)" label to remain centered.  Works fine in LTR locales, not so much in RTL locales.  So my workaround is to simply skip the hack in RTL locales.  It just means the attachments label will be misaligned.
Comment 5 Matthew Barnes 2010-03-29 16:09:19 UTC
Created attachment 157392 [details] [review]
Reproducer program

Here's a small GTK+ program that reproduces the same issue: Run the program in a LTR locale and it renders fine.  Run the program in a RTL locale and it fails to draw the window correctly.

This appears to be a bug in GtkExpander.  Reassigning to GTK+.
Comment 6 Matthew Barnes 2010-03-29 16:17:24 UTC
Lowering importance since this is a GTK+ issue and we have a workaround for Evolution.
Comment 7 Matthias Clasen 2010-03-29 18:16:34 UTC
I don't see any bug here. The size request misuse is clearly in the 'if it breaks, you keep both parts' area. If anything, this is an enhancement request for GtkExpander.
Comment 8 Matthew Barnes 2010-03-29 18:52:16 UTC
Fair enough, it is clearly a hack on my part.  Any suggestions on a proper API for this?

Only thing that comes to mind is to mimic GtkBox:

   void   gtk_expander_set_label_packing (GtkExpander *expander,
                                          gboolean expand,
                                          gboolean fill,
                                          guint padding);

Maybe "expand" doesn't make sense in this context?
Comment 9 Matthew Barnes 2010-03-30 00:49:06 UTC
Created attachment 157426 [details] [review]
Proposed patch

Decided "expand" doesn't make sense here and can't see a use case for "padding" when you can use a GtkAlignment, so I just added a new boolean property named "label-fill".
Comment 10 Matthew Barnes 2010-07-17 10:15:29 UTC
My evil GtkExpander hack for Evolution's composer is now tripping an assertion in GTK3's height-for-width logic, so I had to disable it altogether.  The above patch would let me do what I'm trying to do properly.
Comment 11 Emmanuele Bassi (:ebassi) 2010-07-22 12:58:47 UTC
Review of attachment 157426 [details] [review]:

overall, I think that having a new packing property is not a bad thing.

::: gtk/gtkexpander.c
@@ +673,3 @@
+			       2 * focus_width - 2 * focus_pad;
+			       expander_size - 2 * expander_spacing -
+      label_allocation.width = allocation->width - 2 * border_width -

I think you mean:

  alloc_width = MIN(alloc_width, request_width)

here.
Comment 12 Matthias Clasen 2010-08-10 03:19:47 UTC
I've fixed this up and committed it, thanks.