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 618104 - calendar: Fix day headers being elipizied
calendar: Fix day headers being elipizied
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-05-08 12:04 UTC by drago01
Modified: 2010-05-10 15:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
calendar: Fix day headers being elipizied (1.13 KB, patch)
2010-05-08 12:05 UTC, drago01
none Details | Review
calendar: Fix day headers being elipizied (1.44 KB, patch)
2010-05-08 12:11 UTC, drago01
none Details | Review
calendar: Fix day headers being elipizied (1.71 KB, patch)
2010-05-08 12:55 UTC, drago01
none Details | Review
calendar: Fix day headers being elipizied (1.68 KB, patch)
2010-05-08 13:46 UTC, drago01
needs-work Details | Review
[StTable] Do something reasonable for width-for-height sizing (1.92 KB, patch)
2010-05-08 16:24 UTC, Owen Taylor
committed Details | Review
Use a St.Bin rather than a St.BoxLayout for calendar popup (1.28 KB, patch)
2010-05-08 16:24 UTC, Owen Taylor
committed Details | Review

Description drago01 2010-05-08 12:04:51 UTC
See patch.
Comment 1 drago01 2010-05-08 12:05:20 UTC
Created attachment 160569 [details] [review]
calendar: Fix day headers being elipizied

Currently some headers like Mo, Tue, Wed, ... might end up elipizied,
which should never happen because showing "..." in the UI instead of Fri,
isn't the intended behaviour.

Fix this by setting the x_fill property to true.
Comment 2 drago01 2010-05-08 12:11:29 UTC
Created attachment 160570 [details] [review]
calendar: Fix day headers being elipizied

Currently some headers like Mo, Tue, Wed, ... might end up elipizied,
which should never happen because showing "..." in the UI instead of Fri,
isn't the intended behaviour.

Fix this by setting the x_fill property to true.

Also use the calendar-day style_class for headers to avoid odd looking
spacing.
Comment 3 drago01 2010-05-08 12:42:11 UTC
Comment on attachment 160570 [details] [review]
calendar: Fix day headers being elipizied

This seems to break "x_align: St.Align.END"
Comment 4 drago01 2010-05-08 12:55:54 UTC
Created attachment 160571 [details] [review]
calendar: Fix day headers being elipizied

Currently some headers like Mo, Tue, Wed, ... might end up elipizied,
which should never happen because showing "..." in the UI instead of Fri,
isn't the intended behaviour.

Fix this by making the labels WIDTH_FOR_HEIGHT rather than HEIGHT_FOR_WIDTH.

Also use the calendar-day style_class for headers to avoid odd looking
spacing.
Comment 5 drago01 2010-05-08 13:46:05 UTC
Created attachment 160574 [details] [review]
calendar: Fix day headers being elipizied

Fix patch to actually apply (i.e not base it on a unpushed version).
Comment 6 Owen Taylor 2010-05-08 14:19:38 UTC
Review of attachment 160574 [details] [review]:

I think all the WIDTH_FOR_HEIGHT vs. HEIGHT_FOR_WIDTH is doing is that when set to WIDTH_FOR_HEIGHT the labels no longer ellipsize for some reason or another. But Clutter.Text doesn't have WIDTH_FOR_HEIGHT support and if it did it wouldn't make sense here - the labels aren't wrapping at all.

There is some St.Table (or possibly St.Label) bug that needs to be fixed here.
Comment 7 drago01 2010-05-08 14:33:20 UTC
(In reply to comment #6)
> Review of attachment 160574 [details] [review]:
> 
> I think all the WIDTH_FOR_HEIGHT vs. HEIGHT_FOR_WIDTH is doing is that when set
> to WIDTH_FOR_HEIGHT the labels no longer ellipsize for some reason or another.
> But Clutter.Text doesn't have WIDTH_FOR_HEIGHT support and if it did it
> wouldn't make sense here - the labels aren't wrapping at all.
> 
> There is some St.Table (or possibly St.Label) bug that needs to be fixed here.

It is not about Clutter.Text supporting WIDTH_FOR_HEIGHT or not but St.Table is calling _st_allocate_fill() in st_table_preferred_allocate() which queries the request_mode property of the child:

-----
request = CLUTTER_REQUEST_HEIGHT_FOR_WIDTH;
g_object_get (G_OBJECT (child), "request-mode", &request, NULL);
-----

and base the allocation on that; so WIDTH_FOR_HEIGHT vs. HEIGHT_FOR_WIDTH is not really "unsupported" here.
Comment 8 Owen Taylor 2010-05-08 14:35:34 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Review of attachment 160574 [details] [review] [details]:
> > 
> > I think all the WIDTH_FOR_HEIGHT vs. HEIGHT_FOR_WIDTH is doing is that when set
> > to WIDTH_FOR_HEIGHT the labels no longer ellipsize for some reason or another.
> > But Clutter.Text doesn't have WIDTH_FOR_HEIGHT support and if it did it
> > wouldn't make sense here - the labels aren't wrapping at all.
> > 
> > There is some St.Table (or possibly St.Label) bug that needs to be fixed here.
> 
> It is not about Clutter.Text supporting WIDTH_FOR_HEIGHT or not but St.Table is
> calling _st_allocate_fill() in st_table_preferred_allocate() which queries the
> request_mode property of the child:
> 
> -----
> request = CLUTTER_REQUEST_HEIGHT_FOR_WIDTH;
> g_object_get (G_OBJECT (child), "request-mode", &request, NULL);
> -----
>
> and base the allocation on that; so WIDTH_FOR_HEIGHT vs. HEIGHT_FOR_WIDTH is
> not really "unsupported" here.

That doesn't change anything - the change you are making to calender.js doesn't make conceptual sense and shouldn't necessary.
Comment 9 Owen Taylor 2010-05-08 16:24:36 UTC
Created attachment 160593 [details] [review]
[StTable] Do something reasonable for width-for-height sizing

Three problems in combination here:

 - By using a horizontal boxlayout, we were invoking
   width-for-height layout on the St.Table
 - St.Table was treating the flag -1 value for for_width
   as a real width, and requested its children at junk
   with.
 - That confused some recently added code to ClutterText for
   layout caching.

Here's a fix for the middle problem. You could argue that it
should be handled generically in _st_actor_get_preferred_*
instead, but that would take away the ability of an actor
to be smart and handle both height-for-width and width-for-height
automatically.

(Do we want that? Should the user have to change the request mode
in that case?)
Comment 10 Owen Taylor 2010-05-08 16:24:50 UTC
Created attachment 160594 [details] [review]
Use a St.Bin rather than a St.BoxLayout for calendar popup

Using a horizontal St.BoxLayout for calendar container forces
width-for-height layout on the St.Table child. Since St.Table
is naturally width-for-height, this can trigger bugs and is,
at best, a bit ineffecient. Use a St.Bin instead since we don't
need any BoxLayout features.
Comment 11 Owen Taylor 2010-05-08 18:16:37 UTC
See http://bugzilla.openedhand.com/show_bug.cgi?id=2109 for a fix for the third problem.
Comment 12 Owen Taylor 2010-05-09 20:37:50 UTC
Comment on attachment 160594 [details] [review]
Use a St.Bin rather than a St.BoxLayout for calendar popup

Attachment 160594 [details] pushed as 5111edb - Use a St.Bin rather than a St.BoxLayout for calendar popup
Comment 13 Dan Winship 2010-05-10 14:34:58 UTC
Review of attachment 160593 [details] [review]:

yeah, looks right.