From b43bbda2e247e72782cf116003d308d21346935f Mon Sep 17 00:00:00 2001 From: Glynn Foster Date: Fri, 19 Mar 2004 02:28:30 +0000 Subject: Patch from Darren Adams to make sure the new 2004-03-19 Glynn Foster * src/calendar.c, src/entry.c, src/fileselection.c, src/msg.c, src/progress.c, src/text.c, src/tree.c: Patch from Darren Adams to make sure the new file chooser resizes nicely. Sanitize the default setting of the other widgets. * configure.in, src/util.c: Lose gconf dependancy since we don't currently use it, although arguably we should to detect which help browser we're supposed to run :/ * THANKS, src/about.c: Add Darren to the list. --- src/about.c | 1 + src/calendar.c | 3 ++- src/entry.c | 3 ++- src/fileselection.c | 3 +-- src/msg.c | 5 +++-- src/progress.c | 3 ++- src/text.c | 6 +++++- src/tree.c | 3 ++- src/util.c | 1 - 9 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/about.c b/src/about.c index 24349155..46dcd255 100644 --- a/src/about.c +++ b/src/about.c @@ -53,6 +53,7 @@ static const gchar *author_credits[] = { "", "Patches from the following people", "=================================", + "Darren Adams ", "Peter Astrand ", "Jonathan Blandford ", "Ross Burton ", diff --git a/src/calendar.c b/src/calendar.c index 36b3fe4d..f5cbb33c 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -63,7 +63,8 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) else zenity_util_set_window_icon (dialog, ZENITY_IMAGE_FULLPATH ("zenity-calendar.png")); - gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); + if (data->width > -1 || data->height > -1) + gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); text = glade_xml_get_widget (glade_dialog, "zenity_calendar_text"); diff --git a/src/entry.c b/src/entry.c index c2570e0a..bf1811bd 100644 --- a/src/entry.c +++ b/src/entry.c @@ -59,7 +59,8 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data) else zenity_util_set_window_icon (dialog, ZENITY_IMAGE_FULLPATH ("zenity-entry.png")); - gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); + if (data->width > -1 || data->height > -1) + gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); text = glade_xml_get_widget (glade_dialog, "zenity_entry_text"); diff --git a/src/fileselection.c b/src/fileselection.c index 955226d1..6a9b018c 100644 --- a/src/fileselection.c +++ b/src/fileselection.c @@ -54,8 +54,6 @@ void zenity_fileselection (ZenityData *data, ZenityFileData *file_data) else zenity_util_set_window_icon (dialog, ZENITY_IMAGE_FULLPATH ("zenity-file.png")); - gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); - if (file_data->uri) { dir = g_path_get_dirname (file_data->uri); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), dir); @@ -107,6 +105,7 @@ zenity_fileselection_dialog_response (GtkWidget *widget, int response, gpointer default: /* Esc dialog */ zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC); + gtk_main_quit (); break; } } diff --git a/src/msg.c b/src/msg.c index 2b4083b5..bd1450e0 100644 --- a/src/msg.c +++ b/src/msg.c @@ -107,8 +107,9 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data) break; } } - - gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); + + if (data->width > -1 || data->height > -1) + gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); if (msg_data->dialog_text) gtk_label_set_text (GTK_LABEL (text), msg_data->dialog_text); diff --git a/src/progress.c b/src/progress.c index c7ab5cf1..68c653d7 100644 --- a/src/progress.c +++ b/src/progress.c @@ -196,7 +196,8 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data) else zenity_util_set_window_icon (dialog, ZENITY_IMAGE_FULLPATH ("zenity-progress.png")); - gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); + if (data->width > -1 || data->height > -1) + gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); text = glade_xml_get_widget (glade_dialog, "zenity_progress_text"); gtk_label_set_text (GTK_LABEL (text), progress_data->dialog_text); diff --git a/src/text.c b/src/text.c index c4a49f8b..fb119b05 100644 --- a/src/text.c +++ b/src/text.c @@ -133,7 +133,6 @@ zenity_text (ZenityData *data, ZenityTextData *text_data) else zenity_util_set_window_icon (dialog, ZENITY_IMAGE_FULLPATH ("zenity-text.png")); - gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); text_buffer = gtk_text_buffer_new (NULL); @@ -149,6 +148,11 @@ zenity_text (ZenityData *data, ZenityTextData *text_data) if (text_data->editable) zen_text_data->buffer = text_buffer; + if (data->width > -1 || data->height > -1) + gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); + else + gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 400); + gtk_widget_show (dialog); if (glade_dialog) diff --git a/src/tree.c b/src/tree.c index aaf513c6..03404b04 100644 --- a/src/tree.c +++ b/src/tree.c @@ -308,7 +308,8 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) else zenity_util_set_window_icon (dialog, ZENITY_IMAGE_FULLPATH ("zenity-list.png")); - gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); + if (data->width > -1 || data->height > -1) + gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); tree_view = glade_xml_get_widget (glade_dialog, "zenity_tree_view"); diff --git a/src/util.c b/src/util.c index c2b8e798..c521f173 100644 --- a/src/util.c +++ b/src/util.c @@ -34,7 +34,6 @@ #include "config.h" #include "util.h" #include "zenity.h" -#include #define ZENITY_OK_DEFAULT 0 #define ZENITY_CANCEL_DEFAULT 1 -- cgit