diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 18:01:37 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 18:01:37 +0000 |
commit | fbfb59c226042af7d007d099a7245df7d628057d (patch) | |
tree | 3cc487148f0de70c50476bf133712a5879bfa82f /chrome/browser/gtk | |
parent | 6433656227271d97db7bb2a6cbf1585323cc25e9 (diff) | |
download | chromium_src-fbfb59c226042af7d007d099a7245df7d628057d.zip chromium_src-fbfb59c226042af7d007d099a7245df7d628057d.tar.gz chromium_src-fbfb59c226042af7d007d099a7245df7d628057d.tar.bz2 |
[GTK] fix alignment of an extension install UI string in RTL locales.
BUG=52857
TEST=test extension install with RTL locale in ubuntu 9.04+
Review URL: http://codereview.chromium.org/3240003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/extension_install_prompt2_gtk.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/browser/gtk/extension_install_prompt2_gtk.cc b/chrome/browser/gtk/extension_install_prompt2_gtk.cc index 88d16b3..1ab571a 100644 --- a/chrome/browser/gtk/extension_install_prompt2_gtk.cc +++ b/chrome/browser/gtk/extension_install_prompt2_gtk.cc @@ -21,7 +21,7 @@ class Profile; namespace { -const int kRightColumnWidth = 290; +const int kRightColumnMinWidth = 290; const int kImageSize = 69; @@ -113,10 +113,19 @@ void ShowInstallPromptDialog2(GtkWindow* parent, SkBitmap* skia_icon, GtkWidget* warning_label = gtk_label_new(l10n_util::GetStringUTF8( label).c_str()); gtk_label_set_line_wrap(GTK_LABEL(warning_label), TRUE); - gtk_widget_set_size_request(warning_label, kRightColumnWidth, -1); gtk_misc_set_alignment(GTK_MISC(warning_label), 0.0, 0.5); - gtk_box_pack_start(GTK_BOX(right_column_area), warning_label, - FALSE, FALSE, 0); + + // We set the size request for the right column width here so that it will + // be overridden by the title if the title is long. We use the bin because + // if we set a size request on the label itself, GTK+ uses that when + // justifying the label. Older versions of GTK+ use the label's allocation, + // but newer versions use the size request. This can lead to alignment + // problems in RTL locales. See http://crbug.com/52857 + GtkWidget* bin = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(bin), warning_label); + gtk_widget_set_size_request(bin, kRightColumnMinWidth, -1); + + gtk_box_pack_start(GTK_BOX(right_column_area), bin, FALSE, FALSE, 0); GtkWidget* frame = gtk_frame_new(NULL); gtk_box_pack_start(GTK_BOX(right_column_area), frame, FALSE, FALSE, 0); |