Merge lp:~larsu/ido/prelight-and-focus-scale into lp:ido/15.04

Proposed by Lars Karlitski
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 192
Merged at revision: 191
Proposed branch: lp:~larsu/ido/prelight-and-focus-scale
Merge into: lp:ido/15.04
Diff against target: 35 lines (+11/-0)
1 file modified
src/idoscalemenuitem.c (+11/-0)
To merge this branch: bzr merge lp:~larsu/ido/prelight-and-focus-scale
Reviewer Review Type Date Requested Status
Simon Steinbeiß (community) Approve
Sebastien Bacher Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+252293@code.launchpad.net

Commit message

idoscalemenuitem: fix scale hover state

Description of the change

idoscalemenuitem: fix scale hover state

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
191. By Lars Karlitski

idoscalemenuitem: translate motion event coordinates

Fixes hover theming.

192. By Lars Karlitski

idoscalemenuitem: set focus flag on scale

So that it gets themed correctly when the menu item is selected.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

looks good to me

review: Approve
Revision history for this message
Simon Steinbeiß (ochosi) wrote :

The changes in the code make sense to me and I've just (successfully) tested the patch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/idoscalemenuitem.c'
2--- src/idoscalemenuitem.c 2015-01-21 18:21:23 +0000
3+++ src/idoscalemenuitem.c 2015-03-10 11:39:15 +0000
4@@ -472,6 +472,7 @@
5 IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);
6
7 priv->has_focus = TRUE;
8+ gtk_widget_set_state_flags (priv->scale, GTK_STATE_FLAG_FOCUSED, FALSE);
9
10 GTK_MENU_ITEM_CLASS (ido_scale_menu_item_parent_class)->select (item);
11 }
12@@ -482,6 +483,7 @@
13 IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);
14
15 priv->has_focus = FALSE;
16+ gtk_widget_unset_state_flags (priv->scale, GTK_STATE_FLAG_FOCUSED);
17
18 GTK_MENU_ITEM_CLASS (ido_scale_menu_item_parent_class)->deselect (item);
19 }
20@@ -574,6 +576,15 @@
21 gtk_widget_get_allocation (priv->scale, &alloc);
22 gtk_widget_translate_coordinates (menuitem, priv->scale, event->x, event->y, &x, &y);
23
24+ /* don't translate coordinates when the scale has the "grab" -
25+ * GtkRange expects coords relative to its event window in that case
26+ */
27+ if (!priv->grabbed)
28+ {
29+ event->x = x;
30+ event->y = y;
31+ }
32+
33 if (priv->grabbed ||
34 (x > 0 && x < alloc.width && y > 0 && y < alloc.height))
35 gtk_widget_event (priv->scale, (GdkEvent *) event);

Subscribers

People subscribed via source and target branches