Commit 91c9f442 authored by Gavin Williams's avatar Gavin Williams Committed by Chromium LUCI CQ

scanning: Create error slot for scan settings

This fixes a UI bug where the "Can't connect to scanners?" message
only shifts the Scanner dropdown and not also the Scanner label.

Before: http://screen/47MFUFFmwh4UMYm
After: http://screen/7Gm86RYfjAGWDV9

Bug: 1059779
Change-Id: I74bdd0cd50ff096dd0b54b9578526ae53c513691
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2588836Reviewed-by: default avatarJesse Schettler <jschettler@chromium.org>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836682}
parent c62cdb03
<style include="scanning-shared scanning-fonts"> <style include="scanning-shared scanning-fonts">
:host { #selectDiv {
align-items: center; align-items: center;
display: flex; display: flex;
height: 48px; height: 48px;
...@@ -31,6 +31,18 @@ ...@@ -31,6 +31,18 @@
flex-shrink: 0; flex-shrink: 0;
width: 192px; width: 192px;
} }
::slotted([slot=error]) {
display: block;
margin-bottom: 8px;
margin-inline-end: 40px;
margin-inline-start: 120px;
margin-top: -8px;
width: 192px;
}
</style> </style>
<slot name="label"></slot> <div id="selectDiv">
<slot name="settings"></slot> <slot name="label"></slot>
<slot name="settings"></slot>
</div>
<slot name="error"></slot>
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#scanHelp { #scanHelp {
color: var(--google-grey-700); color: var(--google-grey-700);
font-size: 10px; font-size: 10px;
padding-top: 8px;
} }
#scanHelpLink { #scanHelpLink {
...@@ -35,10 +34,11 @@ ...@@ -35,10 +34,11 @@
</option> </option>
</template> </template>
</select> </select>
<span id="scanHelp" hidden$="[[shouldHideScanHelpLink_(loaded, scanners)]]"> </div>
[[i18n('noScannersHelpText')]] <div id="scanHelp" slot="error"
<!-- TODO(joonbug): Add href to the help link when available --> hidden$="[[shouldHideScanHelpLink_(loaded, scanners)]]">
<a id="scanHelpLink" href="#">[[i18n('noScannersHelpLinkLabel')]]</a> [[i18n('noScannersHelpText')]]
</span> <!-- TODO(gavinwill): Add href to the help link when available -->
<a id="scanHelpLink" href="#">[[i18n('noScannersHelpLinkLabel')]]</a>
</div> </div>
</scan-settings-section> </scan-settings-section>
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