aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-10 17:14:25 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-15 19:14:54 +0800
commit30d64de5341a8701ddfd3be24071846de82e121f (patch)
treebee03a0062ed91d87c2eca114c32a7846b8b19ba
parent2848d12da55d0c4c9016d8f355ed9d1343e0f2e7 (diff)
downloadgsoc2013-empathy-30d64de5341a8701ddfd3be24071846de82e121f.tar.gz
gsoc2013-empathy-30d64de5341a8701ddfd3be24071846de82e121f.tar.zst
gsoc2013-empathy-30d64de5341a8701ddfd3be24071846de82e121f.zip
Factor out empathy_call_window_get_preview_rectangle
https://bugzilla.gnome.org/show_bug.cgi?id=656268
-rw-r--r--src/empathy-call-window.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index ecdd22ad9..c8dc182fb 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -646,6 +646,33 @@ empathy_call_window_get_preview_position (EmpathyCallWindow *self,
return pos;
}
+static ClutterActor *
+empathy_call_window_get_preview_rectangle (EmpathyCallWindow *self,
+ PreviewPosition pos)
+{
+ ClutterActor *rectangle;
+
+ switch (pos)
+ {
+ case PREVIEW_POS_TOP_LEFT:
+ rectangle = self->priv->preview_rectangle1;
+ break;
+ case PREVIEW_POS_TOP_RIGHT:
+ rectangle = self->priv->preview_rectangle3;
+ break;
+ case PREVIEW_POS_BOTTOM_LEFT:
+ rectangle = self->priv->preview_rectangle2;
+ break;
+ case PREVIEW_POS_BOTTOM_RIGHT:
+ rectangle = self->priv->preview_rectangle4;
+ break;
+ default:
+ rectangle = NULL;
+ }
+
+ return rectangle;
+}
+
static void
empathy_call_window_move_video_preview (EmpathyCallWindow *self,
PreviewPosition pos)
@@ -691,24 +718,7 @@ empathy_call_window_highlight_preview_rectangle (EmpathyCallWindow *self,
{
ClutterActor *rectangle;
- switch (pos)
- {
- case PREVIEW_POS_TOP_LEFT:
- rectangle = self->priv->preview_rectangle1;
- break;
- case PREVIEW_POS_TOP_RIGHT:
- rectangle = self->priv->preview_rectangle3;
- break;
- case PREVIEW_POS_BOTTOM_LEFT:
- rectangle = self->priv->preview_rectangle2;
- break;
- case PREVIEW_POS_BOTTOM_RIGHT:
- rectangle = self->priv->preview_rectangle4;
- break;
- default:
- g_warn_if_reached ();
- rectangle = NULL;
- }
+ rectangle = empathy_call_window_get_preview_rectangle (self, pos);
clutter_rectangle_set_border_width (CLUTTER_RECTANGLE (rectangle), 3);
clutter_rectangle_set_border_color (CLUTTER_RECTANGLE (rectangle),