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 646196 - Make GtkWidget::halign RTL-safe
Make GtkWidget::halign RTL-safe
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 646125
 
 
Reported: 2011-03-30 06:31 UTC by Matthias Clasen
Modified: 2011-03-30 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (3.73 KB, patch)
2011-03-30 06:31 UTC, Matthias Clasen
none Details | Review

Description Matthias Clasen 2011-03-30 06:31:59 UTC
Created attachment 184659 [details] [review]
patch

When doing layout with containers that automatically flip in RTL locales, it is convenient if halign can be used in the same fashion.

Since GTK_ALIGN_START/_END are explicitly documented in terms of left/right, we add two new enumeration values, GTK_ALIGN_INITIAL/_FINAL, which behave like START/END, but flip their sense depending on the text direction when used in horizontal context.
Comment 1 Benjamin Otte (Company) 2011-03-30 11:41:43 UTC
Like Ryan said on IRC, I would just change the behavior of START/END and be done with it.

Or is there a good reason to not do that?
Comment 2 Allison Karlitskaya (desrt) 2011-03-30 11:45:51 UTC
I would also consider adding LEFT/RIGHT so that you can get the original functionality when you really need it.  It wouldn't make much sense for vertical alignments but for that case you could either g_critical or treat it as if it were START/END.

btw: I only consider this change as acceptable because it's still quite early...

If we want to be quite strict about the API then I suggest:

  - use FIRST/LAST as preferable to INITIAL/FINAL
  - deprecate START/END to remove confusion
  - add LEFT/RIGHT

As proposed, I think trying to remember the difference between "START" and "INITIAL" or "END" and "FINAL" could be quite annoying.  Having a clear "LEFT" and "RIGHT" would improve that situation.
Comment 3 Allison Karlitskaya (desrt) 2011-03-30 11:49:00 UTC
for the record, google code search shows practically no use of this API yet.

a quick grep through the GNOME modules that I happen to have checked out at the moment finds itself rather entirely in agreement.