Commit 22e5f533 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[Passwords] Fix icon placement in Combobox in RTL layout

Screenshots (in Arabic UI)
Before: https://screenshot.googleplex.com/upvG78K5yqY.png
After: https://screenshot.googleplex.com/TDMh0T0XzbR.png

Bug: 1044038
Change-Id: Ibe5f960629cd506762ac14af44a7818f238215f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303715
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789548}
parent d6d62019
...@@ -576,7 +576,9 @@ void Combobox::PaintIconAndText(gfx::Canvas* canvas) { ...@@ -576,7 +576,9 @@ void Combobox::PaintIconAndText(gfx::Canvas* canvas) {
gfx::ImageSkia icon_skia = gfx::ImageSkia icon_skia =
GetImageSkiaFromImageModel(&icon, GetNativeTheme()); GetImageSkiaFromImageModel(&icon, GetNativeTheme());
int icon_y = y + (contents_height - icon_skia.height()) / 2; int icon_y = y + (contents_height - icon_skia.height()) / 2;
canvas->DrawImageInt(icon_skia, x, icon_y); gfx::Rect icon_bounds(x, icon_y, icon_skia.width(), icon_skia.height());
AdjustBoundsForRTLUI(&icon_bounds);
canvas->DrawImageInt(icon_skia, icon_bounds.x(), icon_bounds.y());
x += icon_skia.width() + LayoutProvider::Get()->GetDistanceMetric( x += icon_skia.width() + LayoutProvider::Get()->GetDistanceMetric(
DISTANCE_RELATED_LABEL_HORIZONTAL); DISTANCE_RELATED_LABEL_HORIZONTAL);
} }
......
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