дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 17:47:08 +02:00
Auxiliary windows (diff, comparison, editor, Sync with Deployed) boot a fixed set of features, so application actions they never register looked enabled in the menu but did nothing, some key equivalents were dropped because the page appeared to decline them, and Sync with Deployed had no menu bridge. Application actions now run in the project window (raised when it shows their result), Toggle Full Screen stays in the focused window, and menu enablement is cached per window so parent-routed items follow the destination window's state. Supersedes #7280. Co-authored-by: albince-mi <[email protected]> Co-authored-by: arookieofc-ai <[email protected]>
38 рядки
1.3 KiB
TypeScript
38 рядки
1.3 KiB
TypeScript
import type { Action } from "@/platform/actions";
|
|
import { t } from "@/platform/i18n";
|
|
import { commands, isTauri } from "@/platform/ipc";
|
|
|
|
/**
|
|
* Window actions every window registers: project windows and each auxiliary window (diff,
|
|
* comparison, editor, Settings, …), so their menu items and keymap bindings work wherever focus
|
|
* is. Next / Previous Window step through every open window; Toggle Full Screen acts on this one.
|
|
*/
|
|
export function sharedWindowActions(): Action[] {
|
|
return [
|
|
{
|
|
id: "window.next",
|
|
title: t("app.action.nextWindow"),
|
|
category: t("app.category.window"),
|
|
run: () => (isTauri() ? commands.windowCycle(true) : undefined),
|
|
},
|
|
{
|
|
id: "window.previous",
|
|
title: t("app.action.previousWindow"),
|
|
category: t("app.category.window"),
|
|
run: () => (isTauri() ? commands.windowCycle(false) : undefined),
|
|
},
|
|
{
|
|
id: "window.toggleFullScreen",
|
|
title: t("app.action.toggleFullScreen"),
|
|
category: t("app.category.view"),
|
|
icon: "maximize",
|
|
keywords: ["full screen", "fullscreen"],
|
|
run: async () => {
|
|
if (isTauri()) await commands.windowToggleFullscreen();
|
|
else if (document.fullscreenElement) await document.exitFullscreen();
|
|
else await document.documentElement.requestFullscreen?.();
|
|
},
|
|
},
|
|
];
|
|
}
|