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 549720 - Add a way to hide GtkScale's slider
Add a way to hide GtkScale's slider
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 549691
 
 
Reported: 2008-08-28 14:58 UTC by Bastien Nocera
Modified: 2010-12-01 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk: Allow hiding the trough/slider in GtkScale (10.00 KB, patch)
2010-11-22 17:48 UTC, Bastien Nocera
none Details | Review
gtk: Allow hiding the trough/slider in GtkScale (4.16 KB, patch)
2010-11-23 15:12 UTC, Bastien Nocera
committed Details | Review
Hide the slider when streaming (2.51 KB, patch)
2010-11-24 12:30 UTC, Bastien Nocera
none Details | Review

Description Bastien Nocera 2008-08-28 14:58:02 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
Comment 1 Michael Natterer 2008-08-28 15:19:17 UTC
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... ;)
Comment 2 Bastien Nocera 2008-08-28 15:27:59 UTC
(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.
Comment 3 Bastien Nocera 2010-11-22 17:48:53 UTC
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.
Comment 4 Bastien Nocera 2010-11-23 15:12:02 UTC
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.
Comment 5 Bastien Nocera 2010-11-24 12:30:18 UTC
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 6 Bastien Nocera 2010-11-24 12:31:18 UTC
Comment on attachment 175158 [details] [review]
Hide the slider when streaming

Wrong bug.
Comment 7 Bastien Nocera 2010-12-01 16:03:32 UTC
Committed with a note in the GtkScale documentation.

Attachment 175112 [details] pushed as 959fc60 - gtk: Allow hiding the trough/slider in GtkScale