MCPcopy
hub / github.com/wavetermdev/waveterm / makeViewMenu

Function makeViewMenu

emain/emain-menu.ts:203–329  ·  view source on GitHub ↗
(
    webContents: electron.WebContents,
    callbacks: AppMenuCallbacks,
    isBuilderWindowFocused: boolean,
    fullscreenOnLaunch: boolean
)

Source from the content-addressed store, hash-verified

201}
202
203function makeViewMenu(
204 webContents: electron.WebContents,
205 callbacks: AppMenuCallbacks,
206 isBuilderWindowFocused: boolean,
207 fullscreenOnLaunch: boolean
208): Electron.MenuItemConstructorOptions[] {
209 const devToolsAccel = unamePlatform === "darwin" ? "Option+Command+I" : "Alt+Shift+I";
210 return [
211 {
212 label: isBuilderWindowFocused ? "Reload Window" : "Reload Tab",
213 accelerator: "Shift+CommandOrControl+R",
214 click: (_, window) => {
215 (getWindowWebContents(window) ?? webContents)?.reloadIgnoringCache();
216 },
217 },
218 {
219 label: "Relaunch All Windows",
220 click: () => callbacks.relaunchBrowserWindows(),
221 },
222 {
223 label: "Clear Tab Cache",
224 click: () => clearTabCache(),
225 },
226 {
227 label: "Toggle DevTools",
228 accelerator: devToolsAccel,
229 click: (_, window) => {
230 const wc = getWindowWebContents(window) ?? webContents;
231 wc?.toggleDevTools();
232 },
233 },
234 { type: "separator" },
235 {
236 label: "Reset Zoom",
237 accelerator: "CommandOrControl+0",
238 click: (_, window) => {
239 const wc = getWindowWebContents(window) ?? webContents;
240 if (wc) {
241 resetZoomLevel(wc);
242 }
243 },
244 },
245 {
246 label: "Zoom In",
247 accelerator: "CommandOrControl+=",
248 click: (_, window) => {
249 const wc = getWindowWebContents(window) ?? webContents;
250 if (wc) {
251 increaseZoomLevel(wc);
252 }
253 },
254 },
255 {
256 label: "Zoom In (hidden)",
257 accelerator: "CommandOrControl+Shift+=",
258 click: (_, window) => {
259 const wc = getWindowWebContents(window) ?? webContents;
260 if (wc) {

Callers 1

makeFullAppMenuFunction · 0.85

Calls 9

clearTabCacheFunction · 0.90
resetZoomLevelFunction · 0.90
increaseZoomLevelFunction · 0.90
decreaseZoomLevelFunction · 0.90
fireAndForgetFunction · 0.90
getWindowWebContentsFunction · 0.85
SetConfigCommandMethod · 0.65
GetMetaCommandMethod · 0.65
SetMetaCommandMethod · 0.65

Tested by

no test coverage detected