GNOME Bugzilla – Bug 549720
Add a way to hide GtkScale's slider
Last modified: 2010-12-01 16:03:36 UTC
Currently, the only way to hide the GtkScale's slider is to use the "slider-length" style property, but it makes me feel dirty to do that. This would be used for Totem, when the source is being streamed. Otherwise the handle bar is visible but doesn't carry accurate information. See the middle image in http://bugzilla.gnome.org/attachment.cgi?id=117515&action=view
Are you aware of GtkRange's fill-level API? (which can be used if the overall length of the streamed content is known). For unknown length, I would say displaying a scale at all is a bit on crack... ;)
(In reply to comment #1) > Are you aware of GtkRange's fill-level API? (which can be used > if the overall length of the streamed content is known). The case above is for radio streams, and other live streams. > For unknown length, I would say displaying a scale at all is a bit > on crack... ;) The problem is that hiding the scale would make the window change sizes, which is a bad idea. So I'd want to make the slider invisible, so as to show that the length isn't known. A lot of other media players don't hide the scale and simply don't show the slider itself, which is what I want to achieve here.
Created attachment 175057 [details] [review] gtk: Allow hiding the trough/slider in GtkScale Using a property in GtkScale, which GtkRange will act upon when it comes to drawing. Test case is in tests/testscale, with a toggle button showing/hiding the slider itself. Note that mouse and key events are ignored on the scale when the trough/slider is hidden.
Created attachment 175112 [details] [review] gtk: Allow hiding the trough/slider in GtkScale When setting a GtkRange's upper and lower values to the same value, the slider will not be drawn any more.
Created attachment 175158 [details] [review] Hide the slider when streaming So that people are not confused by the slider getting stuck in one location.
Comment on attachment 175158 [details] [review] Hide the slider when streaming Wrong bug.
Committed with a note in the GtkScale documentation. Attachment 175112 [details] pushed as 959fc60 - gtk: Allow hiding the trough/slider in GtkScale