Commit 0577e54a authored by Andrew Xu's avatar Andrew Xu Committed by Commit Bot

Fix hotseat widget's location in RTL

The bounds of the hotseat are not adapted to RTL. This CL fixes the issue.

Bug: 997356
Change-Id: Ib73aec5af90958ebff2ec82d326dfbb704efaf1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769550Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690140}
parent b5236720
...@@ -1158,13 +1158,17 @@ void ShelfLayoutManager::CalculateTargetBounds( ...@@ -1158,13 +1158,17 @@ void ShelfLayoutManager::CalculateTargetBounds(
int hotseat_width; int hotseat_width;
int hotseat_height; int hotseat_height;
if (shelf_->IsHorizontalAlignment()) { if (shelf_->IsHorizontalAlignment()) {
hotseat_origin = gfx::Point(target_bounds->nav_bounds_in_shelf.right() +
ShelfConstants::home_button_edge_spacing(),
0);
hotseat_width = shelf_width - hotseat_width = shelf_width -
target_bounds->nav_bounds_in_shelf.size().width() - target_bounds->nav_bounds_in_shelf.size().width() -
ShelfConstants::home_button_edge_spacing() - ShelfConstants::home_button_edge_spacing() -
kAppIconGroupMargin - status_size.width(); kAppIconGroupMargin - status_size.width();
int start_x = base::i18n::IsRTL()
? target_bounds->nav_bounds_in_shelf.x() -
ShelfConstants::home_button_edge_spacing() -
hotseat_width
: target_bounds->nav_bounds_in_shelf.right() +
ShelfConstants::home_button_edge_spacing();
hotseat_origin = gfx::Point(start_x, 0);
hotseat_height = shelf_height; hotseat_height = shelf_height;
} else { } else {
hotseat_origin = hotseat_origin =
......
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