дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 01:01:17 +02:00
View › Appearance › Enter Zen Mode turns on Distraction Free Mode and full screen with one action. Zen Mode is on while both are on; the action sets both to the opposite, touching only the one that differs, and a second run while one is in progress joins it. Full screen is tracked from the window's events (macOS) or resizes (Windows, Linux), and the title flips between Enter and Exit Zen Mode. The item is in the native View › Appearance menu after Enter Distraction Free Mode and in Quick Switch Scheme › View Mode. Co-authored-by: mansur-akhmadi <[email protected]>
26 рядки
1.1 KiB
TypeScript
26 рядки
1.1 KiB
TypeScript
/** Parameters shared between the native menu bridge and the custom title bar menu. */
|
|
import { getContext } from "@/platform/context";
|
|
import { basename } from "@/platform/project";
|
|
import { isVirtualUri } from "@/platform/virtualDocs";
|
|
import { maybeEditorService } from "./contributions";
|
|
import { isDistractionFree } from "./distractionFree";
|
|
import { toolWindowsRestorable } from "./toolwindows/store";
|
|
import { isZenMode } from "./zenMode";
|
|
|
|
export function javaFileNameOf(path: unknown): string | null {
|
|
if (typeof path !== "string" || !path || isVirtualUri(path) || !/\.java$/i.test(path)) return null;
|
|
return basename(path) || null;
|
|
}
|
|
|
|
export function menuLabelParams(os: string) {
|
|
const compileFileName = javaFileNameOf(getContext().editorPath ?? maybeEditorService()?.activePath());
|
|
return {
|
|
os,
|
|
distractionFree: isDistractionFree() ? "on" : "off",
|
|
zenMode: isZenMode() ? "on" : "off",
|
|
toolWindows: toolWindowsRestorable() ? "hidden" : "shown",
|
|
compileFile: compileFileName ? "yes" : "no",
|
|
compileFileName: compileFileName ?? "",
|
|
};
|
|
}
|