~dricottone/noticable

c811dd13f5fef8fd5148ec5515d9b07a07ba1238 — Dominic Ricottone 3 years ago e4723f4
Updates to menu bar and renaming underlying functions
2 files changed, 18 insertions(+), 11 deletions(-)

M main.js
M preload.js
M main.js => main.js +10 -3
@@ 21,14 21,14 @@ const template = [
        label: "Save and Render",
        accelerator: "CmdOrCtrl+S",
        click: () => {
          win.webContents.send("key-render-markdown", "");
          win.webContents.send("menu-render-markdown", "");
        }
      },
      {
        label: "Save",
        accelerator: "CmdOrCtrl+Shift+S",
        click: () => {
          win.webContents.send("key-save-text", "");
          win.webContents.send("menu-save-text", "");
        }
      },
      { type: "separator" },


@@ 63,7 63,14 @@ const template = [
        label: "Focus Editor Mode",
        accelerator: "CmdOrCtrl+E",
        click: () => {
          win.webContents.send("key-focus-editor", "");
          win.webContents.send("menu-focus-editor", "");
        }
      },
      {
        label: "Focus Rendered Mode",
        accelerator: "CmdOrCtrl+Shift+E",
        click: () => {
          win.webContents.send("menu-unfocus-editor", "");
        }
      },
      { type: "separator" },

M preload.js => preload.js +8 -8
@@ 136,21 136,21 @@ ipcRenderer.on("post-new-filename", (event, filename) => {
  postDisplayFilename(prettyFilename);
  requestHighlightFilename(prettyFilename);
});
ipcRenderer.on("key-save-text", () => {
  debug("caught keybind for save text");
ipcRenderer.on("menu-save-text", () => {
  debug("caught menu button for save text");
  requestEditorText();
});
ipcRenderer.on("key-render-markdown", () => {
  debug("caught keybind for render markdown");
ipcRenderer.on("menu-render-markdown", () => {
  debug("caught menu button for render markdown");
  requestEditorText();
  requestUnfocusEditor();
});
ipcRenderer.on("key-focus-editor", () => {
  debug("caught keybind for focus editor");
ipcRenderer.on("menu-focus-editor", () => {
  debug("caught menu button for focus editor");
  requestFocusEditor();
});
ipcRenderer.on("key-unfocus-editor", () => {
  debug("caught keybind for unfocus editor");
ipcRenderer.on("menu-unfocus-editor", () => {
  debug("caught menu button for unfocus editor");
  requestUnfocusEditor();
});