summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-10 20:51:33 +0200
committerGitHub <noreply@github.com>2020-07-10 20:51:33 +0200
commit08794b6512b00ac8c147d2723281a85f020ca754 (patch)
treedd9ec44e0765124419205c9a4a73d1014e445adb
parent34cf5558aa90d3211302952f5acf50e47cc9d9b0 (diff)
parent7b88cc85d8e2c921e1bba9554d539ec58f59e313 (diff)
downloadbasilisk-08794b6512b00ac8c147d2723281a85f020ca754.tar.gz
Merge pull request #19 from Lootyhoof/global-menu
Add global menubar support for GTK
-rw-r--r--basilisk/base/content/browser-menubar.inc4
-rw-r--r--basilisk/base/content/browser.js4
-rw-r--r--basilisk/components/places/content/places.xul4
3 files changed, 12 insertions, 0 deletions
diff --git a/basilisk/base/content/browser-menubar.inc b/basilisk/base/content/browser-menubar.inc
index 702c5ec..04e4634 100644
--- a/basilisk/base/content/browser-menubar.inc
+++ b/basilisk/base/content/browser-menubar.inc
@@ -5,7 +5,11 @@
<menubar id="main-menubar"
onpopupshowing="if (event.target.parentNode.parentNode == this &amp;&amp;
+#ifdef MOZ_WIDGET_GTK
+ document.documentElement.getAttribute('shellshowingmenubar') != 'true')
+#else
!('@mozilla.org/widget/nativemenuservice;1' in Cc))
+#endif
this.setAttribute('openedwithkey',
event.target.parentNode.openedWithKey);"
style="border:0px;padding:0px;margin:0px;-moz-appearance:none">
diff --git a/basilisk/base/content/browser.js b/basilisk/base/content/browser.js
index 6613942..13fc774 100644
--- a/basilisk/base/content/browser.js
+++ b/basilisk/base/content/browser.js
@@ -4691,6 +4691,10 @@ function getTogglableToolbars() {
let toolbarNodes = Array.slice(gNavToolbox.childNodes);
toolbarNodes = toolbarNodes.concat(gNavToolbox.externalToolbars);
toolbarNodes = toolbarNodes.filter(node => node.getAttribute("toolbarname"));
+#ifdef MOZ_WIDGET_GTK
+ if (document.documentElement.getAttribute("shellshowingmenubar") == "true")
+ toolbarNodes = toolbarNodes.filter(node => node.id != "toolbar-menubar");
+#endif
return toolbarNodes;
}
diff --git a/basilisk/components/places/content/places.xul b/basilisk/components/places/content/places.xul
index 16c3385..6d2cdf1 100644
--- a/basilisk/components/places/content/places.xul
+++ b/basilisk/components/places/content/places.xul
@@ -157,7 +157,11 @@
<toolbarbutton type="menu" class="tabbable"
onpopupshowing="document.getElementById('placeContent').focus()"
#else
+#ifdef MOZ_WIDGET_GTK
+ <menubar id="placesMenu" _moz-menubarkeeplocal="true">
+#else
<menubar id="placesMenu">
+#endif
<menu accesskey="&organize.accesskey;" class="menu-iconic"
#endif
id="organizeButton" label="&organize.label;"