Skip to content

Commit 20b0bda

Browse files
committed
🐛 尝试修复mac左上角窗口控制红绿灯按钮和颜色色块按钮不显示的问题
1 parent 9c130b4 commit 20b0bda

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

app/src/pages/_app.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,24 +245,31 @@ export default function App() {
245245
},
246246
)}
247247
>
248+
{/* mac的红绿灯,发现如果没有内容会看不见,里面加一个点儿 */}
248249
{isMac && (
249250
<Button className="right-4 top-4 flex items-center gap-2 active:scale-100">
250251
<div
251252
className="size-3 rounded-full bg-red-500 active:bg-red-800"
252253
onClick={() => getCurrentWindow().close()}
253-
></div>
254+
>
255+
.
256+
</div>
254257
<div
255258
className="size-3 rounded-full bg-yellow-500 active:bg-yellow-800"
256259
onClick={() => getCurrentWindow().minimize()}
257-
></div>
260+
>
261+
.
262+
</div>
258263
<div
259264
className="size-3 rounded-full bg-green-500 active:bg-green-800"
260265
onClick={() =>
261266
getCurrentWindow()
262267
.isMaximized()
263268
.then((isMaximized) => setMaxmized(!isMaximized))
264269
}
265-
></div>
270+
>
271+
.
272+
</div>
266273
</Button>
267274
)}
268275
{/* 左上角菜单按钮 */}

app/src/pages/_popup_panel/_color_panel.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Color } from "../../core/dataStruct/Color";
66
import { ColorManager } from "../../core/service/feedbackService/ColorManager";
77
import ColorManagerPanel from "./_color_manager_panel";
88
import { StageObjectColorManager } from "../../core/stage/stageManager/concreteMethods/StageObjectColorManager";
9+
import { isMac } from "../../utils/platform";
910
/**
1011
* 上色盘面板
1112
* @param param0
@@ -30,35 +31,45 @@ export default function ColorPanel() {
3031
const color = new Color(239, 68, 68);
3132
StageObjectColorManager.setSelectedStageObjectColor(color);
3233
}}
33-
/>
34+
>
35+
{isMac && "."}
36+
</div>
3437
<div
3538
className="m-1 h-5 w-5 cursor-pointer rounded bg-yellow-500 hover:scale-125"
3639
onClick={() => {
3740
const color = new Color(234, 179, 8);
3841
StageObjectColorManager.setSelectedStageObjectColor(color);
3942
}}
40-
/>
43+
>
44+
{isMac && "."}
45+
</div>
4146
<div
4247
className="m-1 h-5 w-5 cursor-pointer rounded bg-green-600 hover:scale-125"
4348
onClick={() => {
4449
const color = new Color(22, 163, 74);
4550
StageObjectColorManager.setSelectedStageObjectColor(color);
4651
}}
47-
/>
52+
>
53+
{isMac && "."}
54+
</div>
4855
<div
4956
className="m-1 h-5 w-5 cursor-pointer rounded bg-blue-500 hover:scale-125"
5057
onClick={() => {
5158
const color = new Color(59, 130, 246);
5259
StageObjectColorManager.setSelectedStageObjectColor(color);
5360
}}
54-
/>
61+
>
62+
{isMac && "."}
63+
</div>
5564
<div
5665
className="m-1 h-5 w-5 cursor-pointer rounded bg-purple-500 hover:scale-125"
5766
onClick={() => {
5867
const color = new Color(168, 85, 247);
5968
StageObjectColorManager.setSelectedStageObjectColor(color);
6069
}}
61-
/>
70+
>
71+
{isMac && "."}
72+
</div>
6273
{/* 清除颜色 */}
6374
<div
6475
className="m-1 h-5 w-5 animate-pulse cursor-pointer rounded bg-transparent text-center text-sm hover:scale-125"

0 commit comments

Comments
 (0)