Commit 88835fa5 authored by Thomas Lukaszewicz's avatar Thomas Lukaszewicz Committed by Commit Bot

Fixed view sizing bug for BadgedProfilePhoto view

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/+/2099224Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749794}
parent fa363175
...@@ -55,7 +55,6 @@ class BadgeView : public ::views::ImageView { ...@@ -55,7 +55,6 @@ class BadgeView : public ::views::ImageView {
public: public:
explicit BadgeView(BadgedProfilePhoto::BadgeType badge_type) explicit BadgeView(BadgedProfilePhoto::BadgeType badge_type)
: badge_type_(badge_type) { : badge_type_(badge_type) {
SizeToPreferredSize();
SetPosition(gfx::Point(kBadgedProfilePhotoWidth - kBadgeIconSize, SetPosition(gfx::Point(kBadgedProfilePhotoWidth - kBadgeIconSize,
kBadgedProfilePhotoHeight - kBadgeIconSize)); kBadgedProfilePhotoHeight - kBadgeIconSize));
} }
...@@ -106,6 +105,7 @@ class BadgeView : public ::views::ImageView { ...@@ -106,6 +105,7 @@ class BadgeView : public ::views::ImageView {
NOTREACHED(); NOTREACHED();
break; break;
} }
SizeToPreferredSize();
} }
private: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment