@@ -23,7 +23,7 @@ import { StageSaveManager } from "../core/service/dataFileService/StageSaveManag
2323import { Settings } from "../core/service/Settings" ;
2424import { Stage } from "../core/stage/Stage" ;
2525import { StageDumper } from "../core/stage/StageDumper" ;
26- import { fileAtom , isWindowCollapsingAtom } from "../state" ;
26+ import { fileAtom , isClassroomModeAtom , isWindowCollapsingAtom } from "../state" ;
2727import { cn } from "../utils/cn" ;
2828import { PathString } from "../utils/pathString" ;
2929import { appScale , getCurrentWindow , isDesktop , isMac , isMobile , isWeb } from "../utils/platform" ;
@@ -48,6 +48,7 @@ export default function App() {
4848 const navigate = useNavigate ( ) ;
4949 const location = useLocation ( ) ;
5050 const [ file , setFile ] = useAtom ( fileAtom ) ;
51+ const [ isClassroomMode ] = useAtom ( isClassroomModeAtom ) ;
5152 const filename = React . useMemo ( ( ) => PathString . absolute2file ( file ) , [ file ] ) ;
5253 const [ useNativeTitleBar , setUseNativeTitleBar ] = React . useState ( false ) ;
5354 const [ isWindowCollapsing , setIsWindowCollapsing ] = useAtom ( isWindowCollapsingAtom ) ;
@@ -249,6 +250,7 @@ export default function App() {
249250 { /* 左上角菜单按钮 */ }
250251 < IconButton
251252 tooltip = "菜单"
253+ className = { cn ( isClassroomMode && "opacity-0" ) }
252254 onClick = { ( e ) => {
253255 if ( location . pathname !== "/" ) {
254256 if ( location . pathname . startsWith ( "/welcome" ) ) {
@@ -277,21 +279,25 @@ export default function App() {
277279 >
278280 { location . pathname === "/" ? isMenuOpen ? < RectangleEllipsis /> : < Menu /> : < ChevronLeft /> }
279281 </ IconButton >
282+
280283 < IconButton
281284 onClick = { ( e ) => {
282285 e . stopPropagation ( ) ;
283286 setIsTagPanelOpen ( ! isTagPanelOpen ) ;
284287 } }
285288 tooltip = "标签节点"
289+ className = { cn ( isClassroomMode && "opacity-0" ) }
286290 >
287291 < Tag className = { cn ( "cursor-pointer" , isTagPanelOpen ? "rotate-90" : "" ) } />
288292 </ IconButton >
293+
289294 { /* 逻辑节点按钮 */ }
290295 < IconButton
291296 onClick = { ( e ) => {
292297 e . stopPropagation ( ) ;
293298 setIsLogicNodePanelOpen ( ! isLogicNodePanelOpen ) ;
294299 } }
300+ className = { cn ( isClassroomMode && "opacity-0" ) }
295301 tooltip = "逻辑节点"
296302 >
297303 < Cpu className = { cn ( "cursor-pointer" , isLogicNodePanelOpen ? "rotate-45" : "" ) } />
@@ -307,6 +313,7 @@ export default function App() {
307313 className = { cn ( "hover:cursor-move active:scale-100 active:cursor-grabbing" , {
308314 "text-yellow-500" : isSaved ,
309315 "flex-1" : isDesktop ,
316+ "opacity-0" : isClassroomMode ,
310317 } ) }
311318 tooltip = "拖动窗口"
312319 >
@@ -319,6 +326,7 @@ export default function App() {
319326 className = { cn (
320327 isSaved ? "text-icon-button-text" : "text-yellow-500" ,
321328 "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" ,
329+ isClassroomMode && "opacity-0" ,
322330 ) }
323331 >
324332 { filename + ( isSaved ? "" : t ( "unsaved" ) ) }
@@ -332,14 +340,15 @@ export default function App() {
332340 e . stopPropagation ( ) ;
333341 setIsStartFilePanelOpen ( ! isStartFilePanelOpen ) ;
334342 } }
343+ className = { cn ( isClassroomMode && "opacity-0" ) }
335344 tooltip = "设置启动时打开的文件"
336345 disabled = { isMobile }
337346 >
338347 < Zap className = { cn ( "cursor-pointer" , isStartFilePanelOpen ? "rotate-45 scale-125" : "" ) } />
339348 </ IconButton >
340349 { isDesktop && (
341350 < IconButton
342- className = { cn ( isWindowCollapsing && "animate-bounce" ) }
351+ className = { cn ( isWindowCollapsing && "animate-bounce" , isClassroomMode && "opacity-0" ) }
343352 onClick = { async ( e ) => {
344353 e . stopPropagation ( ) ;
345354 // const size = await getCurrentWindow().outerSize();
@@ -363,7 +372,9 @@ export default function App() {
363372
364373 { /* 右上角窗口控制按钮 */ }
365374 { isDesktop && ! useNativeTitleBar && ! isMac && ! isWeb && (
366- < Button className = "right-4 top-4 flex items-center gap-1 active:scale-100" >
375+ < Button
376+ className = { cn ( "right-4 top-4 flex items-center gap-1 active:scale-100" , isClassroomMode && "opacity-0" ) }
377+ >
367378 < ChevronDown
368379 onClick = { ( ) => getCurrentWindow ( ) . minimize ( ) }
369380 className = "transition hover:opacity-80 active:scale-75"
0 commit comments