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

Issue 5760001: [gtk] fix line wrap issue on app shortcut dialog (Closed)

Created:
10 years ago by Evan Stade
Modified:
9 years, 6 months ago
Reviewers:
Elliot Glaysher
CC:
chromium-reviews, ben+cc_chromium.org
Visibility:
Public.

Description

[gtk] fix line wrap issue on app shortcut dialog BUG=65963 TEST=manual (see bug) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=68830

Patch Set 1 #

Patch Set 2 : resizable=false #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -9 lines) Patch
M chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc View 1 2 chunks +14 lines, -9 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Evan Stade
10 years ago (2010-12-09 22:29:13 UTC) #1
Elliot Glaysher
10 years ago (2010-12-09 23:05:19 UTC) #2
LGTM

On Thu, Dec 9, 2010 at 2:29 PM,  <estade@chromium.org> wrote:
> Reviewers: Elliot Glaysher,
>
> Description:
> [gtk] fix line wrap issue on app shortcut dialog
>
> BUG=65963
> TEST=manual (see bug)
>
> Please review this at http://codereview.chromium.org/5760001/
>
> SVN Base: svn://svn.chromium.org/chrome/trunk/src
>
> Affected files:
>  M chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
>
>
> Index: chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
> diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
> b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
> index
>
34ee5a7541588f6a85942ee126dfcea309673c1c..40519fef808c28d4146067ec9ac2b82f70f2487c
> 100644
> --- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
> +++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
> @@ -87,10 +87,6 @@ void
> CreateApplicationShortcutsDialogGtk::CreateDialogBox(GtkWindow* parent) {
>       GTK_RESPONSE_REJECT,
>       NULL);
>   gtk_widget_realize(create_dialog_);
> -  gtk_util::SetWindowSizeFromResources(GTK_WINDOW(create_dialog_),
> -
> IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS,
> -                                       -1,  // height
> -                                       false);  // resizable
>   gtk_util::AddButtonToDialog(create_dialog_,
>       l10n_util::GetStringUTF8(IDS_CREATE_SHORTCUTS_COMMIT).c_str(),
>       GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT);
> @@ -117,11 +113,19 @@ void
> CreateApplicationShortcutsDialogGtk::CreateDialogBox(GtkWindow* parent) {
>   gtk_box_pack_start(GTK_BOX(hbox), description_label, FALSE, FALSE, 0);
>   gtk_label_set_line_wrap(GTK_LABEL(description_label), TRUE);
>   gtk_widget_realize(description_label);
> -  int label_height;
> -  gtk_util::GetWidgetSizeFromCharacters(description_label, -1,
> -                                        kDescriptionLabelHeightLines, NULL,
> -                                        &label_height);
> -  gtk_widget_set_size_request(description_label, -1, label_height);
> +
> +  // Set the size request on the label so it knows where to line wrap. The
> width
> +  // is the desired size of the dialog less the space reserved for padding
> and
> +  // the image.
> +  int label_width, label_height;
> +  gtk_util::GetWidgetSizeFromResources(
> +      description_label,
> +      IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS, -1, &label_width, NULL);
> +  label_width -= gtk_util::kControlSpacing * 3 +
> +      gdk_pixbuf_get_width(favicon_pixbuf_);
> +  gtk_util::GetWidgetSizeFromCharacters(
> +      description_label, -1, kDescriptionLabelHeightLines, NULL,
> &label_height);
> +  gtk_widget_set_size_request(description_label, label_width,
> label_height);
>   gtk_misc_set_alignment(GTK_MISC(description_label), 0, 0.5);
>   std::string description(UTF16ToUTF8(shortcut_info_.description));
>   std::string title(UTF16ToUTF8(shortcut_info_.title));
>
>
>

Powered by Google App Engine
This is Rietveld 408576698