From 23da0d70b0743371f8a50cd7ed3c482dbb062102 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Sat, 2 Mar 2024 15:51:55 +0800 Subject: [PATCH] Implement Windows redesign for native elements (#3727) --- .eslintrc | 1 + app/scripts/fetch_xulrunner | 14 + chrome/content/scaffold/load.js | 20 +- chrome/content/scaffold/load.xhtml | 18 +- chrome/content/scaffold/scaffold.xhtml | 416 ++++++++++-------- chrome/content/zotero-platform/mac/tab.css | 4 - chrome/content/zotero/about.xhtml | 11 +- chrome/content/zotero/customElements.js | 53 ++- chrome/content/zotero/errorReport.xhtml | 6 +- chrome/content/zotero/exportOptions.xhtml | 6 +- .../content/zotero/import/importWizard.xhtml | 3 +- chrome/content/zotero/longTagFixer.xhtml | 1 - .../content/zotero/newCollectionDialog.xhtml | 1 - chrome/content/zotero/rtfScan.xhtml | 3 +- chrome/content/zotero/runJS.html | 2 +- chrome/content/zotero/selectItemsDialog.xhtml | 3 +- .../zotero/standalone/basicViewer.xhtml | 3 +- .../content/zotero/standalone/standalone.js | 141 +----- chrome/content/zotero/titlebar.js | 173 ++++++++ chrome/content/zotero/tools/csledit.js | 2 +- chrome/content/zotero/tools/csledit.xhtml | 3 +- chrome/content/zotero/zoteroPane.xhtml | 1 + chrome/skin/default/zotero/itemPane.css | 6 - scss/_zotero.scss | 2 + scss/abstracts/_mixins.scss | 24 +- scss/base/_base.scss | 51 +-- scss/components/_clicky.scss | 4 +- scss/components/_collection-tree.scss | 1 + scss/components/_item-tree.scss | 2 + scss/components/_itemPane.scss | 1 + scss/components/_listheader.scss | 56 +++ scss/components/_mainWindow.scss | 111 ----- scss/components/_reader.scss | 7 + scss/components/_richlistbox.scss | 20 +- scss/components/_search.scss | 17 +- scss/components/_tabsMenu.scss | 6 +- scss/components/_tagSelector.scss | 9 +- scss/components/_titleBar.scss | 72 +++ scss/components/_toolbar.scss | 5 - scss/components/_toolbarbutton.scss | 2 + scss/components/_virtualized-table.scss | 18 +- scss/components/_window.scss | 29 +- scss/dialog-win.scss | 28 ++ scss/elements/_collapsibleSection.scss | 1 - scss/elements/_editableText.scss | 16 +- scss/elements/_itemBox.scss | 8 +- scss/elements/_paneHeader.scss | 1 - scss/elements/_quickSearchTextbox.scss | 6 +- .../errorReport.css => scss/errorReport.scss | 4 - scss/linux/_errorReport.scss | 3 - scss/mac/_titleBar.scss | 6 +- scss/preferences.scss | 2 + scss/preferences/_cite.scss | 6 + scss/preferences/_general.scss | 6 + scss/scaffold.scss | 72 +-- scss/win/_menupopup.scss | 1 + scss/win/_titleBar.scss | 6 +- scss/win/abstracts/_mixins.scss | 55 +++ scss/win/components/_button.scss | 31 ++ scss/win/components/_input.scss | 126 ++++++ scss/win/components/_menulist.scss | 24 + scss/win/components/_tabbox.scss | 67 +++ scss/win/elements/_editableText.scss | 13 + scss/win/elements/_itemBox.scss | 1 + scss/wizard-win.scss | 23 + scss/zotero-unix.scss | 1 - scss/zotero-win.scss | 10 + 67 files changed, 1189 insertions(+), 656 deletions(-) delete mode 100644 chrome/content/zotero-platform/mac/tab.css create mode 100644 chrome/content/zotero/titlebar.js create mode 100644 scss/components/_listheader.scss create mode 100644 scss/components/_titleBar.scss create mode 100644 scss/dialog-win.scss rename chrome/skin/default/zotero/errorReport.css => scss/errorReport.scss (93%) delete mode 100644 scss/linux/_errorReport.scss create mode 100644 scss/win/abstracts/_mixins.scss create mode 100644 scss/win/components/_button.scss create mode 100644 scss/win/components/_input.scss create mode 100644 scss/win/components/_menulist.scss create mode 100644 scss/win/components/_tabbox.scss create mode 100644 scss/win/elements/_editableText.scss create mode 100644 scss/wizard-win.scss diff --git a/.eslintrc b/.eslintrc index 3bd6085705..0a9a253ce1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -18,6 +18,7 @@ "MozXULElement": false, "PluralForm": false, "Services": false, + "windowUtils": false, "XPCOMUtils": false, "XRegExp": false, "XULElement": false, diff --git a/app/scripts/fetch_xulrunner b/app/scripts/fetch_xulrunner index 8b3d918fd0..1285e84118 100755 --- a/app/scripts/fetch_xulrunner +++ b/app/scripts/fetch_xulrunner @@ -297,6 +297,20 @@ function modify_omni { replace_line 'window.sizeToContent\(\);' 'if (ui.infoIcon.complete) window.sizeToContent();' chrome/toolkit/content/global/commonDialog.js replace_line 'ui.infoIcon.addEventListener' 'if (!ui.infoIcon.complete) ui.infoIcon.addEventListener' chrome/toolkit/content/global/commonDialog.js + # Import style into built-in dialogs + replace_line '' \ + '<\?xml-stylesheet href=\"chrome:\/\/global\/skin\/commonDialog.css\" type=\"text\/css\"\?> + <\?xml-stylesheet href=\"chrome:\/\/zotero-platform\/content\/zotero.css\" type=\"text\/css\"\?>' \ + chrome/toolkit/content/global/commonDialog.xhtml + replace_line ' @@ -148,201 +155,236 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/content/zotero-platform/mac/tab.css b/chrome/content/zotero-platform/mac/tab.css deleted file mode 100644 index 9d6de9b3a6..0000000000 --- a/chrome/content/zotero-platform/mac/tab.css +++ /dev/null @@ -1,4 +0,0 @@ -#zotero-toolbar { - -moz-appearance: none !important; - background: url("chrome://zotero/skin/mac/toolbar-background.png") left center repeat-x; -} \ No newline at end of file diff --git a/chrome/content/zotero/about.xhtml b/chrome/content/zotero/about.xhtml index 41f4d049c3..515aea4a2e 100644 --- a/chrome/content/zotero/about.xhtml +++ b/chrome/content/zotero/about.xhtml @@ -8,8 +8,12 @@ + inwindowmenu="false"> + - - + diff --git a/chrome/content/zotero/longTagFixer.xhtml b/chrome/content/zotero/longTagFixer.xhtml index 9d7efc6c2a..0ece8650ad 100644 --- a/chrome/content/zotero/longTagFixer.xhtml +++ b/chrome/content/zotero/longTagFixer.xhtml @@ -14,7 +14,6 @@ onload="Zotero_Long_Tag_Fixer.init()"> diff --git a/chrome/content/zotero/newCollectionDialog.xhtml b/chrome/content/zotero/newCollectionDialog.xhtml index 3916d4a94b..09fc49ea17 100644 --- a/chrome/content/zotero/newCollectionDialog.xhtml +++ b/chrome/content/zotero/newCollectionDialog.xhtml @@ -53,7 +53,6 @@ @@ -22,7 +21,7 @@ Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this); - +
diff --git a/chrome/content/zotero/runJS.html b/chrome/content/zotero/runJS.html index 7945818b18..5dc6935ab9 100644 --- a/chrome/content/zotero/runJS.html +++ b/chrome/content/zotero/runJS.html @@ -3,7 +3,7 @@ Run JavaScript - +