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 765715 - halign seems to be ignored if label is word wrapped
halign seems to be ignored if label is word wrapped
Status: RESOLVED OBSOLETE
Product: glade
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-28 10:35 UTC by segfault
Modified: 2018-03-26 15:54 UTC
See Also:
GNOME target: ---
GNOME version: 3.19/3.20


Attachments
halign set to GTK_ALIGN_START and text is word wrapped (8.10 KB, image/png)
2016-04-28 11:00 UTC, segfault
Details
xalign set to GTK_ALIGN_START and word wrapped, but text not long enough to actually wrap. (3.63 KB, image/png)
2016-04-28 11:01 UTC, segfault
Details
xalign set to 0 produces the expected result (8.08 KB, image/png)
2016-04-28 11:02 UTC, segfault
Details

Description segfault 2016-04-28 10:35:01 UTC
If I set set a label's halign property to something else than GTK_ALIGN_FILL (e.g. GTK_ALIGN_START) and enable word wrapping on the label and set the text to something long enough that it is actually wrapped, then the label is not aligned according to the halign.

Steps to reproduce:
1. Create a GtkLabel
2. Set the halign property to GTK_ALIGN_START
3. Set the wrap property to True
4. Leave the wrap-mode property to the default pango.WRAP_WORD (bug does not apply to pango.WRAP_CHAR)
5. Set the label text to something long enough to cause wrapping

Result:
Label is aligned like halign was set to GTK_ALIGN_FILL.

Expected result:
Label is aligned to the left.

Using the deprecated GtkAlignment with xalign = 0 works as expected.
Comment 1 Matthias Clasen 2016-04-28 10:38:11 UTC
A screenshot might help to make your point clear; so far I don't believe that there is a bug. The interaction between xalign/halign and justify can be confusing.

GtkLabel::xalign is not deprecated because it is still needed for cases like the one you describe.
Comment 2 segfault 2016-04-28 11:00:01 UTC
Created attachment 326931 [details]
halign set to GTK_ALIGN_START and text is word wrapped
Comment 3 segfault 2016-04-28 11:01:25 UTC
Created attachment 326932 [details]
xalign set to GTK_ALIGN_START and word wrapped, but text not long enough to actually wrap.
Comment 4 segfault 2016-04-28 11:02:01 UTC
Created attachment 326933 [details]
xalign set to 0 produces the expected result
Comment 5 segfault 2016-04-28 11:05:12 UTC
> --- Comment #1 from Matthias Clasen <mclasen@redhat.com> ---
> A screenshot might help to make your point clear; so far I don't
believe that
> there is a bug. The interaction between xalign/halign and justify can be
> confusing.

Sure, I added screenshots of the different behaviours.

> GtkLabel::xalign is not deprecated because it is still needed for
cases like
> the one you describe.

The GTK+ 3 Reference Manual on GtkAlignment [1] says that the xalign property is deprecated and halign should be used instead. This was why I thought that halign would replace xalign and should have the same behaviour. But now I see that the GtkLabel::xalign does not have the comment about being deprecated.

But at least when using Glade there seems to be no way to set the xalign without a warning triangle being displayed, warning about the deprecation of the property.

Also, I don't see why halign should behave this way.

[1] https://developer.gnome.org/gtk3/unstable/GtkAlignment.html
Comment 6 Matthias Clasen 2016-04-30 20:21:38 UTC
I'm going to move this bug to glade, since the real problem here is that GtkLabel::xalign is not offered.
Comment 7 GNOME Infrastructure Team 2018-03-26 15:54:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glade/issues/236.