[gimp] Issue #5967: Inconvenient focus in PNG export.



commit 733986513a207285652840299c52f271300a3615
Author: Jehan <jehan girinstud io>
Date:   Thu Nov 26 01:57:53 2020 +0100

    Issue #5967: Inconvenient focus in PNG export.
    
    Make sure that the OK button ("Export", etc.) is always the default
    action in a GimpProcedureDialog. This allows to quickly validate the
    default settings.

 libgimp/gimpproceduredialog.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/libgimp/gimpproceduredialog.c b/libgimp/gimpproceduredialog.c
index 3b5c4166cd..20924295de 100644
--- a/libgimp/gimpproceduredialog.c
+++ b/libgimp/gimpproceduredialog.c
@@ -183,6 +183,12 @@ gimp_procedure_dialog_constructed (GObject *object)
   button = gimp_dialog_add_button (GIMP_DIALOG (dialog),
                                    ok_label, GTK_RESPONSE_OK);
   gimp_procedure_dialog_check_mnemonic (GIMP_PROCEDURE_DIALOG (dialog), button, NULL, "ok");
+  /* OK button is the default action and has focus from start.
+   * This allows to just accept quickly whatever default values.
+   */
+  gtk_widget_set_can_default (button, TRUE);
+  gtk_widget_grab_focus (button);
+  gtk_widget_grab_default (button);
 
   gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
                                             GTK_RESPONSE_OK,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]