Replace dropdownbutton
This commit is contained in:
parent
233c9adf47
commit
3fd1a6bb93
@ -434,7 +434,7 @@ command_listener(async (e) => {
|
|||||||
background-color: var(--color-raised-bg);
|
background-color: var(--color-raised-bg);
|
||||||
color: var(--color-base);
|
color: var(--color-base);
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
height: 3.25rem;
|
height: var(--appbar-height);
|
||||||
|
|
||||||
&.close {
|
&.close {
|
||||||
&:hover,
|
&:hover,
|
||||||
@ -483,7 +483,7 @@ command_listener(async (e) => {
|
|||||||
|
|
||||||
.router-view {
|
.router-view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 3.125rem);
|
height: calc(100% - var(--appbar-height));
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
background-color: var(--color-bg);
|
background-color: var(--color-bg);
|
||||||
|
|||||||
@ -43,23 +43,27 @@
|
|||||||
Update all
|
Update all
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<!-- <DropdownButton
|
<div v-if="!isPackLocked" class="joined-buttons">
|
||||||
v-if="!isPackLocked"
|
<Button color="primary" @click="onSearchContent">
|
||||||
:options="['search', 'from_file']"
|
|
||||||
default-value="search"
|
|
||||||
name="add-content-dropdown"
|
|
||||||
color="primary"
|
|
||||||
@option-click="handleContentOptionClick"
|
|
||||||
>
|
|
||||||
<template #search>
|
|
||||||
<SearchIcon />
|
<SearchIcon />
|
||||||
<span class="no-wrap"> Add content </span>
|
Add content
|
||||||
</template>
|
</Button>
|
||||||
<template #from_file>
|
<OverflowMenu
|
||||||
|
:options="[
|
||||||
|
{
|
||||||
|
id: 'file',
|
||||||
|
action: onFileContent,
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
class="btn btn-primary btn-dropdown-animation icon-only"
|
||||||
|
>
|
||||||
|
<DropdownIcon />
|
||||||
|
<template #file>
|
||||||
<FolderOpenIcon />
|
<FolderOpenIcon />
|
||||||
<span class="no-wrap"> Add from file </span>
|
Add from file
|
||||||
</template>
|
</template>
|
||||||
</DropdownButton> -->
|
</OverflowMenu>
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<Pagination
|
<Pagination
|
||||||
v-if="projects.length > 0"
|
v-if="projects.length > 0"
|
||||||
@ -283,26 +287,26 @@
|
|||||||
</div>
|
</div>
|
||||||
<h3>No projects found</h3>
|
<h3>No projects found</h3>
|
||||||
<p class="empty-subtitle">Add a project to get started</p>
|
<p class="empty-subtitle">Add a project to get started</p>
|
||||||
<div class="empty-action">
|
<div v-if="!isPackLocked" class="joined-buttons">
|
||||||
<div class="joined-buttons">
|
<Button color="primary" @click="onSearchContent">
|
||||||
<Button color="primary"> Search </Button>
|
|
||||||
</div>
|
|
||||||
<!-- <DropdownButton
|
|
||||||
:options="['search', 'from_file']"
|
|
||||||
default-value="search"
|
|
||||||
name="add-content-dropdown-from-empty"
|
|
||||||
color="primary"
|
|
||||||
@option-click="handleContentOptionClick"
|
|
||||||
>
|
|
||||||
<template #search>
|
|
||||||
<SearchIcon />
|
<SearchIcon />
|
||||||
<span class="no-wrap"> Add content </span>
|
Add content
|
||||||
</template>
|
</Button>
|
||||||
<template #from_file>
|
<OverflowMenu
|
||||||
|
:options="[
|
||||||
|
{
|
||||||
|
id: 'file',
|
||||||
|
action: onFileContent,
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
class="btn btn-primary btn-dropdown-animation icon-only"
|
||||||
|
>
|
||||||
|
<DropdownIcon />
|
||||||
|
<template #file>
|
||||||
<FolderOpenIcon />
|
<FolderOpenIcon />
|
||||||
<span class="no-wrap"> Add from file </span>
|
Add from file
|
||||||
</template>
|
</template>
|
||||||
</DropdownButton> -->
|
</OverflowMenu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Pagination
|
<Pagination
|
||||||
@ -393,9 +397,10 @@ import {
|
|||||||
CodeIcon,
|
CodeIcon,
|
||||||
Pagination,
|
Pagination,
|
||||||
DropdownSelect,
|
DropdownSelect,
|
||||||
|
OverflowMenu,
|
||||||
} from 'omorphia'
|
} from 'omorphia'
|
||||||
import { computed, onUnmounted, ref, watch } from 'vue'
|
import { computed, onUnmounted, ref, watch } from 'vue'
|
||||||
// import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import {
|
import {
|
||||||
add_project_from_path,
|
add_project_from_path,
|
||||||
get,
|
get,
|
||||||
@ -406,7 +411,7 @@ import {
|
|||||||
} from '@/helpers/profile.js'
|
} from '@/helpers/profile.js'
|
||||||
import { handleError } from '@/store/notifications.js'
|
import { handleError } from '@/store/notifications.js'
|
||||||
import { mixpanel_track } from '@/helpers/mixpanel'
|
import { mixpanel_track } from '@/helpers/mixpanel'
|
||||||
// import { open } from '@tauri-apps/api/dialog'
|
import { open } from '@tauri-apps/api/dialog'
|
||||||
import { listen } from '@tauri-apps/api/event'
|
import { listen } from '@tauri-apps/api/event'
|
||||||
import { convertFileSrc } from '@tauri-apps/api/tauri'
|
import { convertFileSrc } from '@tauri-apps/api/tauri'
|
||||||
import { highlightModInProfile } from '@/helpers/utils.js'
|
import { highlightModInProfile } from '@/helpers/utils.js'
|
||||||
@ -414,7 +419,7 @@ import { MenuIcon, ToggleIcon, TextInputIcon, AddProjectImage, PackageIcon } fro
|
|||||||
import ExportModal from '@/components/ui/ExportModal.vue'
|
import ExportModal from '@/components/ui/ExportModal.vue'
|
||||||
import ModpackVersionModal from '@/components/ui/ModpackVersionModal.vue'
|
import ModpackVersionModal from '@/components/ui/ModpackVersionModal.vue'
|
||||||
|
|
||||||
// const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
instance: {
|
instance: {
|
||||||
@ -846,22 +851,22 @@ const handleRightClick = (event, mod) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const handleContentOptionClick = async (args) => {
|
const onSearchContent = async () => {
|
||||||
// if (args.option === 'search') {
|
await router.push({
|
||||||
// await router.push({
|
path: `/browse/${props.instance.metadata.loader === 'vanilla' ? 'datapack' : 'mod'}`,
|
||||||
// path: `/browse/${props.instance.metadata.loader === 'vanilla' ? 'datapack' : 'mod'}`,
|
query: { i: props.instance.path },
|
||||||
// query: { i: props.instance.path },
|
})
|
||||||
// })
|
}
|
||||||
// } else if (args.option === 'from_file') {
|
|
||||||
// const newProject = await open({ multiple: true })
|
|
||||||
// if (!newProject) return
|
|
||||||
|
|
||||||
// for (const project of newProject) {
|
const onFileContent = async () => {
|
||||||
// await add_project_from_path(props.instance.path, project, 'mod').catch(handleError)
|
const newProject = await open({ multiple: true })
|
||||||
// }
|
if (!newProject) return
|
||||||
// initProjects(await get(props.instance.path).catch(handleError))
|
|
||||||
// }
|
for (const project of newProject) {
|
||||||
// }
|
await add_project_from_path(props.instance.path, project, 'mod').catch(handleError)
|
||||||
|
}
|
||||||
|
initProjects(await get(props.instance.path).catch(handleError))
|
||||||
|
}
|
||||||
|
|
||||||
watch(selectAll, () => {
|
watch(selectAll, () => {
|
||||||
for (const [key, value] of Array.from(selectionMap.value)) {
|
for (const [key, value] of Array.from(selectionMap.value)) {
|
||||||
@ -961,12 +966,20 @@ onUnmounted(() => {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
:deep(.dropdown-row) {
|
:deep {
|
||||||
|
.popup-container {
|
||||||
.btn {
|
.btn {
|
||||||
height: 2.5rem !important;
|
height: 2.5rem !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-row {
|
||||||
|
.btn {
|
||||||
|
height: 2.5rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
height: 2.5rem;
|
height: 2.5rem;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user