diff --git a/changelog/unreleased/enhancement-resources-tiles-view b/changelog/unreleased/enhancement-resources-tiles-view index 5c5d0fac35b..3ca966aa8aa 100644 --- a/changelog/unreleased/enhancement-resources-tiles-view +++ b/changelog/unreleased/enhancement-resources-tiles-view @@ -2,8 +2,12 @@ Enhancement: Add tiles view for resource display We've added a switch to change from the known resource table to a tiles view. The change gets saved to the url and persisted across resource navigation. +Tiles can be dynamically resized on screens bigger than mobile, using the "display customization options" dropdown. https://github.com/owncloud/web/pull/7991 +https://github.com/owncloud/web/pull/8372 https://github.com/owncloud/web/issues/6378 https://github.com/owncloud/web/issues/6379 https://github.com/owncloud/web/issues/6380 +https://github.com/owncloud/web/issues/8367 +https://github.com/owncloud/web/issues/8368 diff --git a/packages/design-system/src/tokens/ods/size.yaml b/packages/design-system/src/tokens/ods/size.yaml index f6b739af19f..1ac18295e8a 100644 --- a/packages/design-system/src/tokens/ods/size.yaml +++ b/packages/design-system/src/tokens/ods/size.yaml @@ -22,3 +22,8 @@ size: value: 22px form-check-default: value: 14px + tiles: + resize-step: + value: 12rem + default: + value: 14rem diff --git a/packages/web-app-files/src/components/AppBar/ViewOptions.vue b/packages/web-app-files/src/components/AppBar/ViewOptions.vue index 7e89aa5e891..8248ee31ac7 100644 --- a/packages/web-app-files/src/components/AppBar/ViewOptions.vue +++ b/packages/web-app-files/src/components/AppBar/ViewOptions.vue @@ -62,6 +62,21 @@ @change="itemsPerPage = $event" /> +
  • +
  • @@ -91,6 +106,10 @@ export default defineComponent({ name: ViewModeConstants.queryName, defaultValue: ViewModeConstants.defaultModeName }) + const viewSizeQuery = useRouteQueryPersisted({ + name: ViewModeConstants.tilesSizeQueryName, + defaultValue: ViewModeConstants.tilesSizeDefault.toString() + }) watch( [perPageQuery, viewModeQuery], (params) => { @@ -102,6 +121,7 @@ export default defineComponent({ return { ViewModeConstants, viewModeCurrent: viewModeQuery, + viewSizeCurrent: viewSizeQuery, itemsPerPage: perPageQuery, queryParamsLoading } @@ -112,6 +132,9 @@ export default defineComponent({ viewOptionsButtonLabel() { return this.$gettext('Display customization options of the files list') }, + resizeTilesLabel() { + return this.$gettext('Tile size') + }, hiddenFilesShownModel: { get() { @@ -137,6 +160,11 @@ export default defineComponent({ setViewMode(mode) { this.viewModeCurrent = mode.name }, + setTilesViewSize() { + document + .querySelector(':root') + .style.setProperty(`--oc-size-tiles-resize-step`, `${this.viewSizeCurrent * 12}rem`) + }, updateHiddenFilesShownModel(event) { this.hiddenFilesShownModel = event }, @@ -170,4 +198,39 @@ export default defineComponent({ margin-top: var(--oc-space-small); } } + +.oc-range { + -webkit-appearance: none; + -webkit-transition: 0.2s; + border-radius: 0.3rem; + background: var(--oc-color-input-border); + height: 0.5rem; + opacity: 0.7; + outline: none; + transition: opacity 0.2s; + width: 100%; + max-width: 50%; + + &:hover { + opacity: 1; + } + + &::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + background: var(--oc-color-swatch-primary-default); + border-radius: 50%; + cursor: pointer; + height: 1rem; + width: 1rem; + } + + &::-moz-range-thumb { + background: var(--oc-color-swatch-primary-default); + border-radius: 50%; + cursor: pointer; + height: 1rem; + width: 1rem; + } +} diff --git a/packages/web-app-files/src/components/FilesList/ResourceTiles.vue b/packages/web-app-files/src/components/FilesList/ResourceTiles.vue index d9d9006eeca..ab49da21272 100644 --- a/packages/web-app-files/src/components/FilesList/ResourceTiles.vue +++ b/packages/web-app-files/src/components/FilesList/ResourceTiles.vue @@ -1,17 +1,15 @@