feat(theseus): Update to Tauri v2 (#2178)

* feat(theseus): Initial migration to Tauri v2

* feat(theseus): Added a way to zoom / scale UI

* chore(theseus): Started cleaning up some plugins

* fix(theseus): Github Actions

* refactor(theseus): Reduced boilerplate & more work

* feat(theseus): Allow multiple app instances to be open at once (#995)

* fix(theseus): Lint & more

* fix(theseus): App Release github action

* fix(theseus): Open links in browser & macos builds

* fix(theseus): Rebase fixes

* fix(theseus): Updater & app release action

* fix(theseus): Fixed definitions in `build.rs`

* Fix MacOS deep linking, window decorations

* fix(theseus): Closing & maximizing app

* Fix macos build

* add back release conf

* acc fix build

* make updater for release builds only

* focus window on startup

---------

Co-authored-by: Jai A <jaiagr+gpg@pm.me>
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Norbiros
2024-08-27 21:49:36 +02:00
committed by GitHub
parent 396f737612
commit d6a72fbfc4
83 changed files with 15614 additions and 2013 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { DropdownIcon, FolderOpenIcon, SearchIcon } from '@modrinth/assets'
import { Button, OverflowMenu } from '@modrinth/ui'
import { open } from '@tauri-apps/api/dialog'
import { open } from '@tauri-apps/plugin-dialog'
import { add_project_from_path } from '@/helpers/profile.js'
import { handleError } from '@/store/notifications.js'
import { useRouter } from 'vue-router'

View File

@@ -4,7 +4,7 @@ import { Button, Checkbox, Modal } from '@modrinth/ui'
import { PackageIcon, VersionIcon } from '@/assets/icons'
import { ref } from 'vue'
import { export_profile_mrpack, get_pack_export_candidates } from '@/helpers/profile.js'
import { open } from '@tauri-apps/api/dialog'
import { open } from '@tauri-apps/plugin-dialog'
import { handleError } from '@/store/notifications.js'
import { useTheming } from '@/store/theme'

View File

@@ -3,7 +3,7 @@ import { onUnmounted, ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { StopCircleIcon, PlayIcon } from '@modrinth/assets'
import { Card, Avatar, AnimatedLogo } from '@modrinth/ui'
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { convertFileSrc } from '@tauri-apps/api/core'
import { kill, run } from '@/helpers/profile'
import { get_by_profile_path } from '@/helpers/process'
import { process_listener } from '@/helpers/events'

View File

@@ -211,8 +211,8 @@ import { Avatar, Button, Chips, Modal, Checkbox } from '@modrinth/ui'
import { computed, onUnmounted, ref, shallowRef } from 'vue'
import { get_loaders } from '@/helpers/tags'
import { create } from '@/helpers/profile'
import { open } from '@tauri-apps/api/dialog'
import { tauri } from '@tauri-apps/api'
import { open } from '@tauri-apps/plugin-dialog'
import { convertFileSrc } from '@tauri-apps/api/core'
import { get_game_versions, get_loader_versions } from '@/helpers/metadata'
import { handleError } from '@/store/notifications.js'
import Multiselect from 'vue-multiselect'
@@ -382,7 +382,7 @@ const upload_icon = async () => {
})
if (!icon.value) return
display_icon.value = tauri.convertFileSrc(icon.value)
display_icon.value = convertFileSrc(icon.value)
}
const reset_icon = () => {

View File

@@ -63,7 +63,7 @@ import {
import { Button } from '@modrinth/ui'
import { auto_install_java, find_filtered_jres, get_jre, test_jre } from '@/helpers/jre.js'
import { ref } from 'vue'
import { open } from '@tauri-apps/api/dialog'
import { open } from '@tauri-apps/plugin-dialog'
import JavaDetectionModal from '@/components/ui/JavaDetectionModal.vue'
import { mixpanel_track } from '@/helpers/mixpanel'
import { handleError } from '@/store/state.js'

View File

@@ -1,10 +1,10 @@
<template>
<div v-if="!hidden" class="splash-screen dark" :class="{ 'fade-out': doneLoading }">
<div v-if="os !== 'MacOS'" class="app-buttons">
<button class="btn icon-only transparent" icon-only @click="() => appWindow.minimize()">
<button class="btn icon-only transparent" icon-only @click="() => getCurrent().minimize()">
<MinimizeIcon />
</button>
<button class="btn icon-only transparent" @click="() => appWindow.toggleMaximize()">
<button class="btn icon-only transparent" @click="() => getCurrent().toggleMaximize()">
<MaximizeIcon />
</button>
<button class="btn icon-only transparent" @click="handleClose">
@@ -85,12 +85,11 @@
import { ref, watch } from 'vue'
import ProgressBar from '@/components/ui/ProgressBar.vue'
import { loading_listener } from '@/helpers/events.js'
import { appWindow } from '@tauri-apps/api/window'
import { getCurrentWindow } from '@tauri-apps/api/window'
import { XIcon } from '@modrinth/assets'
import { MaximizeIcon, MinimizeIcon } from '@/assets/icons/index.js'
import { window as TauriWindow } from '@tauri-apps/api'
import { TauriEvent } from '@tauri-apps/api/event'
import { saveWindowState, StateFlags } from 'tauri-plugin-window-state-api'
import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state'
import { getOS } from '@/helpers/utils.js'
import { useLoading } from '@/store/loading.js'
@@ -138,13 +137,8 @@ loading_listener(async (e) => {
})
const handleClose = async () => {
await saveWindowState(StateFlags.ALL)
await TauriWindow.getCurrent().close()
await getCurrentWindow().close()
}
TauriWindow.getCurrent().listen(TauriEvent.WINDOW_CLOSE_REQUESTED, async () => {
await handleClose()
})
</script>
<style scoped lang="scss">

View File

@@ -16,13 +16,13 @@ import {
list,
create,
} from '@/helpers/profile'
import { open } from '@tauri-apps/api/dialog'
import { open } from '@tauri-apps/plugin-dialog'
import { installVersionDependencies } from '@/store/install.js'
import { handleError } from '@/store/notifications.js'
import { mixpanel_track } from '@/helpers/mixpanel'
import { useTheming } from '@/store/theme.js'
import { useRouter } from 'vue-router'
import { tauri } from '@tauri-apps/api'
import { convertFileSrc } from '@tauri-apps/api/core'
const themeStore = useTheming()
const router = useRouter()
@@ -153,7 +153,7 @@ const upload_icon = async () => {
})
if (!icon.value) return
display_icon.value = tauri.convertFileSrc(icon.value)
display_icon.value = convertFileSrc(icon.value)
}
const reset_icon = () => {