entry: Remove _gtk_entry_grab_focus

We have API for both the select and !select behavior these days, so use
that one.

Fixes #1457
This commit is contained in:
Timm Bäder 2019-01-16 19:16:47 +01:00
parent 374e93ef96
commit 135cf16969
3 changed files with 6 additions and 19 deletions

View File

@ -4138,15 +4138,6 @@ gtk_entry_focus_out (GtkWidget *widget)
_gtk_entry_completion_popdown (completion);
}
void
_gtk_entry_grab_focus (GtkEntry *entry,
gboolean select_all)
{
GTK_WIDGET_CLASS (gtk_entry_parent_class)->grab_focus (GTK_WIDGET (entry));
if (select_all)
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
}
static void
gtk_entry_grab_focus (GtkWidget *widget)
{
@ -4154,6 +4145,8 @@ gtk_entry_grab_focus (GtkWidget *widget)
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
gboolean select_on_focus;
GTK_WIDGET_CLASS (gtk_entry_parent_class)->grab_focus (GTK_WIDGET (entry));
if (priv->editable && !priv->in_click)
{
g_object_get (gtk_widget_get_settings (widget),
@ -4161,11 +4154,8 @@ gtk_entry_grab_focus (GtkWidget *widget)
&select_on_focus,
NULL);
_gtk_entry_grab_focus (entry, select_on_focus);
}
else
{
_gtk_entry_grab_focus (entry, FALSE);
if (select_on_focus)
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
}
}
@ -4186,7 +4176,7 @@ gtk_entry_grab_focus_without_selecting (GtkEntry *entry)
{
g_return_if_fail (GTK_IS_ENTRY (entry));
_gtk_entry_grab_focus (entry, FALSE);
GTK_WIDGET_CLASS (gtk_entry_parent_class)->grab_focus (GTK_WIDGET (entry));
}
static void

View File

@ -88,9 +88,6 @@ gchar* _gtk_entry_get_display_text (GtkEntry *entry,
gint start_pos,
gint end_pos);
GtkIMContext* _gtk_entry_get_im_context (GtkEntry *entry);
void _gtk_entry_grab_focus (GtkEntry *entry,
gboolean select_all);
void gtk_entry_enter_text (GtkEntry *entry,
const char *text);
void gtk_entry_set_positions (GtkEntry *entry,

View File

@ -256,7 +256,7 @@ reveal_child_changed_cb (GObject *object,
if (priv->entry)
{
if (reveal_child)
_gtk_entry_grab_focus (GTK_ENTRY (priv->entry), FALSE);
gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->entry));
else
gtk_entry_set_text (GTK_ENTRY (priv->entry), "");
}