aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-03-23 04:36:45 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2012-03-27 21:16:59 +0800
commitd9765b15543ac5160a103227452b3cd84fbd143f (patch)
treeed6c333a2be0b7a5924a1f673a820235b1caa0a4 /src
parent3873c839159fefbe9001338d6f162b610e4f4284 (diff)
downloadgsoc2013-empathy-d9765b15543ac5160a103227452b3cd84fbd143f.tar
gsoc2013-empathy-d9765b15543ac5160a103227452b3cd84fbd143f.tar.gz
gsoc2013-empathy-d9765b15543ac5160a103227452b3cd84fbd143f.tar.bz2
gsoc2013-empathy-d9765b15543ac5160a103227452b3cd84fbd143f.tar.lz
gsoc2013-empathy-d9765b15543ac5160a103227452b3cd84fbd143f.tar.xz
gsoc2013-empathy-d9765b15543ac5160a103227452b3cd84fbd143f.tar.zst
gsoc2013-empathy-d9765b15543ac5160a103227452b3cd84fbd143f.zip
call-window: factor out some common code
https://bugzilla.gnome.org/show_bug.cgi?id=672560
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 49723c6dd..18324619a 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -324,6 +324,16 @@ static gboolean empathy_call_window_bus_message (GstBus *bus,
GstMessage *message, gpointer user_data);
static void
+make_background_transparent (GtkClutterActor *actor)
+{
+ GdkRGBA transparent = { 0., 0., 0., 0. };
+ GtkWidget *widget;
+
+ widget = gtk_clutter_actor_get_widget (actor);
+ gtk_widget_override_background_color (widget, GTK_STATE_FLAG_NORMAL, &transparent);
+}
+
+static void
empathy_call_window_show_hangup_button (EmpathyCallWindow *self,
gboolean show)
{
@@ -1070,8 +1080,6 @@ create_video_preview (EmpathyCallWindow *self)
ClutterAction *action;
GtkWidget *button;
PreviewPosition pos;
- GdkRGBA transparent = { 0., 0., 0., 0. };
- GtkWidget *bin;
g_assert (priv->video_preview == NULL);
@@ -1100,10 +1108,7 @@ create_video_preview (EmpathyCallWindow *self)
priv->preview_spinner_actor = empathy_rounded_actor_new (PREVIEW_ROUND_FACTOR);
g_object_set (priv->preview_spinner_widget, "expand", TRUE, NULL);
- gtk_widget_override_background_color (
- gtk_clutter_actor_get_widget (
- GTK_CLUTTER_ACTOR (priv->preview_spinner_actor)),
- GTK_STATE_FLAG_NORMAL, &transparent);
+ make_background_transparent (GTK_CLUTTER_ACTOR (priv->preview_spinner_actor));
gtk_widget_show (priv->preview_spinner_widget);
gtk_container_add (
@@ -1132,8 +1137,7 @@ create_video_preview (EmpathyCallWindow *self)
clutter_actor_set_size (b, 24, 24);
clutter_actor_set_margin_right (b, 4);
clutter_actor_set_margin_bottom (b, 2);
- bin = gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (b));
- gtk_widget_override_background_color (bin, GTK_STATE_FLAG_NORMAL, &transparent);
+ make_background_transparent (GTK_CLUTTER_ACTOR (b));
clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (layout), b,
CLUTTER_BIN_ALIGNMENT_END, CLUTTER_BIN_ALIGNMENT_END);
@@ -1147,7 +1151,7 @@ create_video_preview (EmpathyCallWindow *self)
button = gtk_button_new_with_label (_("i"));
priv->preview_hidden_button = b = gtk_clutter_actor_new_with_contents (button);
clutter_actor_set_size (b, 24, 24);
- gtk_widget_override_background_color (bin, GTK_STATE_FLAG_NORMAL, &transparent);
+ make_background_transparent (GTK_CLUTTER_ACTOR (b));
clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->preview_layout),
priv->preview_hidden_button,
@@ -1560,7 +1564,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
ClutterActor *remote_avatar;
GtkStyleContext *context;
GtkCssProvider *provider;
- GdkRGBA transparent = { 0., 0., 0., 0. };
GdkRGBA rgba;
ClutterColor bg;
@@ -1721,10 +1724,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
create_video_input (self);
priv->floating_toolbar = gtk_clutter_actor_new ();
- gtk_widget_override_background_color (
- gtk_clutter_actor_get_widget (
- GTK_CLUTTER_ACTOR (priv->floating_toolbar)),
- GTK_STATE_FLAG_NORMAL, &transparent);
+ make_background_transparent (GTK_CLUTTER_ACTOR (priv->floating_toolbar));
gtk_widget_reparent (priv->bottom_toolbar,
gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (priv->floating_toolbar)));