Skip to content

Commit

Permalink
Fixed view sizing bug for BadgedProfilePhoto view
Browse files Browse the repository at this point in the history
Added a call to SizeToPreferredSize() to the badge view wrapping the
vector icon after the icon has been set. This ensures that the
encapsulating view is sized correctly.

Bug: 1060554
Change-Id: I8863d104ee604b7a013805cc6bff72820e28a04c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2099224
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749794}
  • Loading branch information
Thomas Lukaszewicz authored and Commit Bot committed Mar 12, 2020
1 parent fa36317 commit 88835fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chrome/browser/ui/views/profiles/badged_profile_photo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class BadgeView : public ::views::ImageView {
public:
explicit BadgeView(BadgedProfilePhoto::BadgeType badge_type)
: badge_type_(badge_type) {
SizeToPreferredSize();
SetPosition(gfx::Point(kBadgedProfilePhotoWidth - kBadgeIconSize,
kBadgedProfilePhotoHeight - kBadgeIconSize));
}
Expand Down Expand Up @@ -106,6 +105,7 @@ class BadgeView : public ::views::ImageView {
NOTREACHED();
break;
}
SizeToPreferredSize();
}

private:
Expand Down

0 comments on commit 88835fa

Please sign in to comment.