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)
|
if (data->dialog_title)
|
||||||
gtk_window_set_title (GTK_WINDOW (dialog), 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_buffer = gtk_text_buffer_new (NULL);
|
||||||
text_view = gtk_builder_get_object (builder, "zenity_text_view");
|
text_view = gtk_builder_get_object (builder, "zenity_text_view");
|
||||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), text_buffer);
|
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",
|
dialog = gtk_file_chooser_native_new ("Save File",
|
||||||
parent_window,
|
parent_window,
|
||||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||||
"Cancel",
|
"Save",
|
||||||
"Save");
|
"Cancel");
|
||||||
chooser = GTK_FILE_CHOOSER (dialog);
|
chooser = GTK_FILE_CHOOSER (dialog);
|
||||||
|
|
||||||
filter = gtk_file_filter_new ();
|
filter = gtk_file_filter_new ();
|
||||||
@ -272,6 +270,7 @@ zenity_save (GtkWidget *widget, GtkWindow *parent_window) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data) {
|
zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data) {
|
||||||
|
gboolean should_exit = TRUE;
|
||||||
ZenityData *zen_data = data;
|
ZenityData *zen_data = data;
|
||||||
|
|
||||||
switch (response) {
|
switch (response) {
|
||||||
@ -285,6 +284,7 @@ zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data) {
|
|||||||
|
|
||||||
case ZENITY_SAVE_BUTTON:
|
case ZENITY_SAVE_BUTTON:
|
||||||
zenity_save (widget, GTK_WINDOW (gtk_widget_get_toplevel (widget)));
|
zenity_save (widget, GTK_WINDOW (gtk_widget_get_toplevel (widget)));
|
||||||
|
should_exit = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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);
|
zenity_util_exit_code_with_data (ZENITY_ESC, zen_data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gtk_main_quit ();
|
if (should_exit) {
|
||||||
|
gtk_main_quit ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="can_default">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>
|
<property name="image_position">right</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@ -257,11 +257,9 @@
|
|||||||
<property name="label">OK</property>
|
<property name="label">OK</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="has_focus">True</property>
|
|
||||||
<property name="can_default">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>
|
<property name="image_position">right</property>
|
||||||
<accelerator key="Return" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
Reference in New Issue
Block a user