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 451866 - GtkVolumeButton range
GtkVolumeButton range
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 451856
 
 
Reported: 2007-06-28 13:09 UTC by Christian Persch
Modified: 2007-06-28 14:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
change default range, and fix tooltips (2.76 KB, patch)
2007-06-28 13:41 UTC, Christian Persch
accepted-commit_now Details | Review

Description Christian Persch 2007-06-28 13:09:10 UTC
GtkVolumeButton's default range is 0 to 100. While the percentage is a convenient way to present the volume to the user, it's not so convenient for the programmer. IMHO the default range should be 0.0 (mute) to 1.0 (full).

Also, GtkVolumeButton is a GtkScaleButton and as such you can use gtk_scale_button_get_adjustment to set a different range on it. If you do that however, the volume button's tooltip becomes incorrect, since gtk_volume_button_update_tooltip assumes the range is 0..100.
Comment 1 Christian Persch 2007-06-28 13:41:39 UTC
Created attachment 90802 [details] [review]
change default range, and fix tooltips
Comment 2 Bastien Nocera 2007-06-28 13:45:43 UTC
Looks good to me.
Comment 3 Matthias Clasen 2007-06-28 13:47:26 UTC
Looks good to me too.
Comment 4 Christian Persch 2007-06-28 14:34:27 UTC
        * gtk/gtkvolumebutton.c: (gtk_volume_button_class_init),
        (gtk_volume_button_init), (gtk_volume_button_dispose),
        (gtk_volume_button_update_tooltip): Make the volume button use range
        0.0 to 1.0 by default, and fix tooltips code to cope with different ranges.
        Bug #451866.