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

Issue 164101: Don't pack an empty label into bookmarks with empty titles. (Closed)

Created:
11 years, 4 months ago by Evan Stade
Modified:
9 years, 6 months ago
Reviewers:
Elliot Glaysher
CC:
chromium-reviews_googlegroups.com, Ben Goodger (Google)
Visibility:
Public.

Description

Don't pack an empty label into bookmarks with empty titles. BUG=18348 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=22684

Patch Set 1 #

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

Messages

Total messages: 2 (0 generated)
Evan Stade
11 years, 4 months ago (2009-08-06 22:41:06 UTC) #1
Elliot Glaysher
11 years, 4 months ago (2009-08-06 22:42:28 UTC) #2
LGTM

On Thu, Aug 6, 2009 at 3:41 PM, <estade@chromium.org> wrote:
> Reviewers: Elliot Glaysher,
>
> Description:
> Don't pack an empty label into bookmarks with empty titles.
>
> BUG=3D18348
>
>
> Please review this at http://codereview.chromium.org/164101
>
> SVN Base: svn://chrome-svn/chrome/trunk/src/
>
> Affected files:
> =A0M =A0 =A0 chrome/browser/gtk/bookmark_utils_gtk.cc
>
>
> Index: chrome/browser/gtk/bookmark_utils_gtk.cc
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- chrome/browser/gtk/bookmark_utils_gtk.cc =A0 =A0(revision 22676)
> +++ chrome/browser/gtk/bookmark_utils_gtk.cc =A0 =A0(working copy)
> @@ -128,22 +128,29 @@
> =A0 GtkWidget* image =3D gtk_image_new_from_pixbuf(pixbuf);
> =A0 g_object_unref(pixbuf);
>
> - =A0GtkWidget* label =3D gtk_label_new(WideToUTF8(node->GetTitle()).c_st=
r());
> - =A0gtk_label_set_max_width_chars(GTK_LABEL(label), kMaxCharsOnAButton);
> - =A0gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END);
> -
> =A0 GtkWidget* box =3D gtk_hbox_new(FALSE, kBarButtonPadding);
> =A0 gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
> - =A0gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
>
> + =A0std::string label_string =3D WideToUTF8(node->GetTitle());
> + =A0if (!label_string.empty()) {
> + =A0 =A0GtkWidget* label =3D gtk_label_new(label_string.c_str());
> + =A0 =A0gtk_label_set_max_width_chars(GTK_LABEL(label), kMaxCharsOnAButt=
on);
> + =A0 =A0gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END);
> + =A0 =A0gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
> + =A0 =A0SetButtonTextColors(label, provider);
> + =A0}
> +
> =A0 GtkWidget* alignment =3D gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
> - =A0gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
> - =A0 =A0 =A0kButtonPaddingTop, kButtonPaddingBottom,
> - =A0 =A0 =A0kButtonPaddingLeft, kButtonPaddingRight);
> + =A0// If we are not showing the label, don't set any padding, so that t=
he
> icon
> + =A0// will just be centered.
> + =A0if (label_string.c_str()) {
> + =A0 =A0gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
> + =A0 =A0 =A0 =A0kButtonPaddingTop, kButtonPaddingBottom,
> + =A0 =A0 =A0 =A0kButtonPaddingLeft, kButtonPaddingRight);
> + =A0}
> =A0 gtk_container_add(GTK_CONTAINER(alignment), box);
> =A0 gtk_container_add(GTK_CONTAINER(button), alignment);
>
> - =A0SetButtonTextColors(label, provider);
> =A0 g_object_set_data(G_OBJECT(button), bookmark_utils::kBookmarkNode,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 AsVoid(node));
>
>
>
>

Powered by Google App Engine
This is Rietveld 408576698