GNOME Bugzilla – Bug 109473
it'd be nice if selectable labels worked like they do in mozilla
Last modified: 2014-12-23 11:51:42 UTC
I like the way selectable labels work in mozilla. To see what I mean, open the Page Info dialog in mozilla, and make the window fairly skinny, so that the URL doesn't fit. Then select it with the mouse. It can move back and forth so you can see and select the whole thing.
Note that in gtk you wouldn't be able to resize the window such that the labels didn't fit... so this would only apply in the case your label was inside a scrolled window, or if you had a broken layout. There is a separate bug already open to do something smarter than truncate both ends of the label in this case, also.
> Note that in gtk you wouldn't be able to resize the window such that > the labels didn't fit Right... that's partly what I'm suggesting to change.
Changing that is a major project - right now minimum size and default size are the same thing, the size request. I'm not sure it's right, either... kinda broken to be able to shrink that window.
Maybe there could be a property on GtkLabel that makes it behave like mozilla labels. GTK could improve on that by adding a visual indication that some text is hidden, e.g. Reports of my death have been -> <-eath have been greatly exagg-> <-have been greatly exaggerated. The arrows could be clickable, too!
There are already bugs open for ellipsization (hard Pango project, bug 59071) and for labels in scrolled windows auto-scrolling (bug 72916) I'm not really sure what is being suggested here in addition. I added a note to the ellipsization bug that that the caller may want to influence the ellipsized portion based on selection or cursor position.
I might not completely understand the ellipsization idea. But for scrolled labels, I don't see that anything needs to be done in pango. It would be rather like a limited scrolled window, with arrows on either side instead of a scrollbar below, and policy always set to automatic. (I don't think ellipsing in the middle would be useful for scrolled labels.)
The bug referred to above is bug 79216.
I think the request here could be expressed as: A non-ellipsized single-line selectable label that gets allocated less than it's requisition should have the same scrolling behavior as GtkEntry. Which I think is possible reasonably, though the interaction of all the possible modes might get complicated. I'm less sure how it would work for multiline labels. Visible indication, it seems to me should be exactly the same as GtkEntry ... see bug 108963 for a RFE for visual indication in GtkEntry.
Note that placing a limit on the width of these labels might also be a good idea. I've seen cases where the fact that they cannot be resized becomes kind of rediculous. For instance, in the xscreensaver preferences: Choose a screensaver and click settings. Widen the window. Click advanced and click standard. The label in the right pane grows. Keep clicking and the label keeps growing. Depending on the text and the layout of the left pane, this can make the left pane unusable by allowing it too little space, while the text in the right pane is hogging the width. Could be an xscreensaver-gnome problem though..
*** This bug has been marked as a duplicate of bug 79216 ***