Skip to content

Commit 0775faa

Browse files
committed
chore: updates
1 parent 8c6819c commit 0775faa

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

electron/main/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ app.whenReady().then(() => {
110110
click: () => {
111111
winAbout = new BrowserWindow({
112112
// alwaysOnTop: true,
113+
autoHideMenuBar: true,
113114
movable: false,
114115
minimizable: false,
115116
maximizable: false,

src/components/layout.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,22 @@ const Layout = () => {
7979
</>
8080
);
8181
}
82+
const isMac = process.platform == "darwin";
8283
const contextMenuVisible = Object.values(menuVisibleMap).some((v) => v);
8384
return (
8485
<>
85-
{process.platform == "darwin" && <TitleBar />}
86-
<section className="flex h-screen select-none bg-transparent">
86+
{!isMac && <TitleBar />}
87+
<section
88+
className={clsx(
89+
"flex select-none bg-transparent",
90+
isMac ? "h-screen" : "h-[calc(100vh_-_48px)]"
91+
)}
92+
>
8793
<aside
8894
className={clsx(
8995
"flex h-full w-[66px] flex-col items-center gap-3 bg-neutral-200 dark:bg-gray-900",
9096
contextMenuVisible ? "" : "app-drag",
91-
process.platform == "darwin" ? "pt-8" : "pt-0"
97+
isMac ? "pt-8" : "pt-1"
9298
)}
9399
>
94100
<ul className="flex w-full flex-col gap-2 py-1 text-lg text-gray-900 dark:text-gray-100">
@@ -208,7 +214,7 @@ const Layout = () => {
208214

209215
{contextMenuVisible ? (
210216
<div className="menu-mask fixed left-0 top-0 z-10 h-full w-full"></div>
211-
) : process.platform == "darwin" ? (
217+
) : isMac ? (
212218
<div className="app-drag fixed left-0 top-0 z-50 h-6 w-full"></div>
213219
) : null}
214220
</section>

src/components/titlebar.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const TitleBar = () => {
2626
break;
2727
}
2828
};
29+
const btnClass = "outline-none rounded-sm p-3 hover:bg-gray-200 dark:hover:bg-gray-800";
2930
return (
3031
<header
3132
onDoubleClick={handleControl.bind(null, "max")}
@@ -34,22 +35,13 @@ const TitleBar = () => {
3435
<img className="h-5 w-5" src={IconLogo} />
3536
<span className="text-sm text-gray-800 dark:text-gray-200">VoceChat</span>
3637
<div className="app-no-drag absolute right-3.5 top-1/2 flex -translate-y-1/2 items-center">
37-
<button
38-
onClick={handleControl.bind(null, "mini")}
39-
className="rounded-sm p-3 hover:bg-gray-200 dark:hover:bg-gray-800"
40-
>
38+
<button onClick={handleControl.bind(null, "mini")} className={btnClass}>
4139
<IconMini className="dark:fill-gray-100" />
4240
</button>
43-
<button
44-
onClick={handleControl.bind(null, "fullscreen")}
45-
className="rounded-sm p-3 hover:bg-gray-200 dark:hover:bg-gray-800"
46-
>
41+
<button onClick={handleControl.bind(null, "fullscreen")} className={btnClass}>
4742
<IconMax className="dark:fill-gray-100" />
4843
</button>
49-
<button
50-
onClick={handleControl.bind(null, "close")}
51-
className="rounded-sm p-3 hover:bg-gray-200 dark:hover:bg-gray-800"
52-
>
44+
<button onClick={handleControl.bind(null, "close")} className={btnClass}>
5345
<IconClose className="dark:fill-gray-100" />
5446
</button>
5547
</div>

src/main.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import ReactDOM from "react-dom/client";
33
import { Provider } from "react-redux";
44
import App from "./app";
55
import store from "./app/store";
6-
import "./samples/node-api";
76
import "./assets/css/base.css";
87
import "./components/tippyjs-setting";
98

@@ -14,5 +13,9 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
1413
</Provider>
1514
</React.StrictMode>
1615
);
16+
// 去除非mac系统的滚动条
17+
if (process.platform !== "darwin") {
18+
document.body.classList.add("overflow-hidden");
19+
}
1720

1821
postMessage({ payload: "removeLoading" }, "*");

0 commit comments

Comments
 (0)