summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/import_dialog_gtk.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-09 00:52:19 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-09 00:52:19 +0000
commit3a991672550ca9b6f4046ab1232caf8d48d14b23 (patch)
treed4e92a6c4dfaea27ff8c962daf4fa210bc40c148 /chrome/browser/gtk/import_dialog_gtk.cc
parent635437c0531761ca0cf7a9de06ba1c4b3bbb9c44 (diff)
downloadchromium_src-3a991672550ca9b6f4046ab1232caf8d48d14b23.zip
chromium_src-3a991672550ca9b6f4046ab1232caf8d48d14b23.tar.gz
chromium_src-3a991672550ca9b6f4046ab1232caf8d48d14b23.tar.bz2
linux: set a minimum size for dialogs based on locale resources
GTK dialogs size to their contents, but sometimes the title is the longest string available. BUG=28024 Review URL: http://codereview.chromium.org/534006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/import_dialog_gtk.cc')
-rw-r--r--chrome/browser/gtk/import_dialog_gtk.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/gtk/import_dialog_gtk.cc b/chrome/browser/gtk/import_dialog_gtk.cc
index 9acd79e..443d453 100644
--- a/chrome/browser/gtk/import_dialog_gtk.cc
+++ b/chrome/browser/gtk/import_dialog_gtk.cc
@@ -8,6 +8,7 @@
#include "app/resource_bundle.h"
#include "chrome/common/gtk_util.h"
#include "grit/generated_resources.h"
+#include "grit/locale_settings.h"
// static
void ImportDialogGtk::Show(GtkWindow* parent, Profile* profile) {
@@ -35,6 +36,10 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile)
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
NULL);
+ gtk_widget_realize(dialog_);
+ gtk_util::SetWindowWidthFromResources(GTK_WINDOW(dialog_),
+ IDS_IMPORT_DIALOG_WIDTH_CHARS,
+ /* resizable */ false);
importer_host_->set_parent_window(GTK_WINDOW(dialog_));
// Add import button separately as we might need to disable it, if
@@ -45,10 +50,6 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile)
GTK_WIDGET_SET_FLAGS(import_button, GTK_CAN_DEFAULT);
gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT);
- // TODO(rahulk): find how to set size properly so that the dialog
- // box width is at least enough to display full title.
- gtk_widget_set_size_request(dialog_, 300, -1);
-
GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox;
gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing);
@@ -114,7 +115,6 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile)
g_signal_connect(dialog_, "response",
G_CALLBACK(HandleOnResponseDialog), this);
- gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE);
gtk_widget_show_all(dialog_);
}