gnome-media r4166 - in trunk/gnome-volume-control: . src
- From: hadess svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-media r4166 - in trunk/gnome-volume-control: . src
- Date: Mon, 26 Jan 2009 19:40:36 +0000 (UTC)
Author: hadess
Date: Mon Jan 26 19:40:35 2009
New Revision: 4166
URL: http://svn.gnome.org/viewvc/gnome-media?rev=4166&view=rev
Log:
2009-01-26 Bastien Nocera <hadess hadess net>
* src/gvc-balance-bar.c (_scale_box_new), (gvc_balance_bar_init):
Patch from Luca Ferretti <elle uca libero it>, to use the new GTK+
scale marks for the balance widget (Closes: #565144)
Modified:
trunk/gnome-volume-control/ChangeLog
trunk/gnome-volume-control/src/gvc-balance-bar.c
Modified: trunk/gnome-volume-control/src/gvc-balance-bar.c
==============================================================================
--- trunk/gnome-volume-control/src/gvc-balance-bar.c (original)
+++ trunk/gnome-volume-control/src/gvc-balance-bar.c Mon Jan 26 19:40:35 2009
@@ -66,9 +66,7 @@
GtkWidget *box;
GtkWidget *sbox;
GtkWidget *ebox;
- GtkWidget *ivbox;
- GtkWidget *ihbox;
- GtkWidget *label;
+ GtkAdjustment *adjustment = bar->priv->adjustment;
char *str;
bar->priv->scale_box = box = gtk_hbox_new (FALSE, 6);
@@ -86,22 +84,20 @@
gtk_box_pack_start (GTK_BOX (sbox), priv->label, FALSE, FALSE, 0);
- ivbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box), ivbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (sbox), priv->scale, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (ivbox), priv->scale, TRUE, TRUE, 0);
- ihbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (ivbox), ihbox, FALSE, FALSE, 0);
- str = g_strdup_printf ("<small>%s</small>", _("Left"));
- label = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (label), str);
+ str = g_strdup_printf ("<small>%s</small>", C_("balance", "Left"));
+ gtk_scale_add_mark (GTK_SCALE (priv->scale), adjustment->lower ,
+ GTK_POS_BOTTOM, str);
g_free (str);
- gtk_box_pack_start (GTK_BOX (ihbox), label, FALSE, FALSE, 0);
- str = g_strdup_printf ("<small>%s</small>", _("Right"));
- label = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (label), str);
+
+ str = g_strdup_printf ("<small>%s</small>", C_("balance", "Right"));
+ gtk_scale_add_mark (GTK_SCALE (priv->scale), adjustment->upper,
+ GTK_POS_BOTTOM, str);
g_free (str);
- gtk_box_pack_end (GTK_BOX (ihbox), label, FALSE, FALSE, 0);
+
+ gtk_scale_add_mark (GTK_SCALE (priv->scale), (adjustment->upper - adjustment->lower)/2 + adjustment->lower,
+ GTK_POS_BOTTOM, NULL);
bar->priv->end_box = ebox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (box), ebox, FALSE, FALSE, 0);
@@ -320,7 +316,7 @@
G_CALLBACK (on_adjustment_value_changed),
bar);
- bar->priv->label = gtk_label_new (_("Balance:"));
+ bar->priv->label = gtk_label_new_with_mnemonic (_("_Balance:"));
gtk_misc_set_alignment (GTK_MISC (bar->priv->label),
0.0,
0.5);
@@ -333,6 +329,9 @@
bar->priv->scale_box = _scale_box_new (bar);
gtk_container_add (GTK_CONTAINER (frame), bar->priv->scale_box);
gtk_widget_show_all (frame);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL (bar->priv->label),
+ bar->priv->scale);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]