Merge lp:~kalikiana/midori/dodge into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: André Stösel
Approved revision: 6396
Merged at revision: 6402
Proposed branch: lp:~kalikiana/midori/dodge
Merge into: lp:midori
Diff against target: 35 lines (+18/-0)
1 file modified
midori/midori-view.c (+18/-0)
To merge this branch: bzr merge lp:~kalikiana/midori/dodge
Reviewer Review Type Date Requested Status
André Stösel Approve
Review via email: mp+185645@code.launchpad.net

Commit message

Flip horizontal position of the overlay when hit by the mouse

Description of the change

This change makes the overlay label flip the side if the mouse hits it, easy and effective.

Note that depending on the situation the overlay label may hide after flipping until hitting the next link. It looks a bit glitchy but the underlying stuff can be read, so I think it's a fairly small concern compared to without the flipping.

To post a comment you must log in.
Revision history for this message
André Stösel (ivaldi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-view.c'
2--- midori/midori-view.c 2013-09-08 17:20:49 +0000
3+++ midori/midori-view.c 2013-09-14 16:09:48 +0000
4@@ -1520,6 +1520,20 @@
5 }
6 #endif
7
8+#if GTK_CHECK_VERSION(3, 2, 0)
9+static gboolean
10+midori_view_overlay_frame_enter_notify_event_cb (GtkOverlay* overlay,
11+ GdkEventCrossing* event,
12+ GtkWidget* frame)
13+{
14+ /* Flip horizontal position of the overlay frame */
15+ gtk_widget_set_halign (frame,
16+ gtk_widget_get_halign (frame) == GTK_ALIGN_START
17+ ? GTK_ALIGN_END : GTK_ALIGN_START);
18+ return FALSE;
19+}
20+#endif
21+
22 static gboolean
23 midori_view_web_view_leave_notify_event_cb (WebKitWebView* web_view,
24 GdkEventCrossing* event,
25@@ -3597,6 +3611,10 @@
26 gtk_widget_set_halign (frame, GTK_ALIGN_START);
27 gtk_widget_set_valign (frame, GTK_ALIGN_END);
28 gtk_overlay_add_overlay (GTK_OVERLAY (view->overlay), frame);
29+ /* Enable enter-notify-event signals */
30+ gtk_widget_add_events (view->overlay, GDK_ENTER_NOTIFY_MASK);
31+ g_signal_connect (view->overlay, "enter-notify-event",
32+ G_CALLBACK (midori_view_overlay_frame_enter_notify_event_cb), frame);
33 }
34 view->overlay_find = g_object_new (MIDORI_TYPE_FINDBAR, NULL);
35 gtk_widget_set_halign (view->overlay_find, GTK_ALIGN_END);

Subscribers

People subscribed via source and target branches

to all changes: