diff options
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/bookmark_manager_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/gtk/first_run_dialog.cc | 7 | ||||
-rw-r--r-- | chrome/browser/gtk/import_dialog_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/gtk/keyword_editor_view.cc | 11 | ||||
-rw-r--r-- | chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc | 11 | ||||
-rw-r--r-- | chrome/browser/gtk/options/url_picker_dialog_gtk.cc | 13 |
8 files changed, 32 insertions, 39 deletions
diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc index a7e5ee7..11100af 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.cc +++ b/chrome/browser/gtk/bookmark_manager_gtk.cc @@ -607,13 +607,11 @@ void BookmarkManagerGtk::SetInitialWindowSize() { // Otherwise, just set a default size (GTK will override this if it's not // large enough to hold the window's contents). gtk_widget_realize(window_); - int width = 1, height = 1; - gtk_util::GetWidgetSizeFromResources( - window_, + gtk_util::SetWindowSizeFromResources( + GTK_WINDOW(window_), IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS, IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES, - &width, &height); - gtk_window_set_default_size(GTK_WINDOW(window_), width, height); + true); } void BookmarkManagerGtk::ResetOrganizeMenu(bool left) { diff --git a/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc b/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc index 6259923..2064241 100644 --- a/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc +++ b/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc @@ -31,9 +31,10 @@ ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, GTK_RESPONSE_REJECT, NULL); gtk_widget_realize(dialog); - gtk_util::SetWindowWidthFromResources(GTK_WINDOW(dialog), - IDS_CLEARDATA_DIALOG_WIDTH_CHARS, - /* resizable */ false); + gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog), + IDS_CLEARDATA_DIALOG_WIDTH_CHARS, + -1, // height + false); // resizable gtk_util::AddButtonToDialog(dialog, l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_COMMIT).c_str(), GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc index 61105d3..1907fba 100644 --- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc @@ -35,9 +35,10 @@ CreateApplicationShortcutsDialogGtk::CreateApplicationShortcutsDialogGtk( GTK_RESPONSE_REJECT, NULL); gtk_widget_realize(dialog); - gtk_util::SetWindowWidthFromResources(GTK_WINDOW(dialog), - IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS, - /* resizable */ false); + gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog), + IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS, + -1, // height + false); // resizable gtk_util::AddButtonToDialog(dialog, l10n_util::GetStringUTF8(IDS_CREATE_SHORTCUTS_COMMIT).c_str(), GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); diff --git a/chrome/browser/gtk/first_run_dialog.cc b/chrome/browser/gtk/first_run_dialog.cc index 6f3fc68..6bbb630 100644 --- a/chrome/browser/gtk/first_run_dialog.cc +++ b/chrome/browser/gtk/first_run_dialog.cc @@ -63,12 +63,11 @@ FirstRunDialog::FirstRunDialog(Profile* profile, int& response) gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); gtk_widget_realize(dialog_); - int width, height; - gtk_util::GetWidgetSizeFromResources(dialog_, + gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_), IDS_FIRSTRUN_DIALOG_WIDTH_CHARS, IDS_FIRSTRUN_DIALOG_HEIGHT_LINES, - &width, &height); - gtk_window_set_default_size(GTK_WINDOW(dialog_), width, height); + true); + g_signal_connect(G_OBJECT(dialog_), "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); diff --git a/chrome/browser/gtk/import_dialog_gtk.cc b/chrome/browser/gtk/import_dialog_gtk.cc index 443d453..877e07c 100644 --- a/chrome/browser/gtk/import_dialog_gtk.cc +++ b/chrome/browser/gtk/import_dialog_gtk.cc @@ -37,9 +37,10 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile) GTK_RESPONSE_REJECT, NULL); gtk_widget_realize(dialog_); - gtk_util::SetWindowWidthFromResources(GTK_WINDOW(dialog_), - IDS_IMPORT_DIALOG_WIDTH_CHARS, - /* resizable */ false); + gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_), + IDS_IMPORT_DIALOG_WIDTH_CHARS, + -1, // height + false); // resizable importer_host_->set_parent_window(GTK_WINDOW(dialog_)); // Add import button separately as we might need to disable it, if diff --git a/chrome/browser/gtk/keyword_editor_view.cc b/chrome/browser/gtk/keyword_editor_view.cc index 7ed31ed..541782b 100644 --- a/chrome/browser/gtk/keyword_editor_view.cc +++ b/chrome/browser/gtk/keyword_editor_view.cc @@ -190,13 +190,10 @@ void KeywordEditorView::Init() { // Set the size of the dialog. gtk_widget_realize(dialog_); - int width = 1, height = 1; - gtk_util::GetWidgetSizeFromResources( - dialog_, - IDS_SEARCHENGINES_DIALOG_WIDTH_CHARS, - IDS_SEARCHENGINES_DIALOG_HEIGHT_LINES, - &width, &height); - gtk_window_set_default_size(GTK_WINDOW(dialog_), width, height); + gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_), + IDS_SEARCHENGINES_DIALOG_WIDTH_CHARS, + IDS_SEARCHENGINES_DIALOG_HEIGHT_LINES, + true); g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this); diff --git a/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc b/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc index 811ceaa..4f5be8f 100644 --- a/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc +++ b/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc @@ -91,13 +91,10 @@ PasswordsExceptionsWindowGtk::PasswordsExceptionsWindowGtk(Profile* profile) gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_); gtk_widget_realize(dialog_); - int width = 1, height = 1; - gtk_util::GetWidgetSizeFromResources( - dialog_, - IDS_PASSWORDS_DIALOG_WIDTH_CHARS, - IDS_PASSWORDS_DIALOG_HEIGHT_LINES, - &width, &height); - gtk_window_set_default_size(GTK_WINDOW(dialog_), width, height); + gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_), + IDS_PASSWORDS_DIALOG_WIDTH_CHARS, + IDS_PASSWORDS_DIALOG_HEIGHT_LINES, + true); // We only have one button and don't do any special handling, so just hook it // directly to gtk_widget_destroy. diff --git a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc index f7198b4..de472f8 100644 --- a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc +++ b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc @@ -152,14 +152,13 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback, // Set the size of the dialog. gtk_widget_realize(dialog_); - int width = 1, height = 1; - gtk_util::GetWidgetSizeFromResources( - dialog_, - IDS_URLPICKER_DIALOG_WIDTH_CHARS, - IDS_URLPICKER_DIALOG_HEIGHT_LINES, - &width, &height); - gtk_window_set_default_size(GTK_WINDOW(dialog_), width, height); + gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_), + IDS_URLPICKER_DIALOG_WIDTH_CHARS, + IDS_URLPICKER_DIALOG_HEIGHT_LINES, + true); + // Set the width of the first column as well. + int width; gtk_util::GetWidgetSizeFromResources( dialog_, IDS_URLPICKER_DIALOG_LEFT_COLUMN_WIDTH_CHARS, 0, |