Fix progress window title bar on win and linux (#3915)

This commit is contained in:
windingwind 2024-04-05 18:41:33 +08:00 committed by GitHub
parent 808fe9b665
commit 4d05367f1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -33,6 +33,8 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="&zotero.progress.title;"
no-titlebar-icon="true"
drawintitlebar-platforms="win,linux"
width="300"
windowtype="alert:alert">
@ -42,6 +44,9 @@
</hbox>
</vbox>
<script>
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { Zotero } = ChromeUtils.importESModule("chrome://zotero/content/zotero.mjs");
Services.scriptloader.loadSubScript("chrome://zotero/content/titlebar.js", this);
window.addEventListener("DOMContentLoaded", () => window.sizeToContent())
</script>
</window>

View file

@ -52,7 +52,7 @@ window.addEventListener("load", function () {
window.document.documentElement.setAttribute('sizemode', 'normal');
}
if (Zotero.isWin) {
if (Zotero.isWin && !document.querySelector("window")?.hasAttribute("no-titlebar-icon")) {
let windowIcon = document.querySelector(".titlebar-icon");
// Simulate Windows window control
windowIcon.addEventListener("dblclick", (ev) => {