aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-10 17:27:10 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-15 19:14:55 +0800
commitca2cb730d68620a638ef41d09cd25984e6cb4008 (patch)
tree78bfb049eb0155cb8b42fa892956393a13c9ef20 /src
parentc0a10ef3094f82a9d0532e942b0b27d7f34f0201 (diff)
downloadgsoc2013-empathy-ca2cb730d68620a638ef41d09cd25984e6cb4008.tar
gsoc2013-empathy-ca2cb730d68620a638ef41d09cd25984e6cb4008.tar.gz
gsoc2013-empathy-ca2cb730d68620a638ef41d09cd25984e6cb4008.tar.bz2
gsoc2013-empathy-ca2cb730d68620a638ef41d09cd25984e6cb4008.tar.lz
gsoc2013-empathy-ca2cb730d68620a638ef41d09cd25984e6cb4008.tar.xz
gsoc2013-empathy-ca2cb730d68620a638ef41d09cd25984e6cb4008.tar.zst
gsoc2013-empathy-ca2cb730d68620a638ef41d09cd25984e6cb4008.zip
Highlight the preview when hovered
https://bugzilla.gnome.org/show_bug.cgi?id=656268
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index feb16a398..78ff5cb57 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -565,7 +565,7 @@ empathy_call_window_create_preview_rectangle (EmpathyCallWindow *self,
SELF_VIDEO_SECTION_HEIGTH + 2 * SELF_VIDEO_MARGIN);
clutter_actor_set_size (rectangle,
- SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGTH);
+ SELF_VIDEO_SECTION_WIDTH + 5, SELF_VIDEO_SECTION_HEIGTH + 5);
clutter_container_add_actor (CLUTTER_CONTAINER (box), rectangle);
@@ -800,6 +800,42 @@ empathy_call_window_preview_on_drag_motion_cb (ClutterDragAction *action,
empathy_call_window_darken_preview_rectangles (self);
}
+static gboolean
+empathy_call_window_preview_enter_event_cb (ClutterActor *actor,
+ ClutterCrossingEvent *event,
+ EmpathyCallWindow *self)
+{
+ ClutterActor *rectangle;
+ PreviewPosition pos;
+
+ pos = empathy_call_window_get_preview_position (self, event->x, event->y);
+ rectangle = empathy_call_window_get_preview_rectangle (self, pos);
+
+ empathy_call_window_highlight_preview_rectangle (self, pos);
+
+ clutter_actor_show (rectangle);
+
+ return FALSE;
+}
+
+static gboolean
+empathy_call_window_preview_leave_event_cb (ClutterActor *actor,
+ ClutterCrossingEvent *event,
+ EmpathyCallWindow *self)
+{
+ ClutterActor *rectangle;
+ PreviewPosition pos;
+
+ pos = empathy_call_window_get_preview_position (self, event->x, event->y);
+ rectangle = empathy_call_window_get_preview_rectangle (self, pos);
+
+ empathy_call_window_darken_preview_rectangle (self, rectangle);
+
+ clutter_actor_hide (rectangle);
+
+ return FALSE;
+}
+
static void
create_video_preview (EmpathyCallWindow *self)
{
@@ -894,6 +930,11 @@ create_video_preview (EmpathyCallWindow *self)
g_signal_connect (action, "drag-motion",
G_CALLBACK (empathy_call_window_preview_on_drag_motion_cb), self);
+ g_signal_connect (preview, "enter-event",
+ G_CALLBACK (empathy_call_window_preview_enter_event_cb), self);
+ g_signal_connect (preview, "leave-event",
+ G_CALLBACK (empathy_call_window_preview_leave_event_cb), self);
+
clutter_actor_add_action (preview, action);
clutter_actor_set_reactive (preview, TRUE);
}