From ee7e3cc322e24298601cee27db5593a67b3ec279 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Thu, 29 Oct 2015 21:53:10 -0400
Subject: [PATCH] remove chromium toolbar, replacing it with a "Show DevTools"
 item in the "Help" menu

---
 pd/nw/index.js                    | 12 +++++++++++-
 pd/nw/locales/en/translation.json |  4 +++-
 pd/nw/package.json                |  2 +-
 pd/nw/pd_canvas.js                | 10 ++++++++++
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/pd/nw/index.js b/pd/nw/index.js
index cb72431e4..7c266502e 100644
--- a/pd/nw/index.js
+++ b/pd/nw/index.js
@@ -701,6 +701,16 @@ function nw_create_pd_window_menus () {
         tooltip: l("menu.forums_tt")
     }));
 
+    helpMenu.append(new gui.MenuItem({
+        label: l("menu.devtools"),
+        click: function() {
+            gui.Window.get().showDevTools();
+        },
+        key: "b",
+        modifiers: "ctrl",
+        tooltip: l("menu.devtools_tt")
+    }));
+
     //helpMenu.append(new gui.MenuItem({
     //    label: l("menu.irc"),
     //    click: function() {
@@ -732,7 +742,7 @@ function nw_create_window(cid, type, width, height, xpos, ypos, menu_flag,
     var new_win = gui.Window.open(my_file, {
         title: my_title,
         position: "center",
-        toolbar: true,
+        toolbar: false,
         focus: true,
         width: width,
         height: height,
diff --git a/pd/nw/locales/en/translation.json b/pd/nw/locales/en/translation.json
index c82958891..900b4de4b 100644
--- a/pd/nw/locales/en/translation.json
+++ b/pd/nw/locales/en/translation.json
@@ -229,7 +229,9 @@
     "forums": "Forums",
     "forums_tt": "Open a link in a browser for the Pd Forum",
     "irc": "IRC Chat",
-    "irc_tt": "Open a link in a browser for IRC Chat"
+    "irc_tt": "Open a link in a browser for IRC Chat",
+    "devtools": "Show DevTools",
+    "devtools_tt": "Show the DevTools window (for debugging)"
   },
   "canvas": {
     "prop": {
diff --git a/pd/nw/package.json b/pd/nw/package.json
index de61b251c..a668d0d5a 100644
--- a/pd/nw/package.json
+++ b/pd/nw/package.json
@@ -3,6 +3,6 @@
   "version": "0.1.0",
   "main": "index.html",
   "window": {
-      "toolbar": true
+    "toolbar": false
   }
 }
diff --git a/pd/nw/pd_canvas.js b/pd/nw/pd_canvas.js
index 174e7cfb0..3993ebb32 100644
--- a/pd/nw/pd_canvas.js
+++ b/pd/nw/pd_canvas.js
@@ -1334,6 +1334,16 @@ function nw_create_patch_window_menus(name) {
         tooltip: l("menu.irc_tt"),
     }));
 
+    helpMenu.append(new gui.MenuItem({
+        label: l("menu.devtools"),
+        key: "b",
+        modifiers: "ctrl",
+        click: function () {
+            gui.Window.get().showDevTools();
+        },
+        tooltip: l("menu.devtools_tt"),
+    }));
+
     // Assign to window
     gui.Window.get().menu = windowMenu;
 
-- 
GitLab