This commit is contained in:
mattyatea 2024-01-24 01:14:06 +09:00
parent 7dd7c6ad4a
commit 6286e94f66
5 changed files with 30 additions and 31 deletions

View file

@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<XNavFolder <XNavFolder
:class="[$style.navPathItem, { [$style.navCurrent]: folder == null }]" :class="[$style.navPathItem, { [$style.navCurrent]: folder == null }]"
:parentFolder="folder" :parentFolder="folder"
:selectedFiles="selectedFiles" :selectedFiles="selectedFiles"
@move="move" @move="move"
@upload="upload" @upload="upload"
@removeFile="removeFile" @removeFile="removeFile"
@ -35,9 +35,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-if="folder != null" :class="[$style.navPathItem, $style.navCurrent]">{{ folder.name }}</span> <span v-if="folder != null" :class="[$style.navPathItem, $style.navCurrent]">{{ folder.name }}</span>
</div> </div>
<button v-if="!multiple" class="_button" :class="$style.navMenu" @click="filesSelect">複数選択モード</button> <button v-if="!multiple" class="_button" :class="$style.navMenu" @click="filesSelect">複数選択モード</button>
<span v-if="multiple && selectedFiles.length > 0" style="padding-right: 12px; margin-top: auto; margin-bottom: auto;opacity: 0.5;"> <span v-if="multiple && selectedFiles.length > 0" style="padding-right: 12px; margin-top: auto; margin-bottom: auto;opacity: 0.5;">
({{ number(selectedFiles.length) }}) ({{ number(selectedFiles.length) }})
</span> </span>
<button v-if="multiple" class="_button" :class="$style.navMenu" @click="filesSelect">複数選択モード解除</button> <button v-if="multiple" class="_button" :class="$style.navMenu" @click="filesSelect">複数選択モード解除</button>
<button v-if="multiple && selectedFiles.length === 0" style="padding-right: 12px;" class="_button" @click="filesAllSelect"> <button v-if="multiple && selectedFiles.length === 0" style="padding-right: 12px;" class="_button" @click="filesAllSelect">
全選択 全選択
@ -66,7 +66,7 @@ SPDX-License-Identifier: AGPL-3.0-only
:folder="f" :folder="f"
:selectMode="select === 'folder'" :selectMode="select === 'folder'"
:isSelected="selectedFolders.some(x => x.id === f.id)" :isSelected="selectedFolders.some(x => x.id === f.id)"
:selectedFiles="selectedFiles" :selectedFiles="selectedFiles"
@chosen="chooseFolder" @chosen="chooseFolder"
@move="move" @move="move"
@upload="upload" @upload="upload"
@ -90,7 +90,7 @@ SPDX-License-Identifier: AGPL-3.0-only
:selectMode="select === 'file'" :selectMode="select === 'file'"
:SelectFiles="selectedFiles" :SelectFiles="selectedFiles"
:isSelected="selectedFiles.some(x => x.id === file.id)" :isSelected="selectedFiles.some(x => x.id === file.id)"
@click.shift.left.exact="filesSelect" @click.shift.left.exact="filesSelect"
@chosen="chooseFile" @chosen="chooseFile"
@dragstart="isDragSource = true" @dragstart="isDragSource = true"
@dragend="isDragSource = false" @dragend="isDragSource = false"
@ -133,7 +133,7 @@ import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { uploadFile, uploads } from '@/scripts/upload.js'; import { uploadFile, uploads } from '@/scripts/upload.js';
import { claimAchievement } from '@/scripts/achievements.js'; import { claimAchievement } from '@/scripts/achievements.js';
import number from "@/filters/number.js"; import number from '@/filters/number.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
initialFolder?: Misskey.entities.DriveFolder; initialFolder?: Misskey.entities.DriveFolder;
@ -525,7 +525,7 @@ function removeFolder(folderToRemove: Misskey.entities.DriveFolder | string) {
function removeFile(file: Misskey.entities.DriveFile | string) { function removeFile(file: Misskey.entities.DriveFile | string) {
const fileId = typeof file === 'object' ? file.id : file; const fileId = typeof file === 'object' ? file.id : file;
files.value = files.value.filter(f => f.id !== fileId); files.value = files.value.filter(f => f.id !== fileId);
selectedFiles.value = selectedFiles.value.filter(f => f.id !== fileId); selectedFiles.value = selectedFiles.value.filter(f => f.id !== fileId);
} }
function appendFile(file: Misskey.entities.DriveFile) { function appendFile(file: Misskey.entities.DriveFile) {
@ -834,6 +834,7 @@ onBeforeUnmount(() => {
font-size: 0.9em; font-size: 0.9em;
box-shadow: 0 1px 0 var(--divider); box-shadow: 0 1px 0 var(--divider);
user-select: none; user-select: none;
height: 55px;
} }
.navPath { .navPath {
@ -841,6 +842,7 @@ onBeforeUnmount(() => {
vertical-align: bottom; vertical-align: bottom;
line-height: 42px; line-height: 42px;
white-space: nowrap; white-space: nowrap;
margin: auto 0;
} }
.navPathItem { .navPathItem {

View file

@ -53,7 +53,7 @@ export type Tab = {
</script> </script>
<script lang="ts" setup> <script lang="ts" setup>
import {onMounted, onUnmounted, watch, nextTick, shallowRef, ref, computed} from 'vue'; import { onMounted, onUnmounted, watch, nextTick, shallowRef, ref, computed } from 'vue';
import { defaultStore } from '@/store.js'; import { defaultStore } from '@/store.js';
const gamingType = computed(defaultStore.makeGetterSetter('gamingType')); const gamingType = computed(defaultStore.makeGetterSetter('gamingType'));
@ -232,6 +232,7 @@ onUnmounted(() => {
.tabIcon + .tabTitle { .tabIcon + .tabTitle {
padding-left: 4px; padding-left: 4px;
font-weight: 900;
} }
.tabTitle { .tabTitle {

View file

@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-else-if="!thin_ && narrow && !hideTitle" :class="$style.buttonsLeft"/> <div v-else-if="!thin_ && narrow && !hideTitle" :class="$style.buttonsLeft"/>
<template v-if="metadata"> <template v-if="metadata">
<div v-if="!hideTitle" :class="$style.titleContainer" @click="top"> <div v-if="!hideTitle && !hide" :class="$style.titleContainer" @click="top">
<div v-if="metadata.avatar" :class="$style.titleAvatarContainer"> <div v-if="metadata.avatar" :class="$style.titleAvatarContainer">
<MkAvatar :class="$style.titleAvatar" :user="metadata.avatar" indicator/> <MkAvatar :class="$style.titleAvatar" :user="metadata.avatar" indicator/>
</div> </div>
@ -56,6 +56,7 @@ const props = withDefaults(defineProps<{
actions?: PageHeaderItem[] | null; actions?: PageHeaderItem[] | null;
thin?: boolean; thin?: boolean;
displayMyAvatar?: boolean; displayMyAvatar?: boolean;
hide?:boolean;
}>(), { }>(), {
tabs: () => ([] as Tab[]), tabs: () => ([] as Tab[]),
}); });
@ -143,7 +144,7 @@ onUnmounted(() => {
} }
.upper { .upper {
--height: 50px; --height: 55px;
display: flex; display: flex;
gap: var(--margin); gap: var(--margin);
height: var(--height); height: var(--height);

View file

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader v-model:tab="tab" :tabs="headerTabs" hide="true" :actions="headerActions"/></template>
<MkSpacer :contentMax="800"> <MkSpacer :contentMax="800">
<MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs"> <MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs">
<div v-if="tab === 'all'" key="all"> <div v-if="tab === 'all'" key="all">
@ -31,6 +31,7 @@ import * as os from '@/os.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js'; import { definePageMetadata } from '@/scripts/page-metadata.js';
import { notificationTypes } from '@/const.js'; import { notificationTypes } from '@/const.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
const tab = ref('all'); const tab = ref('all');
const includeTypes = ref<string[] | null>(null); const includeTypes = ref<string[] | null>(null);
@ -67,19 +68,13 @@ function setFilter(ev) {
os.popupMenu(items, ev.currentTarget ?? ev.target); os.popupMenu(items, ev.currentTarget ?? ev.target);
} }
const headerActions = computed(() => [tab.value === 'all' ? { const headerActions = computed(() => [{
text: i18n.ts.filter, text: i18n.ts.filter,
icon: 'ti ti-filter', icon: 'ti ti-filter',
highlighted: includeTypes.value != null, highlighted: includeTypes.value != null,
handler: setFilter, handler: setFilter,
} : undefined, tab.value === 'all' ? { } ].filter(x => x !== undefined));
text: i18n.ts.markAllAsRead, misskeyApi('notifications/mark-all-as-read');
icon: 'ti ti-check',
handler: () => {
os.apiWithDialog('notifications/mark-all-as-read');
},
} : undefined].filter(x => x !== undefined));
const headerTabs = computed(() => [{ const headerTabs = computed(() => [{
key: 'all', key: 'all',
title: i18n.ts.all, title: i18n.ts.all,

View file

@ -253,10 +253,10 @@ const headerActions = computed(() => {
disabled: onlyFiles } : undefined, { disabled: onlyFiles } : undefined, {
type: 'switch', type: 'switch',
text: i18n.ts.withSensitive, text: i18n.ts.withSensitive,
ref: withSensitive, ref: withSensitive,
}, { }, {
type: 'switch', type: 'switch',
text: i18n.ts.fileAttachedOnly, text: i18n.ts.fileAttachedOnly,
ref: onlyFiles, ref: onlyFiles,
disabled: src.value === 'local' || src.value === 'social' ? withReplies : false, disabled: src.value === 'local' || src.value === 'social' ? withReplies : false,
@ -280,27 +280,27 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList
key: 'list:' + l.id, key: 'list:' + l.id,
title: l.name, title: l.name,
icon: 'ti ti-star', icon: 'ti ti-star',
iconOnly: true, iconOnly: false,
}))), { }))), {
key: 'home', key: 'home',
title: i18n.ts._timelines.home, title: i18n.ts._timelines.home,
icon: 'ti ti-home', icon: 'ti ti-home',
iconOnly: true, iconOnly: false,
}, ...(isLocalTimelineAvailable ? [{ }, ...(isLocalTimelineAvailable ? [{
key: 'local', key: 'local',
title: i18n.ts._timelines.local, title: i18n.ts._timelines.local,
icon: 'ti ti-planet', icon: 'ti ti-planet',
iconOnly: true, iconOnly: false,
}, ...(isShowMediaTimeline.value ? [{ }, ...(isShowMediaTimeline.value ? [{
key: 'media', key: 'media',
title: i18n.ts._timelines.media, title: i18n.ts._timelines.media,
icon: 'ti ti-photo', icon: 'ti ti-photo',
iconOnly: true, iconOnly: false,
}] : []), { }] : []), {
key: 'social', key: 'social',
title: i18n.ts._timelines.social, title: i18n.ts._timelines.social,
icon: 'ti ti-universe', icon: 'ti ti-universe',
iconOnly: true, iconOnly: false,
}] : []), ...(remoteLocalTimelineEnable1.value ? [{ }] : []), ...(remoteLocalTimelineEnable1.value ? [{
key: 'custom-timeline-1', key: 'custom-timeline-1',
title: defaultStore.state.remoteLocalTimelineName1, title: defaultStore.state.remoteLocalTimelineName1,
@ -330,7 +330,7 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList
key: 'global', key: 'global',
title: i18n.ts._timelines.global, title: i18n.ts._timelines.global,
icon: 'ti ti-whirl', icon: 'ti ti-whirl',
iconOnly: true, iconOnly: false,
}] : []), { }] : []), {
icon: 'ti ti-list', icon: 'ti ti-list',
title: i18n.ts.lists, title: i18n.ts.lists,