diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 16:01:18 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 16:01:18 +0000 |
commit | 85da56ff2ecbb7806a1de8edcc2c76a9461b378d (patch) | |
tree | 455d2439603018d23a7c0fcf07e402df766e2232 /chrome/browser/gtk | |
parent | bcf91677b8549061a9d2cf089dc1612d5de797c7 (diff) | |
download | chromium_src-85da56ff2ecbb7806a1de8edcc2c76a9461b378d.zip chromium_src-85da56ff2ecbb7806a1de8edcc2c76a9461b378d.tar.gz chromium_src-85da56ff2ecbb7806a1de8edcc2c76a9461b378d.tar.bz2 |
[GTK] Apply SetLabelWidth workaround in more places.
- first run search engine ballot explanatory text
- first run bubble text
- sync setup label in options dialog's second tab
BUG=54898
TEST=all places listed above look good in LTR and at least ok in RTL
Review URL: http://codereview.chromium.org/3443006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/first_run_bubble.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/first_run_dialog.cc | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/options/content_page_gtk.cc | 5 |
3 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/gtk/first_run_bubble.cc b/chrome/browser/gtk/first_run_bubble.cc index 1a728c8..fb23e145 100644 --- a/chrome/browser/gtk/first_run_bubble.cc +++ b/chrome/browser/gtk/first_run_bubble.cc @@ -14,6 +14,7 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/gtk/gtk_theme_provider.h" +#include "chrome/browser/gtk/gtk_util.h" #include "chrome/browser/search_engines/util.h" #include "chrome/common/notification_service.h" #include "gfx/gtk_util.h" @@ -133,13 +134,11 @@ void FirstRunBubble::InitializeContentForLarge() { GtkWidget* label2 = gtk_label_new( l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT).c_str()); labels_.push_back(label2); - gtk_label_set_line_wrap(GTK_LABEL(label2), TRUE); string16 search_engine = GetDefaultSearchEngineName(profile_); GtkWidget* label3 = gtk_label_new( l10n_util::GetStringFUTF8(IDS_FR_BUBBLE_QUESTION, search_engine).c_str()); labels_.push_back(label3); - gtk_label_set_line_wrap(GTK_LABEL(label3), TRUE); GtkWidget* keep_button = gtk_button_new_with_label( l10n_util::GetStringFUTF8(IDS_FR_BUBBLE_OK, search_engine).c_str()); @@ -188,7 +187,6 @@ void FirstRunBubble::InitializeContentForMinimal() { GtkWidget* label2 = gtk_label_new(l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT).c_str()); labels_.push_back(label2); - gtk_label_set_line_wrap(GTK_LABEL(label2), TRUE); gtk_box_pack_start(GTK_BOX(content_), label1, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(content_), label2, FALSE, FALSE, 0); @@ -204,8 +202,8 @@ void FirstRunBubble::InitializeLabels(int width_resource) { // Resize the labels so that they don't wrap more than necessary. We leave // |content_| unsized so that it'll expand as needed to hold the other // widgets -- the buttons may be wider than |width| on high-DPI displays. - gtk_widget_set_size_request(labels_[i], width, -1); - gtk_misc_set_alignment(GTK_MISC(labels_[i]), 0, .5); + gtk_util::SetLabelWidth(labels_[i], width); + gtk_misc_set_alignment(GTK_MISC(labels_[i]), 0, 0.5); } } diff --git a/chrome/browser/gtk/first_run_dialog.cc b/chrome/browser/gtk/first_run_dialog.cc index 0aa0eed..a2aeec1 100644 --- a/chrome/browser/gtk/first_run_dialog.cc +++ b/chrome/browser/gtk/first_run_dialog.cc @@ -173,8 +173,7 @@ void FirstRunDialog::ShowSearchEngineWindow() { l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)).c_str()); gtk_misc_set_alignment(GTK_MISC(explanation), 0, 0.5); gtk_util::SetLabelColor(explanation, &gfx::kGdkBlack); - gtk_label_set_line_wrap(GTK_LABEL(explanation), TRUE); - gtk_widget_set_size_request(explanation, kExplanationWidth, -1); + gtk_util::SetLabelWidth(explanation, kExplanationWidth); gtk_box_pack_start(GTK_BOX(bubble_area_box), explanation, FALSE, FALSE, 0); // We will fill this in after the TemplateURLModel has loaded. diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc index a9b09d5..8aff196 100644 --- a/chrome/browser/gtk/options/content_page_gtk.cc +++ b/chrome/browser/gtk/options/content_page_gtk.cc @@ -44,7 +44,7 @@ static const GdkColor kSyncLabelErrorBgColor = GDK_COLOR_RGB(0xff, 0x9a, 0x9a); // Helper for WrapLabelAtAllocationHack. void OnLabelAllocate(GtkWidget* label, GtkAllocation* allocation) { - gtk_widget_set_size_request(label, allocation->width, -1); + gtk_util::SetLabelWidth(label, allocation->width); // Disconnect ourselves. Repeatedly resizing based on allocation causes // the dialog to become unshrinkable. @@ -337,8 +337,7 @@ GtkWidget* ContentPageGtk::InitSyncGroup() { sync_status_label_ = gtk_label_new(""); WrapLabelAtAllocationHack(sync_status_label_); - gtk_label_set_line_wrap(GTK_LABEL(sync_status_label_), TRUE); - gtk_misc_set_alignment(GTK_MISC(sync_status_label_), 0, 0); + gtk_misc_set_alignment(GTK_MISC(sync_status_label_), 0, 0.5); gtk_box_pack_start(GTK_BOX(vbox), sync_status_label_background_, FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(sync_status_label_background_), |