Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1746)

Unified Diff: chrome/browser/gtk/import_dialog_gtk.cc

Issue 534006: linux: set a minimum size for dialogs based on locale resources (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/gtk/import_dialog_gtk.cc
diff --git a/chrome/browser/gtk/import_dialog_gtk.cc b/chrome/browser/gtk/import_dialog_gtk.cc
index 9acd79e2afdb6ab76526580203d87cc71f3a07eb..443d4538587a951bf0ec5298ab0f671019363810 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_);
}

Powered by Google App Engine
This is Rietveld 408576698