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

Unified Diff: chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc

Issue 10915196: [gtk] fix title wrapping on extension install dialog (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: synced Created 8 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
diff --git a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
index 4ccd611df116b711e7e8be7b2ee302ef8e8a0edf..f8db72cfdfd798c2a7643c7c63fa58837405dd11 100644
--- a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
@@ -151,11 +151,16 @@ ExtensionInstallDialog::ExtensionInstallDialog(
GtkWidget* top_content_hbox = gtk_hbox_new(FALSE, ui::kContentAreaSpacing);
gtk_box_pack_start(GTK_BOX(content_vbox), top_content_hbox, TRUE, TRUE, 0);
+ // We don't show the image for bunle installs, so let the left column take up
+ // that space.
+ const int left_column_min_width =
+ kLeftColumnMinWidth + (is_bundle_install ? kImageSize : 0);
+
// Create a new vbox for the left column.
GtkWidget* left_column_area = gtk_vbox_new(FALSE, ui::kControlSpacing);
gtk_box_pack_start(GTK_BOX(top_content_hbox), left_column_area,
TRUE, TRUE, 0);
- gtk_widget_set_size_request(left_column_area, kLeftColumnMinWidth, -1);
+ gtk_widget_set_size_request(left_column_area, left_column_min_width, -1);
GtkWidget* heading_vbox = gtk_vbox_new(FALSE, 0);
// If we are not going to show anything else, vertically center the title.
@@ -167,8 +172,7 @@ ExtensionInstallDialog::ExtensionInstallDialog(
// Heading
GtkWidget* heading_label = gtk_util::CreateBoldLabel(
UTF16ToUTF8(prompt.GetHeading().c_str()));
- gtk_label_set_line_wrap(GTK_LABEL(heading_label), true);
- gtk_misc_set_alignment(GTK_MISC(heading_label), 0.0, 0.5);
+ gtk_util::SetLabelWidth(heading_label, left_column_min_width);
gtk_box_pack_start(GTK_BOX(heading_vbox), heading_label, center_heading,
center_heading, 0);
@@ -186,7 +190,7 @@ ExtensionInstallDialog::ExtensionInstallDialog(
// User count.
GtkWidget* users_label = gtk_label_new(UTF16ToUTF8(
prompt.GetUserCount()).c_str());
- gtk_util::SetLabelWidth(users_label, kLeftColumnMinWidth);
+ gtk_util::SetLabelWidth(users_label, left_column_min_width);
gtk_util::SetLabelColor(users_label, &ui::kGdkGray);
gtk_util::ForceFontSizePixels(rating_label, kRatingTextSize);
gtk_box_pack_start(GTK_BOX(heading_vbox), users_label,
@@ -215,7 +219,7 @@ ExtensionInstallDialog::ExtensionInstallDialog(
for (size_t i = 0; i < items.size(); ++i) {
GtkWidget* extension_label = gtk_label_new(UTF16ToUTF8(
items[i].GetNameForDisplay()).c_str());
- gtk_util::SetLabelWidth(extension_label, kLeftColumnMinWidth);
+ gtk_util::SetLabelWidth(extension_label, left_column_min_width);
gtk_box_pack_start(GTK_BOX(extensions_vbox), extension_label,
FALSE, FALSE, kExtensionsPadding);
}
@@ -252,7 +256,7 @@ ExtensionInstallDialog::ExtensionInstallDialog(
GtkWidget* permissions_header = gtk_util::CreateBoldLabel(
UTF16ToUTF8(prompt.GetPermissionsHeading()).c_str());
- gtk_util::SetLabelWidth(permissions_header, kLeftColumnMinWidth);
+ gtk_util::SetLabelWidth(permissions_header, left_column_min_width);
gtk_box_pack_start(GTK_BOX(permissions_container), permissions_header,
FALSE, FALSE, 0);
@@ -260,7 +264,7 @@ ExtensionInstallDialog::ExtensionInstallDialog(
std::string permission = l10n_util::GetStringFUTF8(
IDS_EXTENSION_PERMISSION_LINE, prompt.GetPermission(i));
GtkWidget* permission_label = gtk_label_new(permission.c_str());
- gtk_util::SetLabelWidth(permission_label, kLeftColumnMinWidth);
+ gtk_util::SetLabelWidth(permission_label, left_column_min_width);
gtk_box_pack_start(GTK_BOX(permissions_container), permission_label,
FALSE, FALSE, kPermissionsPadding);
}
@@ -272,7 +276,7 @@ ExtensionInstallDialog::ExtensionInstallDialog(
// the permissions usually go.
GtkWidget* oauth_issues_container =
show_permissions ? content_vbox : left_column_area;
- int pixel_width = kLeftColumnMinWidth +
+ int pixel_width = left_column_min_width +
(show_permissions ? kImageSize : 0);
GtkWidget* oauth_issues_header = gtk_util::CreateBoldLabel(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698