Skip to content

Commit

Permalink
[M110 Merge] Adds end padding to input box when lens search is enable…
Browse files Browse the repository at this point in the history
…d to account for

icon.

Screenshots: https://screenshot.googleplex.com/ApeMNbFSXyXS5TJ
https://screenshot.googleplex.com/9uLncSoR2L7gpUE

(cherry picked from commit a2675c4)

Bug: 1401354
Change-Id: Ic9eb4d34f2923f46920931a01b52d23fd7ce8a26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4114620
Commit-Queue: Yo Wakita <yowakita@google.com>
Reviewed-by: Moe Ahmadi <mahmadi@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1088988}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4144139
Cr-Commit-Position: refs/branch-heads/5481@{#252}
Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
  • Loading branch information
Yo Wakita authored and Chromium LUCI CQ committed Jan 12, 2023
1 parent d44dea5 commit adc6c6d
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions chrome/browser/resources/new_tab_page/realbox/realbox.html
Expand Up @@ -3,6 +3,9 @@
--ntp-realbox-border-radius: calc(0.5 * var(--ntp-realbox-height));
--ntp-realbox-height: 44px;
--ntp-realbox-shadow: 0 1px 6px 0 var(--color-realbox-shadow);
--ntp-realbox-icon-width: 26px;
--ntp-realbox-inner-icon-margin: 8px;
--ntp-realbox-voice-icon-offset: 16px;
border-radius: var(--ntp-realbox-border-radius);
box-shadow: var(--ntp-realbox-shadow);
font-size: 16px;
Expand All @@ -13,6 +16,10 @@
--ntp-realbox-shadow: 0 2px 6px 0 var(--color-realbox-shadow);
}

:host([realbox-lens-search-enabled_]) {
--ntp-realbox-voice-icon-offset: 53px;
}

@media (forced-colors: active) {
:host {
border: 1px solid ActiveBorder;
Expand Down Expand Up @@ -50,7 +57,7 @@
font-size: inherit;
height: 100%;
outline: none;
padding-inline-end: 44px;
padding-inline-end: calc(var(--ntp-realbox-voice-icon-offset) + var(--ntp-realbox-icon-width) + var(--ntp-realbox-inner-icon-margin));
padding-inline-start: 52px;
position: relative;
width: 100%;
Expand Down Expand Up @@ -118,7 +125,7 @@
pointer-events: auto;
position: absolute;
right: 16px;
width: 26px;
width: var(--ntp-realbox-icon-width);
}

:host([single-colored-icons]) #voiceSearchButton,
Expand Down Expand Up @@ -146,12 +153,12 @@
}

:host([realbox-lens-search-enabled_]):host-context([dir='rtl']) #voiceSearchButton {
left: 53px;
left: var(--ntp-realbox-voice-icon-offset);
right: unset;
}

:host([realbox-lens-search-enabled_]) #voiceSearchButton {
right: 53px;
right: var(--ntp-realbox-voice-icon-offset);
}

:host-context([dir='rtl']) .realbox-icon-button {
Expand All @@ -164,7 +171,7 @@
}

:-webkit-any(input, ntp-realbox-icon, .realbox-icon-button) {
z-index: 100;
z-index: 100;
}

ntp-realbox-dropdown {
Expand All @@ -188,22 +195,18 @@
<ntp-realbox-icon id="icon" match="[[selectedMatch_]]"
default-icon="[[realboxIcon_]]" in-searchbox>
</ntp-realbox-icon>
<button id="voiceSearchButton"
class="realbox-icon-button"
on-click="onVoiceSearchClick_"
title="$i18n{voiceSearchButtonLabel}">
<button id="voiceSearchButton" class="realbox-icon-button"
on-click="onVoiceSearchClick_" title="$i18n{voiceSearchButtonLabel}">
</button>
<template is="dom-if" if="[[realboxLensSearchEnabled_]]">
<button id="lensSearchButton"
class="realbox-icon-button"
on-click="onLensSearchClick_"
title="$i18n{lensSearchButtonLabel}">
<button id="lensSearchButton" class="realbox-icon-button"
on-click="onLensSearchClick_" title="$i18n{lensSearchButtonLabel}">
</button>
</template>
<ntp-realbox-dropdown id="matches" role="listbox"
result="[[result_]]" selected-match-index="{{selectedMatchIndex_}}"
<ntp-realbox-dropdown id="matches" role="listbox" result="[[result_]]"
selected-match-index="{{selectedMatchIndex_}}"
on-result-repaint="onResultRepaint_" on-match-focusin="onMatchFocusin_"
on-match-click="onMatchClick_" on-match-remove="onMatchRemove_"
on-header-focusin="onHeaderFocusin_" hidden$="[[!matchesAreVisible]]">
</ntp-realbox-dropdown>
</div>
</div>

0 comments on commit adc6c6d

Please sign in to comment.