[empathy] CallWindow: move the volume button to the bottom toolbar



commit 2dcddbe1397ab3ee2cdd84bd146d311d067b8729
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Fri Jul 22 13:07:42 2011 +0100

    CallWindow: move the volume button to the bottom toolbar

 src/empathy-call-window.c  |   25 +++++++++----------------
 src/empathy-call-window.ui |    8 ++++++++
 2 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 92baf6d..f7eab4a 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -122,7 +122,7 @@ struct _EmpathyCallWindowPriv
   GtkWidget *remote_user_avatar_widget;
   GtkWidget *sidebar;
   GtkWidget *statusbar;
-  GtkWidget *volume_button;
+  GtkWidget *volume_item;
   GtkWidget *redial_button;
   GtkWidget *mic_button;
   GtkWidget *camera_button;
@@ -289,27 +289,19 @@ static void
 empathy_call_window_setup_toolbar (EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  GtkToolItem *tool_item;
-
-  /* Add an empty expanded GtkToolItem so the volume button is at the end of
-   * the toolbar. */
-  tool_item = gtk_tool_item_new ();
-  gtk_tool_item_set_expand (tool_item, TRUE);
-  gtk_widget_show (GTK_WIDGET (tool_item));
-  gtk_toolbar_insert (GTK_TOOLBAR (priv->toolbar), tool_item, -1);
+  GtkWidget *volume_button;
 
-  priv->volume_button = gtk_volume_button_new ();
+  volume_button = gtk_volume_button_new ();
   /* FIXME listen to the audiosinks signals and update the button according to
    * that, for now starting out at 1.0 and assuming only the app changes the
    * volume will do */
-  gtk_scale_button_set_value (GTK_SCALE_BUTTON (priv->volume_button), 1.0);
-  g_signal_connect (G_OBJECT (priv->volume_button), "value-changed",
+  gtk_scale_button_set_value (GTK_SCALE_BUTTON (volume_button), 1.0);
+  g_signal_connect (G_OBJECT (volume_button), "value-changed",
     G_CALLBACK (empathy_call_window_volume_changed_cb), self);
 
-  tool_item = gtk_tool_item_new ();
-  gtk_container_add (GTK_CONTAINER (tool_item), priv->volume_button);
-  gtk_widget_show_all (GTK_WIDGET (tool_item));
-  gtk_toolbar_insert (GTK_TOOLBAR (priv->toolbar), tool_item, -1);
+  gtk_container_add (GTK_CONTAINER (priv->volume_item),
+      volume_button);
+  gtk_widget_show (GTK_WIDGET (volume_button));
 }
 
 static void
@@ -979,6 +971,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
     "pane", &priv->pane,
     "statusbar", &priv->statusbar,
     "redial", &priv->redial_button,
+    "volume", &priv->volume_item,
     "microphone", &priv->mic_button,
     "camera", &priv->camera_button,
     "dialpad", &priv->dialpad_button,
diff --git a/src/empathy-call-window.ui b/src/empathy-call-window.ui
index 1d58bcb..3258ae6 100644
--- a/src/empathy-call-window.ui
+++ b/src/empathy-call-window.ui
@@ -207,6 +207,14 @@
               </packing>
             </child>
             <child>
+              <object class="GtkToolItem" id="volume">
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkToggleToolButton" id="microphone">
                 <property name="visible">True</property>
                 <property name="active">True</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]