aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars@uebernic.de>2015-03-19 16:23:58 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-03-19 16:23:58 +0000
commit4c578ba7252bda69f944233635343590b8c605f6 (patch)
tree6ba6b5130c71db0ef48090711f18535704a4ae53
parentfced82c1974545a30cb406fabbf8951734641ec3 (diff)
parent3bef6a1972f8c09b954b9733d79dde42dd86650b (diff)
downloadayatana-ido-4c578ba7252bda69f944233635343590b8c605f6.tar.gz
ayatana-ido-4c578ba7252bda69f944233635343590b8c605f6.tar.bz2
ayatana-ido-4c578ba7252bda69f944233635343590b8c605f6.zip
idoscalemenuitem: fix scale hover state
Approved by: Sebastien Bacher, PS Jenkins bot, Simon Steinbeiß
-rw-r--r--src/idoscalemenuitem.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c
index 9898b63..de9884f 100644
--- a/src/idoscalemenuitem.c
+++ b/src/idoscalemenuitem.c
@@ -472,6 +472,7 @@ ido_scale_menu_item_select (GtkMenuItem *item)
IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);
priv->has_focus = TRUE;
+ gtk_widget_set_state_flags (priv->scale, GTK_STATE_FLAG_FOCUSED, FALSE);
GTK_MENU_ITEM_CLASS (ido_scale_menu_item_parent_class)->select (item);
}
@@ -482,6 +483,7 @@ ido_scale_menu_item_deselect (GtkMenuItem *item)
IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);
priv->has_focus = FALSE;
+ gtk_widget_unset_state_flags (priv->scale, GTK_STATE_FLAG_FOCUSED);
GTK_MENU_ITEM_CLASS (ido_scale_menu_item_parent_class)->deselect (item);
}
@@ -574,6 +576,15 @@ ido_scale_menu_item_motion_notify_event (GtkWidget *menuitem,
gtk_widget_get_allocation (priv->scale, &alloc);
gtk_widget_translate_coordinates (menuitem, priv->scale, event->x, event->y, &x, &y);
+ /* don't translate coordinates when the scale has the "grab" -
+ * GtkRange expects coords relative to its event window in that case
+ */
+ if (!priv->grabbed)
+ {
+ event->x = x;
+ event->y = y;
+ }
+
if (priv->grabbed ||
(x > 0 && x < alloc.width && y > 0 && y < alloc.height))
gtk_widget_event (priv->scale, (GdkEvent *) event);