Focus Changes
This commit is contained in:
parent
54157ced4c
commit
435bc154ef
12
src/text.c
12
src/text.c
@ -153,8 +153,6 @@ zenity_text (ZenityData *data, ZenityTextData *text_data) {
|
||||
if (data->dialog_title)
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title);
|
||||
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
|
||||
|
||||
text_buffer = gtk_text_buffer_new (NULL);
|
||||
text_view = gtk_builder_get_object (builder, "zenity_text_view");
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), text_buffer);
|
||||
@ -230,8 +228,8 @@ zenity_save (GtkWidget *widget, GtkWindow *parent_window) {
|
||||
dialog = gtk_file_chooser_native_new ("Save File",
|
||||
parent_window,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
"Cancel",
|
||||
"Save");
|
||||
"Save",
|
||||
"Cancel");
|
||||
chooser = GTK_FILE_CHOOSER (dialog);
|
||||
|
||||
filter = gtk_file_filter_new ();
|
||||
@ -272,6 +270,7 @@ zenity_save (GtkWidget *widget, GtkWindow *parent_window) {
|
||||
|
||||
static void
|
||||
zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data) {
|
||||
gboolean should_exit = TRUE;
|
||||
ZenityData *zen_data = data;
|
||||
|
||||
switch (response) {
|
||||
@ -285,6 +284,7 @@ zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data) {
|
||||
|
||||
case ZENITY_SAVE_BUTTON:
|
||||
zenity_save (widget, GTK_WINDOW (gtk_widget_get_toplevel (widget)));
|
||||
should_exit = FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -296,5 +296,7 @@ zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data) {
|
||||
zenity_util_exit_code_with_data (ZENITY_ESC, zen_data);
|
||||
break;
|
||||
}
|
||||
gtk_main_quit ();
|
||||
if (should_exit) {
|
||||
gtk_main_quit ();
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +243,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="image_position">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
@ -257,11 +257,9 @@
|
||||
<property name="label">OK</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="image_position">right</property>
|
||||
<accelerator key="Return" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
Reference in New Issue
Block a user