[Update/Prepare] Prepare for window transparency feature.

This commit is contained in:
Sakamoto Shiina
2024-07-30 05:31:00 +09:00
parent 4c82f72c8f
commit 4e7667e277
4 changed files with 22 additions and 14 deletions

View File

@@ -32,6 +32,9 @@ html, body {
#root {
height: 100%;
/* For controlling a whole window transparency */
opacity: 1;
}
/* SVG内のすべての要素にfillを適用 (colorの調整をcssでするため) */

View File

@@ -1,6 +1,6 @@
import { getCurrent } from "@tauri-apps/api/window";
import { useEffect, useRef } from "react";
import styles from "./MainWindow.module.scss";
import { SidebarSection } from "./sidebar_section/SidebarSection";
import { MainSection } from "./main_section/MainSection";
import { useStartPython } from "@logics/useStartPython";
@@ -8,8 +8,10 @@ import { useStartPython } from "@logics/useStartPython";
export const MainWindow = () => {
const { asyncStartPython } = useStartPython();
const hasRunRef = useRef(false);
const main_window = getCurrent();
useEffect(() => {
main_window.setDecorations(true);
if (!hasRunRef.current) {
asyncStartPython();
}