Commit af83a021 authored by Paolo Borelli's avatar Paolo Borelli

always focus the search entry when hitting ctrl+F

parent 539a1ca1
2006-03-05 Jesse van den Kieboom <jesse@icecrew.nl>
* gedit/dialogs/gedit-search-dialog.c: grab focus on the entry.
2006-03-05 Steve Frécinaux <steve@istique.net>
* plugins/snippets/snippets/SnippetsDialog.py:
......
......@@ -111,14 +111,32 @@ gedit_search_dialog_get_property (GObject *object,
}
}
static gboolean
gedit_search_dialog_focus_in_event (GtkWidget *widget,
GdkEventFocus *event)
{
GeditSearchDialog *dlg = GEDIT_SEARCH_DIALOG (widget);
GtkWidget *entry = dlg->priv->search_entry;
if (!GTK_WIDGET_HAS_FOCUS (entry))
{
gtk_widget_grab_focus (entry);
gtk_editable_set_position (GTK_EDITABLE (entry), -1);
}
return GTK_WIDGET_CLASS (gedit_search_dialog_parent_class)->focus_in_event (widget, event);
}
static void
gedit_search_dialog_class_init (GeditSearchDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->set_property = gedit_search_dialog_set_property;
object_class->get_property = gedit_search_dialog_get_property;
widget_class->focus_in_event = gedit_search_dialog_focus_in_event;
g_object_class_install_property (object_class, PROP_SHOW_REPLACE,
g_param_spec_boolean ("show-replace",
"Show Replace",
......
......@@ -80,9 +80,8 @@ dialog_response_handler (GtkDialog *dlg,
gint res_id,
GeditSpellLanguageDialog *dialog)
{
GError *error = NULL;
switch (res_id) {
switch (res_id)
{
case GTK_RESPONSE_OK:
ok_button_pressed (dialog);
gtk_widget_destroy (dialog->dialog);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment