GNOME Bugzilla – Bug 784231
Improve compact transit route label rendering
Last modified: 2017-06-27 20:21:56 UTC
Created attachment 354532 [details] Screenshot Currently we always render the route labels in the itinerary overview when there is less than 6 legs in a journey, and just the mode icons when there's more legs than that. However, in some cases even a lower number of legs may "overflow" the route labels, causing ellipsization. A better approach might be to actually try to estimate the cut-off by counting and summing up the number of characters in the compacted route labels (along with a "base width" for actual icons). Computing the actual number of pixels might be a bit hard due to differences in i.e. fonts sizes.
Created attachment 354583 [details] [review] transitPlan: Add function to get compact route labels This was moved from the TransitRouteLabel class to be used when rendering itinerary overviews.
Created attachment 354584 [details] [review] transitRouteLabel: Use the compactRoute from TransitLeg Use the compactRoute function in TransitLeg instead of the one that used to be here.
Created attachment 354585 [details] [review] transitItineraryRow: Refine rendering route labels Take into account the space of route labels when deciding when to render in contracted mode (with use mode icons).
Attachment 354583 [details] pushed as d81b7a9 - transitPlan: Add function to get compact route labels Attachment 354584 [details] pushed as 9c69268 - transitRouteLabel: Use the compactRoute from TransitLeg Attachment 354585 [details] pushed as b2c890c - transitItineraryRow: Refine rendering route labels