Commit f1001613 authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS Settings] Align OsSettingsSearchBox correctly for RTL languages.

Impacted -
Arabic: https://nimb.ws/VMt1LI
Hebrew: https://nimb.ws/f36byI

Reference (unchanged) -
English: https://nimb.ws/XFKJwq

With regard to the placement of the dropdown -
* left:0 is not needed at all - it is ignored in both ltr/rtl and struck
  out in the inspector.
* right:0 causes the iron-dropdown to align to the right hand side of
  the window for rtl languages

With regard to the click-ability of the burger icon
* In rtl, #leftSpacer is covered by #centeredContent, so the
  burger icon is not clickable because #centeredContent is set at
  width 100% to accurately center the search box in narrow mode. A
  z-index of -1 is applied to #centeredContent narrow mode in order
  to place it beneath the #leftSpacer. #centerContent was set to 100%
  in order to avoid the use of CSS translate transform,
  which would remove the need for a child to be centered based off
  the positioning of its parent which varies since OsToolbar shifts
  based off of the width of the window. Using that property was
  hard to follow, so I decided against it in [1].
* The width of the #leftSpacer is shrunk to 20px in narrow mode
  so that it does not overlap with the OsSettingsSearchBox in any
  width, so that any part of the CrToolbarSearchField is
  clickable.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2337277

Bug: 1119638
Change-Id: I5c609f68b4ad0a8d4c4b89b12b1cf4dcc2a1d06a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2365974Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800177}
parent f3c8d8d0
...@@ -91,9 +91,7 @@ ...@@ -91,9 +91,7 @@
} }
iron-dropdown { iron-dropdown {
left: 0;
margin-top: 74px; margin-top: 74px;
right: 0;
} }
iron-dropdown [slot='dropdown-content'] { iron-dropdown [slot='dropdown-content'] {
......
...@@ -59,6 +59,10 @@ ...@@ -59,6 +59,10 @@
width: var(--settings-menu-width); width: var(--settings-menu-width);
} }
:host([narrow]) #leftSpacer {
width: 20px;
}
cr-icon-button { cr-icon-button {
--cr-icon-button-fill-color: currentColor; --cr-icon-button-fill-color: currentColor;
--cr-icon-button-size: 32px; --cr-icon-button-size: 32px;
...@@ -78,6 +82,8 @@ ...@@ -78,6 +82,8 @@
:host([narrow]) #centeredContent { :host([narrow]) #centeredContent {
position: absolute; position: absolute;
width: 100%; width: 100%;
/* #centeredContent should always be below #leftContent */
z-index: -1;
} }
:host([narrow]:not([showing-search_])) #centeredContent { :host([narrow]:not([showing-search_])) #centeredContent {
......
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