diff --git a/src/renderer/components/material/SongList.vue b/src/renderer/components/material/SongList.vue index a65c866d..53d3475d 100644 --- a/src/renderer/components/material/SongList.vue +++ b/src/renderer/components/material/SongList.vue @@ -14,7 +14,7 @@ div(:class="$style.songList") th.nobreak(:style="{ width: rowWidth.r6 }") {{$t('material.song_list.action')}} div(:class="$style.content") div(v-if="list.length" :class="$style.content" ref="dom_listContent") - material-virtualized-list(:list="list" key-name="songmid" ref="list" :item-height="37" + material-virtualized-list(:list="list" key-name="songmid" ref="list" :item-height="listItemHeight" containerClass="scroll" contentClass="list" @contextmenu.native.capture="handleContextMenu") template(#default="{ item, index }") div.list-item(@click="handleDoubleClick($event, index)" @contextmenu="handleListItemRigthClick($event, index)" @@ -72,6 +72,7 @@ div(:class="$style.songList") import { mapGetters } from 'vuex' import { scrollTo, clipboardWriteText, assertApiSupport } from '../../utils' import musicSdk from '../../utils/music' +import { windowSizeList } from '@common/config' export default { name: 'MaterialSongList', model: { @@ -162,6 +163,9 @@ export default { }, ] }, + listItemHeight() { + return parseInt(windowSizeList.find(item => item.id == this.setting.windowSizeId).fontSize) / 16 * 37 + }, }, watch: { // selectdList(n) { diff --git a/src/renderer/components/material/VirtualizedList.vue b/src/renderer/components/material/VirtualizedList.vue index 54148621..5a6a9e2e 100644 --- a/src/renderer/components/material/VirtualizedList.vue +++ b/src/renderer/components/material/VirtualizedList.vue @@ -178,7 +178,7 @@ export default { // console.log(continuous) // debugger if (continuous) { - if (Math.abs(currentScrollTop - this.scrollTop) < this.itemHeight * 5) return + if (Math.abs(currentScrollTop - this.scrollTop) < this.itemHeight * this.outsideNum * 0.6) return // console.log('update') if (currentScrollTop > this.scrollTop) { // scroll down // console.log('scroll down') diff --git a/src/renderer/views/Download.vue b/src/renderer/views/Download.vue index bbff13d4..0a89dcde 100644 --- a/src/renderer/views/Download.vue +++ b/src/renderer/views/Download.vue @@ -15,7 +15,7 @@ div(:class="$style.download") th.nobreak(style="width: 10%;") {{$t('view.download.quality')}} th.nobreak(style="width: 13%;") {{$t('view.download.action')}} div(v-if="list.length" :class="$style.content" ref="dom_listContent") - material-virtualized-list(:list="showList" key-name="key" ref="list" :item-height="37" #default="{ item, index }" + material-virtualized-list(:list="showList" key-name="key" ref="list" :item-height="listItemHeight" #default="{ item, index }" containerClass="scroll" contentClass="list") div.list-item(@click="handleDoubleClick($event, index)" @contextmenu="handleListItemRigthClick($event, index)" :class="[{[$style.active]: playListIndex == index }, { selected: selectedIndex == index }, { active: selectedData.includes(item) }]") @@ -39,6 +39,7 @@ import { mapGetters, mapActions, mapMutations } from 'vuex' import { checkPath, openDirInExplorer, openUrl } from '../utils' import musicSdk from '../utils/music' import path from 'path' +import { windowSizeList } from '@common/config' export default { name: 'Download', @@ -171,6 +172,9 @@ export default { }, ] }, + listItemHeight() { + return parseInt(windowSizeList.find(item => item.id == this.setting.windowSizeId).fontSize) / 16 * 37 + }, }, watch: { list() { diff --git a/src/renderer/views/List.vue b/src/renderer/views/List.vue index dc07029f..469c6447 100644 --- a/src/renderer/views/List.vue +++ b/src/renderer/views/List.vue @@ -37,7 +37,7 @@ th.nobreak(style="width: 9%;") {{$t('view.list.time')}} th.nobreak(style="width: 15%;") {{$t('view.list.action')}} div(v-if="list.length" :class="$style.content" ref="dom_listContent") - material-virtualized-list(:list="list" key-name="songmid" ref="list" #default="{ item, index }" :item-height="37" + material-virtualized-list(:list="list" key-name="songmid" ref="list" #default="{ item, index }" :item-height="listItemHeight" @scroll="handleScroll" containerClass="scroll" contentClass="list" @contextmenu.native.capture="handleContextMenu") div.list-item(@click="handleDoubleClick($event, index)" :class="[{ [$style.active]: isPlayList && playInfo.playIndex === index }, { selected: selectedIndex == index }, { active: selectdListDetailData.includes(item) }, { [$style.disabled]: !assertApiSupport(item.source) }]" @@ -73,6 +73,7 @@ import { mapMutations, mapGetters, mapActions } from 'vuex' import { clipboardWriteText, assertApiSupport, openUrl, openSaveDir, saveLxConfigFile, selectDir, readLxConfigFile, filterFileName } from '../utils' import musicSdk from '../utils/music' import { setListPosition, getListPosition, getListPrevSelectId } from '@renderer/utils/data' +import { windowSizeList } from '@common/config' export default { @@ -88,7 +89,6 @@ export default { selectdListData: [], // isShowEditBtn: false, isShowDownloadMultiple: false, - delayShow: false, isShowListAdd: false, isShowListAddMultiple: false, isShowListSortModal: false, @@ -286,6 +286,9 @@ export default { }, ] }, + listItemHeight() { + return parseInt(windowSizeList.find(item => item.id == this.setting.windowSizeId).fontSize) / 16 * 37 + }, }, watch: { // selectdListDetailData(n) { @@ -313,7 +316,6 @@ export default { if (to.query.scrollIndex != null) this.isToggleList = false return next() } - this.delayShow = false this.$nextTick(() => { this.listId = to.query.id this.$nextTick(() => { @@ -434,7 +436,7 @@ export default { if (!this.list.length) return if (index == null) { let location = getListPosition(this.listData.id) || 0 - if (this.setting.list.isSaveScrollLocation && location) { + if (this.setting.list.isSaveScrollLocation && location != null) { this.$nextTick(() => { this.$refs.list.scrollTo(location) })