Commit ee7f04ed authored by Michael Checo's avatar Michael Checo Committed by Commit Bot

Scanning: Align panels

 - Add custom css vars that can be updated at different
   breakpoints to conform to the spec.
 - Align scan preview and dropdown section.
 - Update html markup to support panel layout.

Screenshot: http://shortn/_vmZWXoAuiQ

Bug: 1059779
Test: browser_tests --gtest_filter=ScanningUIBrowserTest.All
Change-Id: I36927a2c2b9e7370916aa8d1010083bf2f6d601e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2504209
Commit-Queue: Michael Checo <michaelcheco@google.com>
Reviewed-by: default avatarJimmy Gong <jimmyxgong@chromium.org>
Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821782}
parent f9d26e16
...@@ -330,6 +330,21 @@ suite('ScanningAppTest', () => { ...@@ -330,6 +330,21 @@ suite('ScanningAppTest', () => {
scanningApp.$$('#statusText').textContent.trim()); scanningApp.$$('#statusText').textContent.trim());
}); });
}); });
test('PanelContainerContent', () => {
const scanners = [];
const capabilities = new Map();
return initializeScanningApp(scanners, capabilities).then(() => {
const panelContainer = scanningApp.$$('.panel-container');
assertTrue(!!panelContainer);
const leftPanel = scanningApp.$$('.panel-container > #leftPanel');
const rightPanel = scanningApp.$$('.panel-container > #rightPanel');
assertTrue(!!leftPanel);
assertTrue(!!rightPanel);
});
});
}); });
suite('ScannerSelectTest', () => { suite('ScannerSelectTest', () => {
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
.preview { .preview {
border: 1px solid var(--google-grey-200); border: 1px solid var(--google-grey-200);
border-radius: 4px; border-radius: 4px;
/* TODO(michaelcheco): Replace with correct height for
* preview container. */
height: 420px;
} }
</style> </style>
<div class="preview"></div> <div class="preview"></div>
\ No newline at end of file
...@@ -8,32 +8,50 @@ ...@@ -8,32 +8,50 @@
position: relative; position: relative;
width: var(--container-width); width: var(--container-width);
} }
.panel {
padding-inline: var(--panel-padding);
width: var(--panel-width);
}
.panel-container {
display: flex;
margin-bottom: var(--panel-container-margin-bottom);
margin-top: var(--panel-container-margin-top);
}
</style> </style>
<div id="scanningContainer"> <div id="scanningContainer">
<h1 id="appTitle">[[i18n('appTitle')]]</h1> <div class="panel-container">
<scanner-select id="scannerSelect" scanners="[[scanners_]]" loaded="[[loaded_]]" <div id="leftPanel" class="panel">
settings-disabled="[[settingsDisabled_]]" <scan-preview></scan-preview>
selected-scanner-id="{{selectedScannerId}}"></scanner-select> </div>
<source-select id="sourceSelect" sources="[[capabilities_.sources]]" <div id="rightPanel" class="panel">
settings-disabled="[[settingsDisabled_]]" <h1 id="appTitle">[[i18n('appTitle')]]</h1>
selected-source="{{selectedSource}}"></source-select> <scanner-select id="scannerSelect" scanners="[[scanners_]]" loaded="[[loaded_]]"
<file-type-select id="fileTypeSelect" settings-disabled="[[settingsDisabled_]]" settings-disabled="[[settingsDisabled_]]"
selected-file-type="{{selectedFileType}}"></file-type-select> selected-scanner-id="{{selectedScannerId}}"></scanner-select>
<color-mode-select id="colorModeSelect" <source-select id="sourceSelect" sources="[[capabilities_.sources]]"
color-modes="[[capabilities_.colorModes]]" settings-disabled="[[settingsDisabled_]]"
settings-disabled="[[settingsDisabled_]]" selected-source="{{selectedSource}}"></source-select>
selected-color-mode="{{selectedColorMode}}"></color-mode-select> <file-type-select id="fileTypeSelect" settings-disabled="[[settingsDisabled_]]"
<page-size-select id="pageSizeSelect" page-sizes="[[selectedSourcePageSizes_]]" selected-file-type="{{selectedFileType}}"></file-type-select>
settings-disabled="[[settingsDisabled_]]" <color-mode-select id="colorModeSelect"
selected-page-size="{{selectedPageSize}}"></page-size-select> color-modes="[[capabilities_.colorModes]]"
<resolution-select id="resolutionSelect" settings-disabled="[[settingsDisabled_]]"
resolutions="[[capabilities_.resolutions]]" selected-color-mode="{{selectedColorMode}}"></color-mode-select>
settings-disabled="[[settingsDisabled_]]" <page-size-select id="pageSizeSelect" page-sizes="[[selectedSourcePageSizes_]]"
selected-resolution="{{selectedResolution}}"></resolution-select> settings-disabled="[[settingsDisabled_]]"
<!-- TODO(jschettler): Replace button label with finalized i18n string. --> selected-page-size="{{selectedPageSize}}"></page-size-select>
<cr-button id="scanButton" on-click="onScanClick_" <resolution-select id="resolutionSelect"
disabled$="[[scanButtonDisabled_]]"> resolutions="[[capabilities_.resolutions]]"
Scan settings-disabled="[[settingsDisabled_]]"
</cr-button> selected-resolution="{{selectedResolution}}"></resolution-select>
<p id="statusText">[[statusText_]]</p> <!-- TODO(jschettler): Replace button label with finalized i18n string. -->
<cr-button id="scanButton" on-click="onScanClick_"
disabled$="[[scanButtonDisabled_]]">
Scan
</cr-button>
<p id="statusText">[[statusText_]]</p>
</div>
</div>
</div> </div>
...@@ -10,6 +10,7 @@ import './color_mode_select.js'; ...@@ -10,6 +10,7 @@ import './color_mode_select.js';
import './file_type_select.js'; import './file_type_select.js';
import './page_size_select.js'; import './page_size_select.js';
import './resolution_select.js'; import './resolution_select.js';
import './scan_preview.js';
import './scanner_select.js'; import './scanner_select.js';
import './scanning_shared_css.js'; import './scanning_shared_css.js';
import './source_select.js'; import './source_select.js';
......
...@@ -4,8 +4,14 @@ ...@@ -4,8 +4,14 @@
<link rel="stylesheet" href="chrome://resources/css/md_colors.css"> <link rel="stylesheet" href="chrome://resources/css/md_colors.css">
<template> <template>
<style include="cr-shared-style"> <style include="cr-shared-style">
/* TODO(michaelcheco): Add media queries that update css vars to match the
* values found in the spec. */
:host { :host {
--container-width: 960px; --container-width: 960px;
--panel-container-margin-bottom: 32px;
--panel-container-margin-top: 20px;
--panel-padding: 48px;
--panel-width: 384px;
} }
html { html {
......
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