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

Proposed by Lars Karlitski on 2015-03-09
Status: Merged
Approved by: Sebastien Bacher on 2015-03-19
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 on 2015-03-18
Sebastien Bacher 2015-03-09 Approve on 2015-03-18
PS Jenkins bot (community) continuous-integration Approve on 2015-03-10
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.
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
191. By Lars Karlitski on 2015-03-10

idoscalemenuitem: translate motion event coordinates

Fixes hover theming.

192. By Lars Karlitski on 2015-03-10

idoscalemenuitem: set focus flag on scale

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

PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Sebastien Bacher (seb128) wrote :

looks good to me

review: Approve
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
=== modified file 'src/idoscalemenuitem.c'
--- src/idoscalemenuitem.c 2015-01-21 18:21:23 +0000
+++ src/idoscalemenuitem.c 2015-03-10 11:39:15 +0000
@@ -472,6 +472,7 @@
472 IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);472 IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);
473473
474 priv->has_focus = TRUE;474 priv->has_focus = TRUE;
475 gtk_widget_set_state_flags (priv->scale, GTK_STATE_FLAG_FOCUSED, FALSE);
475476
476 GTK_MENU_ITEM_CLASS (ido_scale_menu_item_parent_class)->select (item);477 GTK_MENU_ITEM_CLASS (ido_scale_menu_item_parent_class)->select (item);
477}478}
@@ -482,6 +483,7 @@
482 IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);483 IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);
483484
484 priv->has_focus = FALSE;485 priv->has_focus = FALSE;
486 gtk_widget_unset_state_flags (priv->scale, GTK_STATE_FLAG_FOCUSED);
485487
486 GTK_MENU_ITEM_CLASS (ido_scale_menu_item_parent_class)->deselect (item);488 GTK_MENU_ITEM_CLASS (ido_scale_menu_item_parent_class)->deselect (item);
487}489}
@@ -574,6 +576,15 @@
574 gtk_widget_get_allocation (priv->scale, &alloc);576 gtk_widget_get_allocation (priv->scale, &alloc);
575 gtk_widget_translate_coordinates (menuitem, priv->scale, event->x, event->y, &x, &y);577 gtk_widget_translate_coordinates (menuitem, priv->scale, event->x, event->y, &x, &y);
576578
579 /* don't translate coordinates when the scale has the "grab" -
580 * GtkRange expects coords relative to its event window in that case
581 */
582 if (!priv->grabbed)
583 {
584 event->x = x;
585 event->y = y;
586 }
587
577 if (priv->grabbed ||588 if (priv->grabbed ||
578 (x > 0 && x < alloc.width && y > 0 && y < alloc.height))589 (x > 0 && x < alloc.width && y > 0 && y < alloc.height))
579 gtk_widget_event (priv->scale, (GdkEvent *) event);590 gtk_widget_event (priv->scale, (GdkEvent *) event);

Subscribers

People subscribed via source and target branches