[Update] Combine in one window. Rename Main/Config Window to Main/Config Page accordingly.

For now, I put Config Page to below the main page temporary. Open Config Button does not work.
This commit is contained in:
Sakamoto Shiina
2024-08-09 12:23:17 +09:00
parent af1cdd2d7b
commit 3ed3d5eb40
118 changed files with 175 additions and 192 deletions

View File

@@ -62,9 +62,9 @@ export const useMainFunction = () => {
},
toggleForeground: () => {
const main_window = getCurrent();
const main_page = getCurrent();
const is_foreground_enabled = !currentForegroundStatus.data;
main_window.setAlwaysOnTop(is_foreground_enabled);
main_page.setAlwaysOnTop(is_foreground_enabled);
updateForegroundStatus(is_foreground_enabled);
},

View File

@@ -1,44 +1,44 @@
import { WebviewWindow } from "@tauri-apps/api/window";
import { store, useIsOpenedConfigWindow } from "@store";
import { store, useIsOpenedConfigPage } from "@store";
import { getCurrent } from "@tauri-apps/api/window";
export const useWindow = () => {
const { updateIsOpenedConfigWindow } = useIsOpenedConfigWindow();
const { updateIsOpenedConfigPage } = useIsOpenedConfigPage();
const createConfigWindow = async () => {
const main_window = getCurrent();
if (store.config_window === null) {
const config_window = new WebviewWindow("vrct_config_window",{
url: "./src-ui/windows/config_window/index.html",
const createConfigPage = async () => {
const main_page = getCurrent();
if (store.config_page === null) {
const config_page = new WebviewWindow("vrct_config_page",{
url: "./src-ui/windows/config_page/index.html",
center: true,
width: 1080,
height: 700,
title: "Settings"
});
config_window.once("tauri://created", function () {
store.config_window = config_window;
updateIsOpenedConfigWindow(true);
config_page.once("tauri://created", function () {
store.config_page = config_page;
updateIsOpenedConfigPage(true);
});
config_window.once("tauri://error", function (e) {
config_page.once("tauri://error", function (e) {
console.log(e);
});
const unlisten_d = config_window.once("tauri://destroyed", (event) => {
store.config_window = null;
updateIsOpenedConfigWindow(false);
const unlisten_d = config_page.once("tauri://destroyed", (event) => {
store.config_page = null;
updateIsOpenedConfigPage(false);
unlisten_d();
});
main_window.onCloseRequested((event) => {
config_window.close();
main_page.onCloseRequested((event) => {
config_page.close();
});
}
};
const closeConfigWindow = () => {
store.config_window.close();
const closeConfigPage = () => {
store.config_page.close();
};
return { createConfigWindow, closeConfigWindow };
return { createConfigPage, closeConfigPage };
};