X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkvolumebutton.c;h=ceb64721f5909f2bd7868943a6e99919dc1175a0;hb=894f84c623f2e280376be2945159fbf354377913;hp=639688f493f97d3ed7ebbbcb43464bdeecb1a2b7;hpb=23c1d1cbc99f927a78fb03665c7fd74ef7801611;p=~andy%2Fgtk diff --git a/gtk/gtkvolumebutton.c b/gtk/gtkvolumebutton.c index 639688f49..ceb64721f 100644 --- a/gtk/gtkvolumebutton.c +++ b/gtk/gtkvolumebutton.c @@ -15,9 +15,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ /* @@ -30,9 +28,10 @@ #include "config.h" #include "gtkvolumebutton.h" -#include "gtkstock.h" -#include "gtktooltip.h" + +#include "gtkadjustment.h" #include "gtkintl.h" +#include "gtktooltip.h" /** @@ -47,7 +46,7 @@ #define EPSILON (1e-10) -const char * const icons[] = +static const gchar * const icons[] = { "audio-volume-muted", "audio-volume-high", @@ -55,7 +54,8 @@ const char * const icons[] = "audio-volume-medium", NULL }; -const char * const icons_symbolic[] = + +static const gchar * const icons_symbolic[] = { "audio-volume-muted-symbolic", "audio-volume-high-symbolic", @@ -204,7 +204,7 @@ gtk_volume_button_init (GtkVolumeButton *button) } /** - * gtk_volume_button_new + * gtk_volume_button_new: * * Creates a #GtkVolumeButton, with a range between 0.0 and 1.0, with * a stepping of 0.02. Volume values can be obtained and modified using @@ -231,21 +231,21 @@ cb_query_tooltip (GtkWidget *button, gpointer user_data) { GtkScaleButton *scale_button = GTK_SCALE_BUTTON (button); - GtkAdjustment *adj; + GtkAdjustment *adjustment; gdouble val; char *str; AtkImage *image; image = ATK_IMAGE (gtk_widget_get_accessible (button)); - adj = gtk_scale_button_get_adjustment (scale_button); + adjustment = gtk_scale_button_get_adjustment (scale_button); val = gtk_scale_button_get_value (scale_button); - if (val < (adj->lower + EPSILON)) + if (val < (gtk_adjustment_get_lower (adjustment) + EPSILON)) { str = g_strdup (_("Muted")); } - else if (val >= (adj->upper - EPSILON)) + else if (val >= (gtk_adjustment_get_upper (adjustment) - EPSILON)) { str = g_strdup (_("Full Volume")); } @@ -253,7 +253,7 @@ cb_query_tooltip (GtkWidget *button, { int percent; - percent = (int) (100. * val / (adj->upper - adj->lower) + .5); + percent = (int) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5); /* Translators: this is the percentage of the current volume, * as used in the tooltip, eg. "49 %".