Commit 1f623f5f authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Fix message center left position offset

Correcting the x position calculation of the MessageCenterBubble to
correctly align with the quick settings bubble.
If shelf is left aligned we need to add the left inset of the
quick settings bubble to the horizontal position.
Otherwise we need to subtract the right inset of the quick settings
bubble from the horizontal position.

Bug: 1021632
Change-Id: I8d449d3c297858283f41bcc10163a0e15b2965b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900161Reviewed-by: default avatarTim Song <tengs@chromium.org>
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712756}
parent f42d0946
......@@ -148,7 +148,12 @@ void UnifiedMessageCenterBubble::UpdatePosition() {
// corner clipping for ARC notifications. This approach only modifies the
// position of the layer.
gfx::Rect anchor_rect = tray_->shelf()->GetSystemTrayAnchorRect();
anchor_rect.set_x(anchor_rect.x() - kUnifiedMenuPadding);
int left_offset =
tray_->shelf()->alignment() == SHELF_ALIGNMENT_LEFT
? kUnifiedMenuPadding
: -(kUnifiedMenuPadding - (base::i18n::IsRTL() ? 0 : 1));
anchor_rect.set_x(anchor_rect.x() + left_offset);
anchor_rect.set_y(anchor_rect.y() - tray_->bubble()->GetCurrentTrayHeight() -
kUnifiedMenuPadding - kUnifiedMessageCenterBubbleSpacing);
bubble_view_->ChangeAnchorRect(anchor_rect);
......
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