Commit bf8d3d26 authored by fukino's avatar fukino Committed by Commit bot

Re-layout grid view and add check marks for selected items.

Changes are:
- Changed layout of grid view.
- Made thumbnails fill entire item area.
- Use check marks to indicate selected items.

BUG=402344
TEST=run browser_tests

Review URL: https://codereview.chromium.org/885653002

Cr-Commit-Position: refs/heads/master@{#313651}
parent e9c4d717
...@@ -644,7 +644,8 @@ html[dir='rtl'] .breadcrumbs .separator { ...@@ -644,7 +644,8 @@ html[dir='rtl'] .breadcrumbs .separator {
/* The cr.ui.Grid representing the detailed file list. */ /* The cr.ui.Grid representing the detailed file list. */
.thumbnail-grid { .thumbnail-grid {
overflow-y: auto; overflow-y: auto;
padding-bottom: 0; /* For the preview panel. Will be overridden by JS. */ /* padding-bottom will be overridden by JS for preview panel. */
padding: 7px 7px 0 7px;
width: 100%; width: 100%;
} }
...@@ -686,23 +687,42 @@ body[type='full-page'] .detail-name .detail-icon { ...@@ -686,23 +687,42 @@ body[type='full-page'] .detail-name .detail-icon {
/* Styles specific for the grid view. */ /* Styles specific for the grid view. */
.thumbnail-grid .thumbnail-item { .thumbnail-grid .thumbnail-item {
-webkit-margin-start: 21px; -webkit-margin-start: 12px;
border: 3px solid transparent; /* Selection will make the border visible. */ background-color: rgb(245, 245, 245);
margin-top: 20px; box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
height: 180px;
margin-top: 8px;
overflow: hidden;
position: relative; position: relative;
width: 180px;
} }
.thumbnail-grid .thumbnail-frame { .thumbnail-grid .thumbnail-frame {
background-color: rgb(245, 245, 245); height: 100%;
height: 120px; width: 100%;
overflow: hidden;
position: relative;
width: 160px;
} }
.thumbnail-grid .thumbnail-item[selected] .thumbnail-frame, .thumbnail-grid .thumbnail-item[selected],
.thumbnail-grid .thumbnail-item.accepts .thumbnail-frame { .thumbnail-grid .thumbnail-item.accepts {
border-color: white; background-color: rgb(221, 242, 253);
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.3);
}
.thumbnail-grid .thumbnail-frame .checkmark {
background-image: -webkit-image-set(
url(../images/files/ui/thumbnail_checked.png) 1x,
url(../images/files/ui/2x/thumbnail_checked.png) 2x);
height: 34px;
left: 9px;
opacity: 0;
position: absolute;
top: 9px;
transition: opacity 220ms ease;
width: 34px;
}
.thumbnail-grid .thumbnail-item[selected] .thumbnail-frame .checkmark {
opacity: 1;
} }
.thumbnail-grid .img-container { .thumbnail-grid .img-container {
...@@ -763,31 +783,25 @@ body[type='full-page'] .detail-name .detail-icon { ...@@ -763,31 +783,25 @@ body[type='full-page'] .detail-name .detail-icon {
#list-container list > li[selected], #list-container list > li[selected],
#list-container list > li:active, #list-container list > li:active,
#list-container grid > li[selected],
#list-container grid > li:active,
#default-actions-list > li[selected] { #default-actions-list > li[selected] {
background-color: rgb(225, 225, 225); background-color: rgb(225, 225, 225);
} }
#list-container list:focus > li[selected], #list-container list:focus > li[selected],
#list-container grid:focus > li[selected],
#default-actions-list:focus > li[selected] { #default-actions-list:focus > li[selected] {
background-color: rgb(66, 129, 244); background-color: rgb(66, 129, 244);
color: white; color: white;
} }
#list-container list > li.accepts[selected], #list-container list > li.accepts[selected] {
#list-container grid > li.accepts[selected] {
background-color: rgb(215, 215, 215); background-color: rgb(215, 215, 215);
} }
#list-container list:focus > li.accepts[selected], #list-container list:focus > li.accepts[selected] {
#list-container grid:focus > li.accepts[selected] {
background-color: rgb(48, 125, 254); background-color: rgb(48, 125, 254);
} }
#list-container list > li.accepts, #list-container list > li.accepts {
#list-container grid > li.accepts {
background-color: #f1f1f1; background-color: #f1f1f1;
} }
......
...@@ -105,7 +105,7 @@ FileGrid.prototype.updateListItemsMetadata = function(type, entries) { ...@@ -105,7 +105,7 @@ FileGrid.prototype.updateListItemsMetadata = function(type, entries) {
this.metadataCache_, this.metadataCache_,
this.volumeManager_, this.volumeManager_,
this.historyLoader_, this.historyLoader_,
ThumbnailLoader.FillMode.AUTO, ThumbnailLoader.FillMode.FILL,
FileGrid.ThumbnailQuality.LOW, FileGrid.ThumbnailQuality.LOW,
/* animation */ false); /* animation */ false);
} }
...@@ -181,12 +181,16 @@ FileGrid.decorateThumbnail = function( ...@@ -181,12 +181,16 @@ FileGrid.decorateThumbnail = function(
metadataCache, metadataCache,
volumeManager, volumeManager,
historyLoader, historyLoader,
ThumbnailLoader.FillMode.AUTO, ThumbnailLoader.FillMode.FILL,
FileGrid.ThumbnailQuality.LOW, FileGrid.ThumbnailQuality.LOW,
/* animation */ !previousBox); /* animation */ !previousBox);
} }
frame.appendChild(box); frame.appendChild(box);
var checkmark = li.ownerDocument.createElement('div');
checkmark.className = 'checkmark';
frame.appendChild(checkmark);
var bottom = li.ownerDocument.createElement('div'); var bottom = li.ownerDocument.createElement('div');
bottom.className = 'thumbnail-bottom'; bottom.className = 'thumbnail-bottom';
var badge = li.ownerDocument.createElement('div'); var badge = li.ownerDocument.createElement('div');
......
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