diff options
-rw-r--r-- | src/idoentrymenuitem.c | 24 | ||||
-rw-r--r-- | src/idoscalemenuitem.c | 6 |
2 files changed, 24 insertions, 6 deletions
diff --git a/src/idoentrymenuitem.c b/src/idoentrymenuitem.c index ff90544..8cac5b6 100644 --- a/src/idoentrymenuitem.c +++ b/src/idoentrymenuitem.c @@ -120,6 +120,24 @@ ido_entry_menu_item_button_release (GtkWidget *widget, } static gboolean +is_key_press_valid (IdoEntryMenuItem *item, + gint key) +{ + switch (key) + { + case GDK_Escape: + case GDK_Up: + case GDK_Down: + case GDK_KP_Up: + case GDK_KP_Down: + return FALSE; + + default: + return TRUE; + } +} + +static gboolean ido_entry_menu_item_key_press (GtkWidget *widget, GdkEventKey *event, gpointer data) @@ -127,7 +145,7 @@ ido_entry_menu_item_key_press (GtkWidget *widget, IdoEntryMenuItem *menuitem = (IdoEntryMenuItem *)data; if (menuitem->priv->selected && - event->keyval != GDK_Escape) + is_key_press_valid (menuitem, event->keyval)) { gtk_widget_event (menuitem->priv->entry, ((GdkEvent *)(void*)(event))); @@ -140,7 +158,7 @@ ido_entry_menu_item_key_press (GtkWidget *widget, static void ido_entry_menu_item_send_focus_change (GtkWidget *widget, - gboolean in) + gboolean in) { GdkEvent *event = gdk_event_new (GDK_FOCUS_CHANGE); @@ -182,7 +200,7 @@ ido_entry_menu_item_button_press (GtkWidget *widget, gdk_window_raise (entry->window); } - if (!GTK_WIDGET_HAS_FOCUS (entry)) + if (!gtk_widget_has_focus (entry)) { gtk_widget_grab_focus (entry); } diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c index 7d16ec9..dc57479 100644 --- a/src/idoscalemenuitem.c +++ b/src/idoscalemenuitem.c @@ -135,8 +135,8 @@ ido_scale_menu_item_size_allocate (GtkWidget *widget, "horizontal-padding", &horizontal_padding, NULL); - primary_padding = GTK_WIDGET_VISIBLE (priv->primary_image) ? primary_image_req.width : 0; - secondary_padding = GTK_WIDGET_VISIBLE (priv->secondary_image) ? secondary_image_req.width : 0; + primary_padding = gtk_widget_get_visible (priv->primary_image) ? primary_image_req.width : 0; + secondary_padding = gtk_widget_get_visible (priv->secondary_image) ? secondary_image_req.width : 0; priv->left_padding = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ? primary_padding : secondary_padding; @@ -297,7 +297,7 @@ ido_scale_menu_item_expose (GtkWidget *widget, { IdoScaleMenuItemPrivate *priv = GET_PRIVATE (widget); - if (GTK_WIDGET_DRAWABLE (widget)) + if (gtk_widget_is_drawable (widget)) { GdkPixbuf *pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (priv->offscreen)); |