forked from AuroraMiddleware/gtk
entry completion: Drop initial selection avoidance
This is a minor thing, and it is hard to recreate with event controllers, so drop it for now.
This commit is contained in:
parent
a2a80f8a15
commit
9ceafd7c38
@ -153,12 +153,6 @@ static gboolean gtk_entry_completion_action_button_press (GtkWidget *wi
|
||||
gpointer user_data);
|
||||
static void gtk_entry_completion_selection_changed (GtkTreeSelection *selection,
|
||||
gpointer data);
|
||||
static gboolean gtk_entry_completion_list_enter_notify (GtkWidget *widget,
|
||||
GdkEventCrossing *event,
|
||||
gpointer data);
|
||||
static gboolean gtk_entry_completion_list_motion_notify (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
gpointer data);
|
||||
static void gtk_entry_completion_insert_action (GtkEntryCompletion *completion,
|
||||
gint index,
|
||||
const gchar *string,
|
||||
@ -542,12 +536,6 @@ gtk_entry_completion_constructed (GObject *object)
|
||||
g_signal_connect (priv->tree_view, "button-press-event",
|
||||
G_CALLBACK (gtk_entry_completion_list_button_press),
|
||||
completion);
|
||||
g_signal_connect (priv->tree_view, "enter-notify-event",
|
||||
G_CALLBACK (gtk_entry_completion_list_enter_notify),
|
||||
completion);
|
||||
g_signal_connect (priv->tree_view, "motion-notify-event",
|
||||
G_CALLBACK (gtk_entry_completion_list_motion_notify),
|
||||
completion);
|
||||
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->tree_view), FALSE);
|
||||
gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (priv->tree_view), TRUE);
|
||||
@ -583,12 +571,6 @@ gtk_entry_completion_constructed (GObject *object)
|
||||
g_signal_connect (priv->action_view, "button-press-event",
|
||||
G_CALLBACK (gtk_entry_completion_action_button_press),
|
||||
completion);
|
||||
g_signal_connect (priv->action_view, "enter-notify-event",
|
||||
G_CALLBACK (gtk_entry_completion_list_enter_notify),
|
||||
completion);
|
||||
g_signal_connect (priv->action_view, "motion-notify-event",
|
||||
G_CALLBACK (gtk_entry_completion_list_motion_notify),
|
||||
completion);
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->action_view), FALSE);
|
||||
gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (priv->action_view), TRUE);
|
||||
|
||||
@ -1467,29 +1449,6 @@ gtk_entry_completion_get_text_column (GtkEntryCompletion *completion)
|
||||
|
||||
/* private */
|
||||
|
||||
static gboolean
|
||||
gtk_entry_completion_list_enter_notify (GtkWidget *widget,
|
||||
GdkEventCrossing *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
|
||||
|
||||
return completion->priv->ignore_enter;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_entry_completion_list_motion_notify (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
|
||||
|
||||
completion->priv->ignore_enter = FALSE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* some nasty size requisition */
|
||||
void
|
||||
_gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
|
||||
@ -1637,8 +1596,6 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion)
|
||||
if (completion->priv->has_grab)
|
||||
return;
|
||||
|
||||
completion->priv->ignore_enter = TRUE;
|
||||
|
||||
gtk_widget_show (completion->priv->vbox);
|
||||
|
||||
/* default on no match */
|
||||
@ -1677,8 +1634,6 @@ _gtk_entry_completion_popdown (GtkEntryCompletion *completion)
|
||||
if (!gtk_widget_get_mapped (completion->priv->popup_window))
|
||||
return;
|
||||
|
||||
completion->priv->ignore_enter = FALSE;
|
||||
|
||||
if (completion->priv->has_grab)
|
||||
{
|
||||
gdk_seat_ungrab (gdk_device_get_seat (completion->priv->device));
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <gtk/gtkentrycompletion.h>
|
||||
#include <gtk/gtkentry.h>
|
||||
#include <gtk/gtkspinbutton.h>
|
||||
#include <gtk/gtkeventcontrollermotion.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -59,7 +60,6 @@ struct _GtkEntryCompletionPrivate
|
||||
gint current_selected;
|
||||
|
||||
guint first_sel_changed : 1;
|
||||
guint ignore_enter : 1;
|
||||
guint has_completion : 1;
|
||||
guint inline_completion : 1;
|
||||
guint popup_completion : 1;
|
||||
|
Loading…
Reference in New Issue
Block a user