mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 03:32:36 +08:00
Co-authored-by: tyliu9 <tyliu9@toycloud.com>
This commit is contained in:
parent
6c7afd168a
commit
0e82426ea1
|
@ -8,18 +8,29 @@ import {
|
||||||
PushPinOutlined,
|
PushPinOutlined,
|
||||||
PushPinRounded,
|
PushPinRounded,
|
||||||
} from "@mui/icons-material";
|
} from "@mui/icons-material";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
export const LayoutControl = () => {
|
export const LayoutControl = () => {
|
||||||
const minWidth = 40;
|
const minWidth = 40;
|
||||||
|
|
||||||
const [isMaximized, setIsMaximized] = useState(false);
|
const [isMaximized, setIsMaximized] = useState(false);
|
||||||
const [isPined, setIsPined] = useState(false);
|
const [isPined, setIsPined] = useState(false);
|
||||||
appWindow.onResized(() => {
|
|
||||||
appWindow.isMaximized().then((isMaximized) => {
|
useEffect(() => {
|
||||||
setIsMaximized(() => isMaximized);
|
const unlistenResized = appWindow.onResized(() => {
|
||||||
|
appWindow.isMaximized().then((maximized) => {
|
||||||
|
setIsMaximized(() => maximized);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
appWindow.isMaximized().then((maximized) => {
|
||||||
|
setIsMaximized(() => maximized);
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
unlistenResized.then((fn) => fn());
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ButtonGroup
|
<ButtonGroup
|
||||||
|
|
Loading…
Reference in New Issue
Block a user