mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-29 03:41:51 +00:00
chore: Start making use of Mozilla's linter, p=#12656
This commit is contained in:
32
.github/workflows/code-linter.yml
vendored
32
.github/workflows/code-linter.yml
vendored
@@ -28,20 +28,32 @@ jobs:
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Setup and run autopep8
|
||||
if: ${{ contains(join(github.event.commits.*.modified, ' '), '.py') || contains(join(github.event.commits.*.added, ' '), '.py') || contains(join(github.event.commits.*.removed, ' '), '.py') }}
|
||||
run: |
|
||||
sudo apt install python3-autopep8
|
||||
autopep8 --diff scripts/ src/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Download Firefox
|
||||
env:
|
||||
ZEN_DOWNLOAD_DONT_INIT_GIT: "1"
|
||||
- name: Restore Surfer engine cache
|
||||
id: surfer-engine-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .surfer/engine/*.tar
|
||||
key: surfer-engine-${{ hashFiles('surfer.json') }}
|
||||
|
||||
- name: Setup Git
|
||||
run: |
|
||||
npm run download
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Download Firefox
|
||||
run: npm run download
|
||||
|
||||
- name: Import patches
|
||||
run: npm run import
|
||||
|
||||
- name: Add .hgignore file to the engine dir
|
||||
run: touch engine/.hgignore
|
||||
|
||||
- name: Run Bootstrap
|
||||
run: npm run bootstrap
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
24
.github/workflows/pr-test.yml
vendored
24
.github/workflows/pr-test.yml
vendored
@@ -28,13 +28,29 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Restore Surfer engine cache
|
||||
id: surfer-engine-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .surfer/engine/*.tar
|
||||
key: surfer-engine-${{ hashFiles('surfer.json') }}
|
||||
|
||||
- name: Setup Git
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Download Firefox and dependencies
|
||||
env:
|
||||
ZEN_DOWNLOAD_DONT_INIT_GIT: "1"
|
||||
run: npm run download
|
||||
|
||||
- name: Run linting
|
||||
run: npm run lint
|
||||
- name: Run Bootstrap
|
||||
run: npm run bootstrap
|
||||
|
||||
- name: Add .hgignore file to the engine dir
|
||||
run: touch engine/.hgignore
|
||||
|
||||
- name: Import patches
|
||||
run: npm run import
|
||||
|
||||
- name: Run linting
|
||||
run: npm run lint
|
||||
|
||||
9
.github/workflows/sync-upstream.yml
vendored
9
.github/workflows/sync-upstream.yml
vendored
@@ -73,8 +73,9 @@ jobs:
|
||||
npm run sync
|
||||
fi
|
||||
|
||||
- name: Install autopep8
|
||||
run: sudo apt install python3-autopep8
|
||||
- name: Run Bootstrap
|
||||
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
|
||||
run: npm run bootstrap
|
||||
|
||||
- name: Install requirements
|
||||
run: pip3 install -r requirements.txt
|
||||
@@ -82,7 +83,7 @@ jobs:
|
||||
- name: Check if any files changed
|
||||
id: git-check
|
||||
run: |
|
||||
npm run pretty
|
||||
npm run lint:fix
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "files_changed=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
@@ -119,7 +120,7 @@ jobs:
|
||||
- name: Run formatter
|
||||
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
|
||||
run: |
|
||||
npm run pretty
|
||||
npm run lint:fix
|
||||
|
||||
- name: Create pull request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
engine/
|
||||
|
||||
**/*.html
|
||||
**/*.xhtml
|
||||
**/*.inc.xhtml
|
||||
**/*.bundle.min.js
|
||||
**/*.min.js
|
||||
**/*.min.mjs
|
||||
|
||||
**/*.svg
|
||||
|
||||
**/*.inc.css
|
||||
|
||||
surfer.json
|
||||
|
||||
src/zen/tests/mochitests/*
|
||||
|
||||
src/browser/app/profile/*.js
|
||||
pnpm-lock.yaml
|
||||
|
||||
**/engine/
|
||||
|
||||
docs/issue-metrics/*.md
|
||||
|
||||
.husky/
|
||||
|
||||
# Some CSS files are preprocessed and prettier doesn't handle them well
|
||||
# We also dont want to format the CSS files that are generated by the build
|
||||
src/zen/tabs/zen-tabs.css
|
||||
src/zen/common/styles/zen-theme.css
|
||||
src/zen/compact-mode/zen-compact-mode.css
|
||||
src/zen/common/ZenEmojis.mjs
|
||||
|
||||
src/zen/split-view/zen-decks.css
|
||||
src/zen/workspaces/zen-workspaces.css
|
||||
src/zen/common/styles/zen-toolbar.css
|
||||
|
||||
*.inc
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"bracketSameLine": true,
|
||||
"endOfLine": "lf",
|
||||
"trailingComma": "es5",
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"jsxSingleQuote": false,
|
||||
"semi": true,
|
||||
"printWidth": 100,
|
||||
"plugins": ["prettier-plugin-sh"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.css",
|
||||
"options": {
|
||||
"parser": "css",
|
||||
"printWidth": 160
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
4295
package-lock.json
generated
4295
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@@ -21,9 +21,8 @@
|
||||
"sync:raw": "surfer update",
|
||||
"sync:rc": "python3 scripts/update_ff.py --rc",
|
||||
"sync:l10n": "python3 scripts/update_ff.py --just-l10n",
|
||||
"pretty": "prettier . --write --cache && autopep8 -r --in-place scripts/ src/ --exclude src/zen/tests/",
|
||||
"lint": "npx eslint src/ && prettier . --check --cache",
|
||||
"lint:fix": "npm run pretty && npx eslint src/ --fix",
|
||||
"lint": "cd engine && ./mach lint zen",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"prepare": "husky",
|
||||
"reset-ff": "surfer reset",
|
||||
"surfer": "surfer",
|
||||
@@ -51,32 +50,11 @@
|
||||
"homepage": "https://github.com/zen-browser/desktop#readme",
|
||||
"devDependencies": {
|
||||
"@babel/preset-typescript": "^7.27.0",
|
||||
"@eslint/js": "^9.39.2",
|
||||
"@eslint/json": "^0.14.0",
|
||||
"@microsoft/eslint-plugin-sdl": "^1.1.0",
|
||||
"@zen-browser/surfer": "^1.13.1",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-eslint-plugin": "^7.3.0",
|
||||
"eslint-plugin-html": "^8.1.3",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jest": "^29.12.1",
|
||||
"eslint-plugin-json": "^4.0.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-lit": "^2.1.1",
|
||||
"eslint-plugin-mozilla": "^4.3.3",
|
||||
"eslint-plugin-no-unsanitized": "4.1.4",
|
||||
"eslint-plugin-promise": "7.2.1",
|
||||
"eslint-plugin-react": "7.37.5",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-spidermonkey-js": "file:tools/eslint-plugin-spidermonkey-js",
|
||||
"formal-git": "^1.2.9",
|
||||
"globals": "^16.3.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^15.3.0",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-sh": "^0.14.0",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.52.0"
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
[tool.autopep8]
|
||||
max_line_length = 120
|
||||
recursive = true
|
||||
aggressive = 3
|
||||
indent_size = 2
|
||||
@@ -2,7 +2,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
autopep8==2.3.1
|
||||
click==8.1.8
|
||||
mypy-extensions==1.0.0
|
||||
packaging==24.2
|
||||
|
||||
31
src/-stylelintignore.patch
Normal file
31
src/-stylelintignore.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
diff --git a/.stylelintignore b/.stylelintignore
|
||||
index 185490999507b8a5032977237af50f5e61c71df1..36f760f473b857e851134ceb62c837cb8d29c966 100644
|
||||
--- a/.stylelintignore
|
||||
+++ b/.stylelintignore
|
||||
@@ -106,3 +106,26 @@ build/pgo/blueprint/**/*.css
|
||||
# under our control or we don't want to modify at this point:
|
||||
testing/web-platform/mozilla/
|
||||
testing/web-platform/tests/
|
||||
+
|
||||
+**/*.bundle.min.js
|
||||
+**/*.min.js
|
||||
+**/*.min.mjs
|
||||
+
|
||||
+**/*.svg
|
||||
+
|
||||
+**/*.inc.css
|
||||
+
|
||||
+zen/tests/mochitests/*
|
||||
+
|
||||
+# Some CSS files are preprocessed and prettier doesn't handle them well
|
||||
+# We also dont want to format the CSS files that are generated by the build
|
||||
+zen/tabs/zen-tabs.css
|
||||
+zen/common/styles/zen-theme.css
|
||||
+zen/compact-mode/zen-compact-mode.css
|
||||
+zen/common/ZenEmojis.mjs
|
||||
+
|
||||
+zen/split-view/zen-decks.css
|
||||
+zen/workspaces/zen-workspaces.css
|
||||
+zen/common/styles/zen-toolbar.css
|
||||
+
|
||||
+*.inc
|
||||
25
src/-stylelintrc-js.patch
Normal file
25
src/-stylelintrc-js.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
diff --git a/.stylelintrc.js b/.stylelintrc.js
|
||||
index 36719c9e152c34da2aa76fc74d74e58cb9e6b1cc..4226db2e0af4b36923a93dcd0b76e59f8508ba36 100644
|
||||
--- a/.stylelintrc.js
|
||||
+++ b/.stylelintrc.js
|
||||
@@ -67,7 +67,7 @@ module.exports = {
|
||||
],
|
||||
|
||||
"max-nesting-depth": [
|
||||
- 3,
|
||||
+ 6,
|
||||
{
|
||||
ignore: ["blockless-at-rules"],
|
||||
},
|
||||
@@ -274,9 +274,9 @@ module.exports = {
|
||||
// Remove this line setting `csscontrols/use-logical` to null after implementing fixes
|
||||
"csstools/use-logical": null,
|
||||
"stylelint-plugin-mozilla/no-base-design-tokens": true,
|
||||
- "stylelint-plugin-mozilla/use-design-tokens": true,
|
||||
+ "stylelint-plugin-mozilla/use-design-tokens": false,
|
||||
"stylelint-plugin-mozilla/no-non-semantic-token-usage": true,
|
||||
- "stylelint-plugin-mozilla/use-size-tokens": true,
|
||||
+ "stylelint-plugin-mozilla/use-size-tokens": false,
|
||||
},
|
||||
|
||||
overrides: [
|
||||
22
src/eslint-file-globals-config-mjs.patch
Normal file
22
src/eslint-file-globals-config-mjs.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
diff --git a/eslint-file-globals.config.mjs b/eslint-file-globals.config.mjs
|
||||
index 00e49fce00efecab254aa1b8f0f0fe9ed2c24057..e9f390e15537d3d03a87f1c87099cb34698aee49 100644
|
||||
--- a/eslint-file-globals.config.mjs
|
||||
+++ b/eslint-file-globals.config.mjs
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
import globals from "globals";
|
||||
import mozilla from "eslint-plugin-mozilla";
|
||||
+import zenGlobals from "./zen/zen.globals.mjs";
|
||||
|
||||
export default [
|
||||
{
|
||||
@@ -550,4 +551,9 @@ export default [
|
||||
],
|
||||
languageOptions: { globals: globals.worker },
|
||||
},
|
||||
+ {
|
||||
+ name: "zen-globals",
|
||||
+ files: ["zen/**/!(*.sys).mjs", "zen/**/*.js"],
|
||||
+ languageOptions: { globals: zenGlobals.reduce((acc, name) => ({ ...acc, [name]: "readonly" }), {}) },
|
||||
+ }
|
||||
];
|
||||
12
src/eslint-ignores-config-mjs.patch
Normal file
12
src/eslint-ignores-config-mjs.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/eslint-ignores.config.mjs b/eslint-ignores.config.mjs
|
||||
index 0cfd7e02ad58c331f48f1ba8e1588777e1ce2595..d85b95b18a7195b6794083af71cbe1947d9f2f9c 100644
|
||||
--- a/eslint-ignores.config.mjs
|
||||
+++ b/eslint-ignores.config.mjs
|
||||
@@ -312,4 +312,7 @@ export default [
|
||||
// Test files for circular import in modules.
|
||||
"dom/base/test/jsmodules/import_circular.mjs",
|
||||
"dom/base/test/jsmodules/import_circular_1.mjs",
|
||||
+
|
||||
+ "**/*.min.mjs",
|
||||
+ "zen/tests/**",
|
||||
];
|
||||
12
src/eslint-test-paths-config-mjs.patch
Normal file
12
src/eslint-test-paths-config-mjs.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/eslint-test-paths.config.mjs b/eslint-test-paths.config.mjs
|
||||
index 53d97521a676d04212abb0263cb166da06c889e0..fa8c261de7a8663a369fb41671476d314722c025 100644
|
||||
--- a/eslint-test-paths.config.mjs
|
||||
+++ b/eslint-test-paths.config.mjs
|
||||
@@ -218,6 +218,7 @@ const extraBrowserTestPaths = [
|
||||
"toolkit/components/windowwatcher/test/",
|
||||
"toolkit/mozapps/extensions/test/xpinstall/",
|
||||
"uriloader/exthandler/tests/mochitest/",
|
||||
+ "zen/tests/",
|
||||
];
|
||||
|
||||
// DO NOT add more items to this list. Please see the note at the top
|
||||
12
src/python/mozlint/mozlint/roller-py.patch
Normal file
12
src/python/mozlint/mozlint/roller-py.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/python/mozlint/mozlint/roller.py b/python/mozlint/mozlint/roller.py
|
||||
index aeafa93cc525d2846614b600e95fd817b832b0ef..69414ed032523f1b53b78ad867145efaea422c63 100644
|
||||
--- a/python/mozlint/mozlint/roller.py
|
||||
+++ b/python/mozlint/mozlint/roller.py
|
||||
@@ -92,7 +92,6 @@ def _run_worker(config, paths, **lintargs):
|
||||
res = res or []
|
||||
else:
|
||||
log.error(f"Unexpected result type received: {type(res)}")
|
||||
- assert False
|
||||
except Exception:
|
||||
log.exception(f"{config['name']} failed")
|
||||
res = 1
|
||||
@@ -0,0 +1,13 @@
|
||||
diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/require-jsdoc.mjs b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/require-jsdoc.mjs
|
||||
index 87fc32f6a1bdf21a56fb3ce18c767ebbb12c6d67..174fcc3a679ae655c9bce907461f9c3a9030c2a9 100644
|
||||
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/require-jsdoc.mjs
|
||||
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/require-jsdoc.mjs
|
||||
@@ -13,7 +13,7 @@ export default {
|
||||
"error",
|
||||
{
|
||||
require: {
|
||||
- ClassDeclaration: true,
|
||||
+ ClassDeclaration: false,
|
||||
FunctionDeclaration: false,
|
||||
},
|
||||
},
|
||||
12
src/tools/lint/ignorefile-yml.patch
Normal file
12
src/tools/lint/ignorefile-yml.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/tools/lint/ignorefile.yml b/tools/lint/ignorefile.yml
|
||||
index 5ae3b282a54c129bb16bca461470154e4a882618..f46c6256037cbef1392f8d070726d45dadac1289 100644
|
||||
--- a/tools/lint/ignorefile.yml
|
||||
+++ b/tools/lint/ignorefile.yml
|
||||
@@ -3,7 +3,6 @@ ignorefile:
|
||||
description: Linter for .gitignore and .hgignore files
|
||||
include:
|
||||
- '.gitignore'
|
||||
- - '.hgignore'
|
||||
support-files:
|
||||
- 'tools/lint/ignorefile**'
|
||||
type: external
|
||||
12
src/tools/lint/rejected-words-yml.patch
Normal file
12
src/tools/lint/rejected-words-yml.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/tools/lint/rejected-words.yml b/tools/lint/rejected-words.yml
|
||||
index d5ca2e05fb335fcd17d1559d5332ec4a43d7cd1d..1f34e8d5e05508fc541bc7aa6a779cd98206032a 100644
|
||||
--- a/tools/lint/rejected-words.yml
|
||||
+++ b/tools/lint/rejected-words.yml
|
||||
@@ -8,7 +8,6 @@ avoid-blacklist-and-whitelist:
|
||||
ignore-case: true
|
||||
# Based on codespell with idl and webidl added.
|
||||
extensions:
|
||||
- - js
|
||||
- mjs
|
||||
- jsx
|
||||
- idl
|
||||
File diff suppressed because one or more lines are too long
@@ -22,12 +22,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media not -moz-pref("layout.css.prefers-color-scheme.content-override", 2) {
|
||||
& browser[type="content"] {
|
||||
color-scheme: env(-moz-content-preferred-color-scheme);
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.theme.acrylic-elements") {
|
||||
& browser[type="content"] {
|
||||
/* For the rendering engine to apply layering optimizations. This
|
||||
@@ -37,6 +39,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media (not -moz-pref("zen.view.shift-down-site-on-hover")) and (not ((-moz-pref("zen.view.experimental-no-window-controls") or (not -moz-pref("zen.view.hide-window-controls"))) and -moz-pref("zen.view.use-single-toolbar"))) {
|
||||
.browserSidebarContainer:is(.deck-selected, [zen-split="true"]) .browserContainer {
|
||||
transition: margin var(--zen-hidden-toolbar-transition);
|
||||
|
||||
@@ -142,9 +142,10 @@
|
||||
|
||||
#zen-main-app-wrapper {
|
||||
background: var(--zen-themed-toolbar-bg-transparent);
|
||||
/* See bug #8814, don't an overflow here as it causes issues
|
||||
/* See bug #8814, don't add overflow here as it causes issues
|
||||
* with firefox's rendering of the tab bar */
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media (-moz-pref("zen.view.grey-out-inactive-windows")) {
|
||||
&:-moz-window-inactive {
|
||||
background: InactiveCaption;
|
||||
@@ -155,6 +156,7 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media (-moz-windows-accent-color-in-titlebar) and ((-moz-windows-mica) or -moz-pref("browser.theme.windows.accent-color-in-tabs.enabled")) {
|
||||
background: ActiveCaption;
|
||||
color: CaptionText;
|
||||
@@ -207,6 +209,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.widget.mac.mono-window-controls") {
|
||||
:root:not([window-modal-open="true"]) .titlebar-buttonbox-container {
|
||||
color: var(--toolbox-textcolor);
|
||||
@@ -220,7 +223,7 @@
|
||||
/* Draw 3 dots as background to represent the window controls,
|
||||
all with the same cololr as the titlebar */
|
||||
background-image: radial-gradient(circle, var(--zen-toolbar-element-bg) var(--zen-traffic-light-size), transparent 0.5px);
|
||||
background-size: 20px 22px;
|
||||
background-size: var(--icon-size-medium) 22px;
|
||||
background-position: 53% 50%;
|
||||
|
||||
@media (-moz-mac-tahoe-theme) {
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
}
|
||||
|
||||
#urlbar .urlbar-input {
|
||||
border-radius: 0px !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
#urlbar .urlbar-input-box {
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
& #identity-box {
|
||||
order: 999;
|
||||
margin: 0px !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,12 +189,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.urlbar.single-toolbar-show-copy-url", false) {
|
||||
:root[zen-single-toolbar="true"] #zen-copy-url-button {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media not -moz-pref("zen.urlbar.show-pip-button") {
|
||||
#picture-in-picture-button {
|
||||
display: none !important;
|
||||
@@ -259,14 +261,17 @@
|
||||
|
||||
& .urlbar-background {
|
||||
--zen-urlbar-background-base: light-dark(#fbfbfb, color-mix(in srgb, hsl(0, 0%, 6.7%), var(--zen-colors-primary) 30%));
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.theme.acrylic-elements") {
|
||||
--zen-urlbar-background-transparent: color-mix(in srgb, var(--zen-urlbar-background-base) 70%, transparent 30%);
|
||||
}
|
||||
background-color: var(--zen-urlbar-background-transparent, var(--zen-urlbar-background-base)) !important;
|
||||
box-shadow: 0px 30px 140px -15px light-dark(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6)) !important;
|
||||
box-shadow: 0 30px 140px -15px light-dark(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6)) !important;
|
||||
backdrop-filter: none !important;
|
||||
outline: 0.5px solid light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)) !important;
|
||||
outline-offset: var(--zen-urlbar-outline-offset) !important;
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.theme.acrylic-elements") {
|
||||
backdrop-filter: blur(42px) saturate(110%) brightness(0.25) contrast(100%) !important;
|
||||
}
|
||||
@@ -324,8 +329,8 @@
|
||||
& > image {
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
height: 24px; /* double 12px */
|
||||
width: 24px;
|
||||
height: var(--size-item-medium); /* double 12px */
|
||||
width: var(--size-item-medium);
|
||||
padding: 4px !important;
|
||||
|
||||
&:hover {
|
||||
@@ -502,13 +507,14 @@
|
||||
height: var(--urlbar-height) !important;
|
||||
margin-inline: 0.15rem !important;
|
||||
:root:not([zen-single-toolbar="true"]) & {
|
||||
max-height: 32px !important;
|
||||
max-height: var(--size-item-large) !important;
|
||||
min-height: unset !important;
|
||||
margin-block: -1px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media not -moz-pref("zen.urlbar.show-protections-icon") {
|
||||
#tracking-protection-icon-container {
|
||||
display: none !important;
|
||||
@@ -573,8 +579,8 @@
|
||||
& img {
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: var(--size-item-small);
|
||||
height: var(--size-item-small);
|
||||
}
|
||||
|
||||
&[hidden] {
|
||||
@@ -702,7 +708,7 @@
|
||||
}
|
||||
|
||||
#identity-box {
|
||||
margin-inline-end: 0px;
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,7 +720,7 @@
|
||||
|
||||
#urlbar-search-mode-indicator-title {
|
||||
font-weight: 600;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* These are buttons that we dont need to be
|
||||
@@ -727,6 +733,7 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media not -moz-pref("zen.urlbar.show-contextual-id") {
|
||||
#userContext-icons {
|
||||
display: none !important;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
padding: 8px 2px;
|
||||
padding-bottom: 0px;
|
||||
padding-bottom: 0;
|
||||
|
||||
& .unified-extensions-item {
|
||||
flex: 1;
|
||||
|
||||
@@ -22,7 +22,7 @@ panel[type="arrow"]:not(#feature-callout) {
|
||||
transition-duration: 0s !important;
|
||||
|
||||
&::part(content) {
|
||||
/* Refrain from animating for now as we haven't found a
|
||||
/* Refrain from animating for now as we haven't found a
|
||||
* way to properly animate the popup without having the mica
|
||||
* backdrop staying still while the popup animates */
|
||||
animation: none !important;
|
||||
@@ -45,7 +45,7 @@ panel[type="arrow"]:not(#feature-callout) {
|
||||
|
||||
/* Remove the shadow for the native panels, as macos already
|
||||
* adds the shadows to the window. This is specially important
|
||||
* on Tahoe, where we *dont* apply an image mask, meaning that
|
||||
* on Tahoe, where we *don't* apply an image mask, meaning that
|
||||
* trying to render a shadow would end up in having weird borders
|
||||
* around the panel */
|
||||
--panel-shadow: none;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
}
|
||||
|
||||
#zenEditBookmarkPanelFavicon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: var(--icon-size-medium);
|
||||
height: var(--icon-size-medium);
|
||||
}
|
||||
|
||||
#editBookmarkPanel .panel-header {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
.dialogBox {
|
||||
border: none;
|
||||
outline: 1px solid light-dark(transparent, #646464);
|
||||
animation: zen-dialog-fade-in 0.3s ease-out;
|
||||
border-radius: 12px !important;
|
||||
|
||||
@@ -92,8 +92,8 @@ panel {
|
||||
#appMenu-fxa-label2::before {
|
||||
content: "";
|
||||
display: -moz-box;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
height: var(--size-item-small);
|
||||
width: var(--size-item-small);
|
||||
background: var(--avatar-image-url) 0/16px;
|
||||
scale: 1.25;
|
||||
border-radius: 99px;
|
||||
@@ -139,7 +139,7 @@ panel {
|
||||
border-inline-start: 1px solid var(--panel-separator-color);
|
||||
display: block;
|
||||
position: relative;
|
||||
height: 32px;
|
||||
height: var(--size-item-large);
|
||||
margin-block: calc(var(--uc-panel-zoom-button-padding) * -1);
|
||||
transform: translateX(
|
||||
calc(var(--uc-panel-zoom-button-inline-padding) * -1 - (var(--panel-separator-margin-vertical) + var(--uc-arrowpanel-menuitem-margin-block)) - 1px)
|
||||
@@ -147,8 +147,8 @@ panel {
|
||||
}
|
||||
|
||||
#appMenu-zoomReset-button2 {
|
||||
height: calc(16px + var(--uc-panel-zoom-button-padding) * 2);
|
||||
min-height: calc(16px + var(--uc-panel-zoom-button-padding) * 2);
|
||||
height: calc(var(--size-item-small) + var(--uc-panel-zoom-button-padding) * 2);
|
||||
min-height: calc(var(--size-item-small) + var(--uc-panel-zoom-button-padding) * 2);
|
||||
}
|
||||
|
||||
#appMenu-zoomReduce-button2:not([disabled], [open], :active):is(:hover),
|
||||
@@ -191,7 +191,7 @@ panel {
|
||||
#identity-popup-mainView-panel-header,
|
||||
#protections-popup-mainView-panel-header,
|
||||
.panel-header {
|
||||
min-height: calc((var(--arrowpanel-menuitem-padding-block) + 4px) * 2 + 16px);
|
||||
min-height: calc((var(--arrowpanel-menuitem-padding-block) + 4px) * 2 + var(--size-item-small));
|
||||
}
|
||||
|
||||
/* URL bar popup */
|
||||
@@ -223,7 +223,7 @@ panel {
|
||||
.permission-popup-permission-item,
|
||||
#permission-popup-storage-access-permission-list-header {
|
||||
padding-block: 4px;
|
||||
margin-block: 0px;
|
||||
margin-block: 0;
|
||||
}
|
||||
|
||||
#editBookmarkPanel > #editBookmarkHeaderSeparator,
|
||||
@@ -353,7 +353,7 @@ menuseparator {
|
||||
padding: var(--zen-toast-padding);
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(to bottom, var(--zen-primary-color) -40%, color-mix(in srgb, var(--zen-primary-color), #0f0f0f 20%));
|
||||
box-shadow: light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)) 0px 0px 22px 2px;
|
||||
box-shadow: light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)) 0 0 22px 2px;
|
||||
border: none;
|
||||
display: flex;
|
||||
font-weight: 600;
|
||||
@@ -386,10 +386,10 @@ menuseparator {
|
||||
|
||||
& button {
|
||||
width: min-content;
|
||||
padding: 0px 8px !important;
|
||||
padding: 0 8px !important;
|
||||
min-width: unset !important;
|
||||
min-height: 28px;
|
||||
margin: 0px !important;
|
||||
margin: 0 !important;
|
||||
border-radius: 6px !important;
|
||||
border-top: 2px solid light-dark(transparent, rgba(255, 255, 255, 0.1));
|
||||
color: light-dark(rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0.8)) !important;
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
|
||||
& .zen-sidebar-notification-link-icon {
|
||||
pointer-events: none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: var(--size-item-small);
|
||||
height: var(--size-item-small);
|
||||
-moz-context-properties: fill, fill-opacity;
|
||||
fill: var(--special-color, currentColor);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.theme.disable-lightweight") {
|
||||
#customization-lwtheme-link {
|
||||
display: none !important;
|
||||
@@ -60,7 +61,7 @@
|
||||
#PanelUI-zen-emojis-picker-header {
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
padding: 0px 10px;
|
||||
padding: 0 10px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
@@ -147,7 +148,7 @@
|
||||
|
||||
.zen-emojis-picker-emoji {
|
||||
font-size: 14px;
|
||||
padding: 0px !important;
|
||||
padding: 0 !important;
|
||||
& image {
|
||||
display: none;
|
||||
}
|
||||
@@ -262,6 +263,7 @@
|
||||
|
||||
/* Status panel */
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media (-moz-pref("zen.theme.styled-status-panel")) {
|
||||
#statuspanel {
|
||||
padding: 6px;
|
||||
@@ -334,8 +336,8 @@
|
||||
|
||||
& > * {
|
||||
background-color: color-mix(in srgb, currentcolor 6%, transparent);
|
||||
width: 48px;
|
||||
height: 32px;
|
||||
width: var(--size-item-xlarge);
|
||||
height: var(--size-item-large);
|
||||
margin: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -416,7 +418,7 @@
|
||||
}
|
||||
|
||||
.permission-popup-permission-label {
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -447,8 +449,8 @@
|
||||
position: absolute;
|
||||
inset: 1px;
|
||||
border-radius: 99px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
width: var(--size-item-large);
|
||||
height: var(--size-item-large);
|
||||
background: var(--button-background-color-primary);
|
||||
opacity: 0.6;
|
||||
transition:
|
||||
@@ -491,12 +493,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.theme.hide-unified-extensions-button") {
|
||||
#unified-extensions-button:not([showing]) {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media not -moz-pref("zen.theme.hide-unified-extensions-button") {
|
||||
#zen-site-data-section-addons {
|
||||
display: none;
|
||||
@@ -519,8 +523,8 @@
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
color: light-dark(rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0.8));
|
||||
width: 48px;
|
||||
height: 32px;
|
||||
width: var(--size-item-xlarge);
|
||||
height: var(--size-item-large);
|
||||
position: relative;
|
||||
|
||||
&[disabled] {
|
||||
@@ -547,8 +551,8 @@
|
||||
background: linear-gradient(to bottom, light-dark(rgb(255, 255, 255), rgb(34, 34, 34)), light-dark(rgb(246, 246, 246), rgb(21, 21, 21)));
|
||||
|
||||
box-shadow:
|
||||
0px 1px 2px rgba(0, 0, 0, 0.1),
|
||||
inset 0px 1px 0px light-dark(transparent, rgba(255, 255, 255, 0.15));
|
||||
0 1px 2px rgba(0, 0, 0, 0.1),
|
||||
inset 0 1px 0 light-dark(transparent, rgba(255, 255, 255, 0.15));
|
||||
border-radius: 6px;
|
||||
--base-border-color: light-dark(rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.1));
|
||||
border: 0.5px solid light-dark(var(--base-border-color), rgb(21, 21, 21));
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#navigator-toolbox {
|
||||
--zen-toolbox-max-width: 74px !important;
|
||||
--zen-compact-float: var(--zen-element-separation);
|
||||
|
||||
|
||||
:root[zen-no-padding='true'] & {
|
||||
--zen-compact-float: 10px;
|
||||
--zen-compact-top-toolbar-hidden-fix: var(--zen-compact-float);
|
||||
@@ -78,7 +78,7 @@
|
||||
}
|
||||
:root:not([zen-single-toolbar='true']) & {
|
||||
bottom: calc(var(--zen-compact-float) / 2);
|
||||
height: calc(100% - var(--zen-toolbar-height-with-bookmarks));
|
||||
height: calc(100% - var(--zen-toolbar-height-with-bookmarks));
|
||||
@media -moz-pref('zen.view.compact.hide-toolbar') {
|
||||
height: calc(100% - var(--zen-compact-top-toolbar-hidden-fix, 0px));
|
||||
}
|
||||
@@ -145,9 +145,9 @@
|
||||
}
|
||||
|
||||
#navigator-toolbox:is(
|
||||
[zen-has-hover], [zen-user-show],
|
||||
[zen-has-hover], [zen-user-show],
|
||||
[zen-has-empty-tab], [flash-popup],
|
||||
[has-popup-menu], [movingtab],
|
||||
[has-popup-menu], [movingtab],
|
||||
[zen-compact-mode-active]
|
||||
),
|
||||
&[zen-renaming-tab='true'] #navigator-toolbox {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
display: flex;
|
||||
}
|
||||
transition: height var(--zen-hidden-toolbar-transition);
|
||||
|
||||
|
||||
height: var(--zen-element-separation);
|
||||
overflow: clip;
|
||||
|
||||
|
||||
@@ -22,4 +22,3 @@ interface nsIZenDragAndDrop : nsISupports {
|
||||
*/
|
||||
void onDragEnd();
|
||||
};
|
||||
|
||||
|
||||
@@ -10,26 +10,25 @@ namespace {
|
||||
|
||||
static constexpr auto kZenDefaultDragImageOpacity =
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
// For GTK, the default is 0.5 (DRAG_IMAGE_ALPHA_LEVEL) to match
|
||||
// the native behavior. Make sure its synced with the following variable:
|
||||
// https://searchfox.org/firefox-main/rev/14c08f0368ead8bfdddec62f43e0bb5c8fd61289/widget/gtk/nsDragService.cpp#75
|
||||
// For GTK, the default is 0.5 (DRAG_IMAGE_ALPHA_LEVEL) to match
|
||||
// the native behavior. Make sure its synced with the following variable:
|
||||
// https://searchfox.org/firefox-main/rev/14c08f0368ead8bfdddec62f43e0bb5c8fd61289/widget/gtk/nsDragService.cpp#75
|
||||
0.5f;
|
||||
#else
|
||||
// For other platforms, the default is whatever the value of DRAG_TRANSLUCENCY
|
||||
// is, defined in nsBaseDragService.h
|
||||
// For other platforms, the default is whatever the value of
|
||||
// DRAG_TRANSLUCENCY is, defined in nsBaseDragService.h
|
||||
DRAG_TRANSLUCENCY;
|
||||
#endif
|
||||
|
||||
} // namespace: <empty>
|
||||
} // namespace
|
||||
|
||||
// Use the macro to inject all of the definitions for nsISupports.
|
||||
NS_IMPL_ISUPPORTS(nsZenDragAndDrop, nsIZenDragAndDrop)
|
||||
|
||||
nsZenDragAndDrop::nsZenDragAndDrop() {
|
||||
(void)this->OnDragEnd();
|
||||
}
|
||||
nsZenDragAndDrop::nsZenDragAndDrop() { (void)this->OnDragEnd(); }
|
||||
|
||||
auto nsZenDragAndDrop::GetZenDragAndDropInstance() -> nsCOMPtr<nsZenDragAndDrop> {
|
||||
auto nsZenDragAndDrop::GetZenDragAndDropInstance()
|
||||
-> nsCOMPtr<nsZenDragAndDrop> {
|
||||
return do_GetService(ZEN_BOOSTS_BACKEND_CONTRACTID);
|
||||
}
|
||||
|
||||
@@ -45,4 +44,4 @@ nsZenDragAndDrop::OnDragEnd() {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace: zen
|
||||
} // namespace zen
|
||||
|
||||
@@ -28,10 +28,11 @@ class nsZenDragAndDrop final : public nsIZenDragAndDrop {
|
||||
auto GetDragImageOpacity() const { return mDragImageOpacity; }
|
||||
|
||||
/**
|
||||
* @brief Get the singleton instance of nsZenDragAndDrop. There may be occasions
|
||||
* where it won't be available (e.g. on the content process), so this may return
|
||||
* nullptr.
|
||||
* @return nsZenDragAndDrop* The singleton instance, or nullptr if not available
|
||||
* @brief Get the singleton instance of nsZenDragAndDrop. There may be
|
||||
* occasions where it won't be available (e.g. on the content process), so
|
||||
* this may return nullptr.
|
||||
* @return nsZenDragAndDrop* The singleton instance, or nullptr if not
|
||||
* available
|
||||
*/
|
||||
static auto GetZenDragAndDropInstance() -> nsCOMPtr<nsZenDragAndDrop>;
|
||||
|
||||
@@ -40,6 +41,6 @@ class nsZenDragAndDrop final : public nsIZenDragAndDrop {
|
||||
float mDragImageOpacity{};
|
||||
};
|
||||
|
||||
} // namespace zen
|
||||
} // namespace zen
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
content/browser/zen-components/ZenFolder.mjs (../../zen/folders/ZenFolder.mjs)
|
||||
content/browser/zen-components/ZenFolders.mjs (../../zen/folders/ZenFolders.mjs)
|
||||
content/browser/zen-styles/zen-folders.css (../../zen/folders/zen-folders.css)
|
||||
content/browser/zen-styles/zen-folders.css (../../zen/folders/zen-folders.css)
|
||||
|
||||
@@ -88,7 +88,6 @@ zen-folder {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
align-content: center;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
|
||||
@@ -266,8 +265,8 @@ zen-folder[collapsed] > .tab-group-container {
|
||||
}
|
||||
|
||||
#zen-folder-tabs-popup .zen-folder-tabs-list-search-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: var(--size-item-small);
|
||||
height: var(--size-item-small);
|
||||
margin: 10px 2px 10px 10px;
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
@@ -275,8 +274,8 @@ zen-folder[collapsed] > .tab-group-container {
|
||||
}
|
||||
|
||||
.folders-tabs-list-item-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: var(--size-item-small);
|
||||
height: var(--size-item-small);
|
||||
flex-shrink: 0;
|
||||
margin-inline-end: 10px;
|
||||
margin-inline-start: 4px;
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
content/browser/zen-components/ZenGlanceManager.mjs (../../zen/glance/ZenGlanceManager.mjs)
|
||||
content/browser/zen-styles/zen-glance.css (../../zen/glance/zen-glance.css)
|
||||
content/browser/zen-styles/zen-glance.css (../../zen/glance/zen-glance.css)
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
}
|
||||
|
||||
& toolbarbutton {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
width: var(--size-item-large);
|
||||
height: var(--size-item-large);
|
||||
background: color-mix(in srgb, light-dark(rgb(24, 24, 24), rgb(231, 231, 231)) 96%, var(--zen-primary-color));
|
||||
transition:
|
||||
background 0.05s ease,
|
||||
@@ -65,7 +65,7 @@
|
||||
width: fit-content;
|
||||
& label {
|
||||
display: block;
|
||||
max-width: 0px;
|
||||
max-width: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="192" height="192">
|
||||
<path d="M0 0 C46.53 0 93.06 0 141 0 C140.31337286 6.17964422 139.55249061 11.27288504 137.70605469 17.05029297 C137.47297387 17.80257864 137.23989305 18.55486431 136.99974918 19.32994652 C136.23144234 21.80315256 135.45168558 24.27258703 134.671875 26.7421875 C134.12437759 28.49738282 133.57765617 30.25282037 133.03166199 32.00848389 C131.87637142 35.71831589 130.71622139 39.42657597 129.55197144 43.13360596 C127.74764855 48.8788063 125.95370897 54.62720979 124.16235352 60.37646484 C123.86778165 61.32180147 123.57320978 62.2671381 123.26971149 63.24112129 C122.67820023 65.13942545 122.08671887 67.03773892 121.49526787 68.93606186 C120.61596105 71.75702774 119.73559404 74.57766091 118.85499573 77.39822388 C113.93371601 93.16794093 109.12231506 108.96839561 104.39160156 124.79638672 C104.15798416 125.57612854 103.92436676 126.35587036 103.68367004 127.15924072 C103.08515835 129.15844483 102.48956633 131.15852242 101.89428711 133.15869141 C101 136 101 136 100 138 C53.47 138 6.94 138 -41 138 C-40.30154873 133.1108411 -39.57595592 129.15411541 -38.15258789 124.53222656 C-37.57916405 122.65642914 -37.57916405 122.65642914 -36.99415588 120.74273682 C-36.57039663 119.37534329 -36.14656076 118.0079735 -35.72265625 116.640625 C-35.27348999 115.1778587 -34.82480765 113.71494372 -34.37657166 112.25189209 C-33.18301778 108.36047716 -31.98331296 104.47098593 -30.78216553 100.58190918 C-29.63602455 96.86810525 -28.49491032 93.15276556 -27.35351562 89.4375 C-24.23585848 79.29161092 -21.11791678 69.14580929 -18 59 C-12.06 39.53 -6.12 20.06 0 0 Z " fill="#C00002" transform="translate(51,54)"/>
|
||||
<path d="M0 0 C18.3328319 -0.77792059 36.66127963 -1.35606988 55.00715542 -1.70980167 C63.53040721 -1.87858134 72.04320263 -2.10845198 80.55981445 -2.48950195 C142.46067644 -5.20608208 142.46067644 -5.20608208 159.53827381 9.52021503 C166.76889916 16.3955246 173.28323862 24.18336817 178 33 C178 34.32 178 35.64 178 37 C159.57187597 37.07007601 141.14378652 37.12298126 122.71555805 37.15543652 C114.15904092 37.17090649 105.60260658 37.19199848 97.04614258 37.22631836 C89.58846853 37.25621675 82.13085443 37.27557406 74.67312211 37.28226548 C70.72416302 37.28617701 66.77537545 37.29537225 62.82647133 37.31719017 C59.10909816 37.33756234 55.39196707 37.34383237 51.67454338 37.33932304 C49.66086617 37.34054104 47.64721527 37.35667936 45.63360596 37.3732605 C44.43192276 37.36913651 43.23023956 37.36501251 41.99214172 37.36076355 C40.42831993 37.36491162 40.42831993 37.36491162 38.83290577 37.36914349 C32.93264951 36.60030705 29.62184448 32.77709579 25.875 28.5 C19.58131594 21.47164064 12.89888852 14.86095567 6.14794922 8.2734375 C5.35146973 7.48839844 4.55499023 6.70335937 3.734375 5.89453125 C3.01475586 5.19175049 2.29513672 4.48896973 1.55371094 3.76489258 C0 2 0 2 0 0 Z " fill="#C00002" transform="translate(14,0)"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -119,8 +119,6 @@
|
||||
position: absolute;
|
||||
width: 110%;
|
||||
height: 110%;
|
||||
background-repeat: no-repeat;
|
||||
opacity: 1;
|
||||
background: url("chrome://browser/content/zen-images/note-indicator.svg") no-repeat;
|
||||
top: -70%;
|
||||
left: 50%;
|
||||
@@ -152,7 +150,6 @@
|
||||
|
||||
& > toolbaritem {
|
||||
flex-grow: 1;
|
||||
padding: 0;
|
||||
transition: padding 0.3s ease-out;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -216,7 +213,7 @@
|
||||
}
|
||||
|
||||
#zen-media-title {
|
||||
height: 16px;
|
||||
height: var(--size-item-small);
|
||||
font-size: math;
|
||||
}
|
||||
|
||||
@@ -250,7 +247,7 @@
|
||||
}
|
||||
|
||||
& label {
|
||||
min-height: 16px;
|
||||
min-height: var(--size-item-small);
|
||||
margin-left: 0;
|
||||
font-weight: 500;
|
||||
position: relative; /* For the animation */
|
||||
@@ -264,9 +261,9 @@
|
||||
|
||||
#zen-media-progress-hbox {
|
||||
flex-grow: 1;
|
||||
height: 2rem;
|
||||
height: var(--size-item-large);
|
||||
align-items: center;
|
||||
padding-top: 0px !important;
|
||||
padding-top: 0 !important;
|
||||
|
||||
#zen-media-controls-toolbar[media-position-hidden] & {
|
||||
display: none;
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
#include "mozilla/GlobalStyleSheetCache.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
|
||||
#define GET_MODS_FILE(chromeFile, err) \
|
||||
#define GET_MODS_FILE(chromeFile, err) \
|
||||
NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR, getter_AddRefs(chromeFile)); \
|
||||
if (!chromeFile) { \
|
||||
return err; \
|
||||
} \
|
||||
if (!chromeFile) { \
|
||||
return err; \
|
||||
} \
|
||||
chromeFile->Append(ZEN_MODS_FILENAME);
|
||||
|
||||
namespace zen {
|
||||
@@ -50,7 +50,7 @@ auto ZenStyleSheetCache::GetModsSheet() -> StyleSheet* {
|
||||
}
|
||||
|
||||
auto ZenStyleSheetCache::LoadSheetFile(nsIFile* aFile,
|
||||
css::SheetParsingMode aParsingMode)
|
||||
css::SheetParsingMode aParsingMode)
|
||||
-> void {
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
NS_NewFileURI(getter_AddRefs(uri), aFile);
|
||||
@@ -66,7 +66,7 @@ auto ZenStyleSheetCache::LoadSheetFile(nsIFile* aFile,
|
||||
}
|
||||
mModsSheet = result.unwrapOr(nullptr);
|
||||
}
|
||||
|
||||
|
||||
/* static */
|
||||
auto ZenStyleSheetCache::Singleton() -> ZenStyleSheetCache* {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
@@ -76,8 +76,9 @@ auto ZenStyleSheetCache::Singleton() -> ZenStyleSheetCache* {
|
||||
return gZenModsCache;
|
||||
}
|
||||
|
||||
nsresult ZenStyleSheetCache::RebuildModsStylesheets(const nsACString& aContents) {
|
||||
// Re-parse the mods stylesheet. By doing so, we read
|
||||
nsresult ZenStyleSheetCache::RebuildModsStylesheets(
|
||||
const nsACString& aContents) {
|
||||
// Re-parse the mods stylesheet. By doing so, we read
|
||||
// Once we have the data as a nsACString, we call ReparseSheet from the
|
||||
// StyleSheet class to re-parse the stylesheet.
|
||||
auto sheet = GetModsSheet();
|
||||
@@ -92,7 +93,6 @@ nsresult ZenStyleSheetCache::RebuildModsStylesheets(const nsACString& aContents)
|
||||
return aRv.StealNSResult();
|
||||
}
|
||||
|
||||
mozilla::StaticRefPtr<ZenStyleSheetCache> ZenStyleSheetCache::gZenModsCache;
|
||||
|
||||
mozilla::StaticRefPtr<ZenStyleSheetCache> ZenStyleSheetCache::gZenModsCache;
|
||||
|
||||
} // namespace: zen
|
||||
} // namespace zen
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
#define mozilla_ZenStyleSheetCache_h__
|
||||
|
||||
#include "mozilla/css/Loader.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
#ifndef ZEN_MODS_FILENAME
|
||||
#define ZEN_MODS_FILENAME u"zen-themes.css"_ns
|
||||
# define ZEN_MODS_FILENAME u"zen-themes.css"_ns
|
||||
#endif
|
||||
|
||||
namespace zen {
|
||||
@@ -38,6 +37,7 @@ class ZenStyleSheetCache final : public nsISupports {
|
||||
nsresult RebuildModsStylesheets(const nsACString& aContents);
|
||||
|
||||
static auto Singleton() -> ZenStyleSheetCache*;
|
||||
|
||||
private:
|
||||
ZenStyleSheetCache() = default;
|
||||
~ZenStyleSheetCache() = default;
|
||||
@@ -46,14 +46,14 @@ class ZenStyleSheetCache final : public nsISupports {
|
||||
* @brief Load the stylesheet from the given file.
|
||||
* @param aFile The file to load the stylesheet from.
|
||||
*/
|
||||
auto LoadSheetFile(nsIFile* aFile, mozilla::css::SheetParsingMode aParsingMode)
|
||||
-> void;
|
||||
auto LoadSheetFile(nsIFile* aFile,
|
||||
mozilla::css::SheetParsingMode aParsingMode) -> void;
|
||||
|
||||
static mozilla::StaticRefPtr<ZenStyleSheetCache> gZenModsCache;
|
||||
|
||||
RefPtr<StyleSheet> mModsSheet;
|
||||
};
|
||||
|
||||
} // namespace zen
|
||||
} // namespace zen
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,4 +22,3 @@ interface nsIZenModsBackend : nsISupports {
|
||||
*/
|
||||
void rebuildModsStyles(in ACString aContents);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,14 +23,12 @@ namespace {
|
||||
static auto GetZenStyleSheetCache() -> ZenStyleSheetCache* {
|
||||
return ZenStyleSheetCache::Singleton();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// Use the macro to inject all of the definitions for nsISupports.
|
||||
NS_IMPL_ISUPPORTS(nsZenModsBackend, nsIZenModsBackend)
|
||||
|
||||
nsZenModsBackend::nsZenModsBackend() {
|
||||
(void)CheckEnabled();
|
||||
}
|
||||
nsZenModsBackend::nsZenModsBackend() { (void)CheckEnabled(); }
|
||||
|
||||
auto nsZenModsBackend::CheckEnabled() -> void {
|
||||
// Check if the mods backend is enabled based on the preference.
|
||||
@@ -44,17 +42,19 @@ auto nsZenModsBackend::CheckEnabled() -> void {
|
||||
!mozilla::Preferences::GetBool("zen.themes.disable-all", false);
|
||||
}
|
||||
|
||||
auto nsZenModsBackend::RebuildModsStyles(const nsACString& aContents) -> nsresult {
|
||||
auto nsZenModsBackend::RebuildModsStyles(const nsACString& aContents)
|
||||
-> nsresult {
|
||||
// Notify that the mods stylesheets have been rebuilt.
|
||||
return GetZenStyleSheetCache()->RebuildModsStylesheets(aContents);
|
||||
}
|
||||
|
||||
} // namespace: zen
|
||||
} // namespace zen
|
||||
|
||||
auto nsStyleSheetService::ZenMarkStylesAsChanged() -> void {
|
||||
for (auto& presShell : mPresShells) {
|
||||
if (presShell) {
|
||||
if (auto doc = presShell->GetDocument(); doc && doc->IsInChromeDocShell()) {
|
||||
if (auto doc = presShell->GetDocument();
|
||||
doc && doc->IsInChromeDocShell()) {
|
||||
// Notify the document that styles have changed.
|
||||
doc->ApplicableStylesChanged();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,6 @@ class nsZenModsBackend final : public nsIZenModsBackend {
|
||||
bool mEnabled = false;
|
||||
};
|
||||
|
||||
} // namespace zen
|
||||
} // namespace zen
|
||||
|
||||
#endif
|
||||
|
||||
@@ -716,7 +716,6 @@ class nsZenWindowSync {
|
||||
* @param {object} options - Options object.
|
||||
* @param {boolean} options.focus - Indicates if the tab should be focused after the swap.
|
||||
* @param {boolean} options.onClose - Indicates if the swap is done during a tab close operation.
|
||||
* @returns {Promise|null} A promise that resolves when the tab state is flushed, or null if the swap cannot be performed.
|
||||
*/
|
||||
#swapBrowserDocShellsInner(aOurTab, aOtherTab, { focus = true, onClose = false } = {}) {
|
||||
// Can't swap between chrome and content processes.
|
||||
@@ -724,7 +723,7 @@ class nsZenWindowSync {
|
||||
this.log(
|
||||
`Cannot swap browsers between tabs ${aOurTab.id} and ${aOtherTab.id} due to process mismatch`
|
||||
);
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
// Running `swapBrowsersAndCloseOther` doesn't expect us to use the tab after
|
||||
// the operation, so it doesn't really care about cleaning up the other tab.
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
* content/browser/zen-styles/zen-decks.css (../../zen/split-view/zen-decks.css)
|
||||
content/browser/zen-components/ZenViewSplitter.mjs (../../zen/split-view/ZenViewSplitter.mjs)
|
||||
content/browser/zen-components/ZenViewSplitter.mjs (../../zen/split-view/ZenViewSplitter.mjs)
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
<hbox id="zen-splitview-overlay">
|
||||
<hbox id ="zen-splitview-dropzone"></hbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
content/browser/zen-components/ZenPinnedTabManager.mjs (../../zen/tabs/ZenPinnedTabManager.mjs)
|
||||
content/browser/zen-components/ZenEssentialsPromo.mjs (../../zen/tabs/ZenEssentialsPromo.mjs)
|
||||
* content/browser/zen-styles/zen-tabs.css (../../zen/tabs/zen-tabs.css)
|
||||
content/browser/zen-styles/zen-tabs/vertical-tabs.css (../../zen/tabs/zen-tabs/vertical-tabs.css)
|
||||
content/browser/zen-styles/zen-tabs/vertical-tabs.css (../../zen/tabs/zen-tabs/vertical-tabs.css)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
Single Toolbar Mode Specific Styles (`zen-single-toolbar='true'`)
|
||||
========================================================================== */
|
||||
:root[zen-single-toolbar="true"] {
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media (-moz-platform: macos) and (not -moz-pref("zen.view.mac.show-three-dot-menu")) {
|
||||
&:not([customizing]) #PanelUI-button:not([open]):not([panelopen]) {
|
||||
position: absolute;
|
||||
@@ -51,6 +52,8 @@
|
||||
/* ==========================================================================
|
||||
Vertical Tabs Mode Specific Styles (`zen.tabs.vertical` pref)
|
||||
========================================================================== */
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.tabs.vertical") {
|
||||
:root:not([zen-window-buttons-reversed="true"]) {
|
||||
& .titlebar-buttonbox-container {
|
||||
@@ -160,9 +163,9 @@
|
||||
}
|
||||
|
||||
.zen-workspace-pinned-tabs-section[hide-separator] & {
|
||||
height: 0px;
|
||||
height: 0;
|
||||
opacity: 0;
|
||||
padding-bottom: 0px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
& toolbarbutton {
|
||||
@@ -196,7 +199,7 @@
|
||||
& .toolbarbutton-icon {
|
||||
width: 10px;
|
||||
transition: transform 0.15s ease-in-out;
|
||||
transform: translateY(0px);
|
||||
transform: translateY(0);
|
||||
|
||||
@starting-style {
|
||||
transform: translateY(-2px);
|
||||
@@ -293,7 +296,7 @@
|
||||
--tab-inner-inline-margin: 0;
|
||||
|
||||
position: relative;
|
||||
border-bottom: 0px solid transparent !important;
|
||||
border-bottom: 0 solid transparent !important;
|
||||
|
||||
--tab-block-margin: 2px;
|
||||
--tab-selected-bgcolor: light-dark(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.18));
|
||||
@@ -351,7 +354,7 @@
|
||||
border-radius: var(--border-radius-medium) !important;
|
||||
|
||||
& .tab-context-line {
|
||||
margin: 0 0px !important;
|
||||
margin: 0 0 !important;
|
||||
width: 3px !important;
|
||||
}
|
||||
}
|
||||
@@ -362,8 +365,8 @@
|
||||
margin: 0 0 0 4px !important;
|
||||
--toolbarbutton-inner-padding: 0;
|
||||
--border-radius-medium: 8px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
width: var(--size-item-medium);
|
||||
height: var(--size-item-medium);
|
||||
--tab-min-height: 24px;
|
||||
--tab-min-width: 24px;
|
||||
|
||||
@@ -402,9 +405,7 @@
|
||||
position: absolute;
|
||||
width: 110%;
|
||||
height: 110%;
|
||||
background-repeat: no-repeat;
|
||||
opacity: 1;
|
||||
background: url("chrome://browser/content/zen-images/note-indicator.svg") no-repeat;
|
||||
background: url("chrome://browser/content/zen-images/note-indicator.svg") no-repeat;
|
||||
top: -70%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
@@ -419,8 +420,8 @@
|
||||
/* Additional styles for glance tabs in "essential" mode */
|
||||
&[zen-essential="true"] .tabbrowser-tab {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
||||
--tab-collapsed-width: 34px;
|
||||
--tab-min-height: 16px;
|
||||
@@ -448,7 +449,7 @@
|
||||
|
||||
#tabbrowser-arrowscrollbox {
|
||||
&::part(scrollbox) {
|
||||
gap: 0px !important;
|
||||
gap: 0 !important;
|
||||
}
|
||||
|
||||
&::part(overflow-start-indicator),
|
||||
@@ -478,7 +479,7 @@
|
||||
opacity 0.1s ease-in-out,
|
||||
margin 0.1s ease-in-out,
|
||||
max-height 0.1s ease-in-out;
|
||||
max-height: 0px;
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
transform: translateY(-4px);
|
||||
font-size: x-small;
|
||||
@@ -586,8 +587,8 @@
|
||||
}
|
||||
|
||||
& image {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
height: var(--size-item-small);
|
||||
width: var(--size-item-small);
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
@@ -923,8 +924,8 @@
|
||||
color: inherit;
|
||||
fill: currentColor;
|
||||
padding: var(--tab-close-button-padding);
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
width: var(--size-item-medium);
|
||||
height: var(--size-item-medium);
|
||||
outline: var(--toolbarbutton-outline);
|
||||
|
||||
&:hover {
|
||||
@@ -951,8 +952,8 @@
|
||||
|
||||
& > image {
|
||||
list-style-image: var(--zen-original-tab-icon);
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: var(--size-item-small);
|
||||
height: var(--size-item-small);
|
||||
pointer-events: none;
|
||||
border-radius: 4px;
|
||||
}
|
||||
@@ -961,7 +962,7 @@
|
||||
content: "";
|
||||
display: block;
|
||||
width: 2.5px;
|
||||
height: 16px;
|
||||
height: var(--size-item-small);
|
||||
background: light-dark(rgba(66, 61, 61, 0.3), rgba(255, 255, 255, 0.3));
|
||||
position: absolute;
|
||||
right: 0;
|
||||
@@ -1059,6 +1060,7 @@
|
||||
-moz-user-focus: ignore !important;
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.tabs.show-newtab-vertical") {
|
||||
#tabs-newtab-button {
|
||||
max-height: var(--tab-min-height);
|
||||
@@ -1089,6 +1091,7 @@
|
||||
--zen-colors-border: var(--zen-colors-tertiary);
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.view.show-newtab-button-top") {
|
||||
order: -1;
|
||||
}
|
||||
@@ -1192,6 +1195,7 @@
|
||||
background: light-dark(rgba(0, 0, 0, 0.1), var(--tab-selected-bgcolor));
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media -moz-pref("zen.theme.essentials-favicon-bg") {
|
||||
&[visuallyselected] > .tab-stack > .tab-background {
|
||||
&::after {
|
||||
@@ -1340,6 +1344,7 @@
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media (-moz-pref("zen.theme.hide-tab-throbber")) {
|
||||
.tab-throbber {
|
||||
display: none !important;
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
[DEFAULT]
|
||||
|
||||
["browser_compact_mode_width.js"]
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
prefs = ["zen.workspaces.separate-essentials=true"]
|
||||
|
||||
["browser_container_auto_switch.js"]
|
||||
["browser_container_specific_essentials.js"]
|
||||
|
||||
["browser_container_specific_essentials.js"]
|
||||
|
||||
@@ -8,17 +8,28 @@ support-files = [
|
||||
"head.js",
|
||||
]
|
||||
|
||||
["browser_folder_create.js"]
|
||||
["browser_folder_subfolder.js"]
|
||||
["browser_folder_basic_toggle.js"]
|
||||
["browser_folder_owner_tabs.js"]
|
||||
|
||||
["browser_folder_create.js"]
|
||||
|
||||
["browser_folder_density.js"]
|
||||
["browser_folder_max_subfolders.js"]
|
||||
|
||||
["browser_folder_empty_tab.js"]
|
||||
["browser_folder_multiselected.js"]
|
||||
["browser_folder_visible_tabs.js"]
|
||||
["browser_folder_level_checks.js"]
|
||||
["browser_folder_reset_button.js"]
|
||||
|
||||
["browser_folder_issue_9885.js"]
|
||||
|
||||
["browser_folder_issue_9981.js"]
|
||||
|
||||
["browser_folder_level_checks.js"]
|
||||
|
||||
["browser_folder_max_subfolders.js"]
|
||||
|
||||
["browser_folder_multiselected.js"]
|
||||
|
||||
["browser_folder_owner_tabs.js"]
|
||||
|
||||
["browser_folder_reset_button.js"]
|
||||
|
||||
["browser_folder_subfolder.js"]
|
||||
|
||||
["browser_folder_visible_tabs.js"]
|
||||
|
||||
@@ -8,9 +8,15 @@ support-files = [
|
||||
]
|
||||
|
||||
["browser_glance_basic.js"]
|
||||
["browser_glance_expand.js"]
|
||||
|
||||
["browser_glance_close.js"]
|
||||
["browser_glance_next_tab.js"]
|
||||
["browser_glance_prev_tab.js"]
|
||||
["browser_glance_select_parent.js"]
|
||||
|
||||
["browser_glance_close_select.js"]
|
||||
|
||||
["browser_glance_expand.js"]
|
||||
|
||||
["browser_glance_next_tab.js"]
|
||||
|
||||
["browser_glance_prev_tab.js"]
|
||||
|
||||
["browser_glance_select_parent.js"]
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
["browser_live_folder.js"]
|
||||
["browser_rss_live_folder.js"]
|
||||
[DEFAULT]
|
||||
|
||||
["browser_github_live_folder.js"]
|
||||
|
||||
["browser_live_folder.js"]
|
||||
|
||||
["browser_rss_live_folder.js"]
|
||||
|
||||
@@ -17,69 +17,69 @@ import CoreText
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="print verbose registration failures",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"file", nargs="*", help="font file to register or unregister", default=[]
|
||||
)
|
||||
parser.add_argument(
|
||||
"-u",
|
||||
"--unregister",
|
||||
action="store_true",
|
||||
help="unregister the provided fonts",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
"--persist-user",
|
||||
action="store_true",
|
||||
help="permanently register the font",
|
||||
default=False,
|
||||
)
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="print verbose registration failures",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"file", nargs="*", help="font file to register or unregister", default=[]
|
||||
)
|
||||
parser.add_argument(
|
||||
"-u",
|
||||
"--unregister",
|
||||
action="store_true",
|
||||
help="unregister the provided fonts",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
"--persist-user",
|
||||
action="store_true",
|
||||
help="permanently register the font",
|
||||
default=False,
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.persist_user:
|
||||
scope = CoreText.kCTFontManagerScopeUser
|
||||
scopeDesc = "user"
|
||||
else:
|
||||
scope = CoreText.kCTFontManagerScopeSession
|
||||
scopeDesc = "session"
|
||||
|
||||
failureCount = 0
|
||||
for fontPath in args.file:
|
||||
fontURL = Cocoa.NSURL.fileURLWithPath_(fontPath)
|
||||
(result, error) = register_or_unregister_font(fontURL, args.unregister, scope)
|
||||
if result:
|
||||
print(
|
||||
"%sregistered font %s with %s scope"
|
||||
% (("un" if args.unregister else ""), fontPath, scopeDesc)
|
||||
)
|
||||
if args.persist_user:
|
||||
scope = CoreText.kCTFontManagerScopeUser
|
||||
scopeDesc = "user"
|
||||
else:
|
||||
print(
|
||||
"Failed to %sregister font %s with %s scope"
|
||||
% (("un" if args.unregister else ""), fontPath, scopeDesc)
|
||||
)
|
||||
if args.verbose:
|
||||
print(error)
|
||||
failureCount += 1
|
||||
scope = CoreText.kCTFontManagerScopeSession
|
||||
scopeDesc = "session"
|
||||
|
||||
sys.exit(failureCount)
|
||||
failureCount = 0
|
||||
for fontPath in args.file:
|
||||
fontURL = Cocoa.NSURL.fileURLWithPath_(fontPath)
|
||||
(result, error) = register_or_unregister_font(fontURL, args.unregister, scope)
|
||||
if result:
|
||||
print(
|
||||
"%sregistered font %s with %s scope"
|
||||
% (("un" if args.unregister else ""), fontPath, scopeDesc)
|
||||
)
|
||||
else:
|
||||
print(
|
||||
"Failed to %sregister font %s with %s scope"
|
||||
% (("un" if args.unregister else ""), fontPath, scopeDesc)
|
||||
)
|
||||
if args.verbose:
|
||||
print(error)
|
||||
failureCount += 1
|
||||
|
||||
sys.exit(failureCount)
|
||||
|
||||
|
||||
def register_or_unregister_font(fontURL, unregister, scope):
|
||||
return (
|
||||
CoreText.CTFontManagerUnregisterFontsForURL(fontURL, scope, None)
|
||||
if unregister
|
||||
else CoreText.CTFontManagerRegisterFontsForURL(fontURL, scope, None)
|
||||
)
|
||||
return (
|
||||
CoreText.CTFontManagerUnregisterFontsForURL(fontURL, scope, None)
|
||||
if unregister
|
||||
else CoreText.CTFontManagerRegisterFontsForURL(fontURL, scope, None)
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
@@ -31,138 +31,138 @@ from Cocoa import NSURL
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Utility to print, set, or "
|
||||
+ "check the path to image being used as "
|
||||
+ "the desktop background image. By "
|
||||
+ "default, prints the path to the "
|
||||
+ "current desktop background image."
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="print verbose debugging information",
|
||||
default=False,
|
||||
)
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
group.add_argument(
|
||||
"-s",
|
||||
"--set-background-image",
|
||||
dest="newBackgroundImagePath",
|
||||
required=False,
|
||||
help="path to the new background image to set. A zero "
|
||||
+ "exit code indicates no errors occurred.",
|
||||
default=None,
|
||||
)
|
||||
group.add_argument(
|
||||
"-c",
|
||||
"--check-background-image",
|
||||
dest="checkBackgroundImagePath",
|
||||
required=False,
|
||||
help="check if the provided background image path "
|
||||
+ "matches the provided path. A zero exit code "
|
||||
+ "indicates the paths match.",
|
||||
default=None,
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Using logging for verbose output
|
||||
if args.verbose:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
else:
|
||||
logging.basicConfig(level=logging.CRITICAL)
|
||||
logger = logging.getLogger("desktopImage")
|
||||
|
||||
# Print what we're going to do
|
||||
if args.checkBackgroundImagePath is not None:
|
||||
logger.debug(
|
||||
"checking provided desktop image %s matches current "
|
||||
"image" % args.checkBackgroundImagePath
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Utility to print, set, or "
|
||||
+ "check the path to image being used as "
|
||||
+ "the desktop background image. By "
|
||||
+ "default, prints the path to the "
|
||||
+ "current desktop background image."
|
||||
)
|
||||
elif args.newBackgroundImagePath is not None:
|
||||
logger.debug("setting image to %s " % args.newBackgroundImagePath)
|
||||
else:
|
||||
logger.debug("retrieving desktop image path")
|
||||
|
||||
focussedScreen = NSScreen.mainScreen()
|
||||
if not focussedScreen:
|
||||
raise RuntimeError("mainScreen error")
|
||||
|
||||
ws = NSWorkspace.sharedWorkspace()
|
||||
if not ws:
|
||||
raise RuntimeError("sharedWorkspace error")
|
||||
|
||||
# If we're just checking the image path, check it and then return.
|
||||
# A successful exit code (0) indicates the paths match.
|
||||
if args.checkBackgroundImagePath is not None:
|
||||
# Get existing desktop image path and resolve it
|
||||
existingImageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
existingImagePath = existingImageURL.path()
|
||||
existingImagePathReal = os.path.realpath(existingImagePath)
|
||||
logger.debug("existing desktop image: %s" % existingImagePath)
|
||||
logger.debug("existing desktop image realpath: %s" % existingImagePath)
|
||||
|
||||
# Resolve the path we're going to check
|
||||
checkImagePathReal = os.path.realpath(args.checkBackgroundImagePath)
|
||||
logger.debug("check desktop image: %s" % args.checkBackgroundImagePath)
|
||||
logger.debug("check desktop image realpath: %s" % checkImagePathReal)
|
||||
|
||||
if existingImagePathReal == checkImagePathReal:
|
||||
print("desktop image path matches provided path")
|
||||
return True
|
||||
|
||||
print("desktop image path does NOT match provided path")
|
||||
return False
|
||||
|
||||
# Log the current desktop image
|
||||
if args.verbose:
|
||||
existingImageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
logger.debug("existing desktop image: %s" % existingImageURL.path())
|
||||
|
||||
# Set the desktop image
|
||||
if args.newBackgroundImagePath is not None:
|
||||
newImagePath = args.newBackgroundImagePath
|
||||
if not os.path.exists(newImagePath):
|
||||
logger.critical("%s does not exist" % newImagePath)
|
||||
return False
|
||||
if not os.access(newImagePath, os.R_OK):
|
||||
logger.critical("%s is not readable" % newImagePath)
|
||||
return False
|
||||
|
||||
logger.debug("new desktop image to set: %s" % newImagePath)
|
||||
newImageURL = NSURL.fileURLWithPath_(newImagePath)
|
||||
logger.debug("new desktop image URL to set: %s" % newImageURL)
|
||||
|
||||
status = False
|
||||
(status, error) = ws.setDesktopImageURL_forScreen_options_error_(
|
||||
newImageURL, focussedScreen, None, None
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="print verbose debugging information",
|
||||
default=False,
|
||||
)
|
||||
if not status:
|
||||
raise RuntimeError("setDesktopImageURL error")
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
group.add_argument(
|
||||
"-s",
|
||||
"--set-background-image",
|
||||
dest="newBackgroundImagePath",
|
||||
required=False,
|
||||
help="path to the new background image to set. A zero "
|
||||
+ "exit code indicates no errors occurred.",
|
||||
default=None,
|
||||
)
|
||||
group.add_argument(
|
||||
"-c",
|
||||
"--check-background-image",
|
||||
dest="checkBackgroundImagePath",
|
||||
required=False,
|
||||
help="check if the provided background image path "
|
||||
+ "matches the provided path. A zero exit code "
|
||||
+ "indicates the paths match.",
|
||||
default=None,
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Print the current desktop image
|
||||
imageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
imagePath = imageURL.path()
|
||||
imagePathReal = os.path.realpath(imagePath)
|
||||
logger.debug("updated desktop image URL: %s" % imageURL)
|
||||
logger.debug("updated desktop image path: %s" % imagePath)
|
||||
logger.debug("updated desktop image path (resolved): %s" % imagePathReal)
|
||||
print(imagePathReal)
|
||||
return True
|
||||
# Using logging for verbose output
|
||||
if args.verbose:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
else:
|
||||
logging.basicConfig(level=logging.CRITICAL)
|
||||
logger = logging.getLogger("desktopImage")
|
||||
|
||||
# Print what we're going to do
|
||||
if args.checkBackgroundImagePath is not None:
|
||||
logger.debug(
|
||||
"checking provided desktop image %s matches current "
|
||||
"image" % args.checkBackgroundImagePath
|
||||
)
|
||||
elif args.newBackgroundImagePath is not None:
|
||||
logger.debug("setting image to %s " % args.newBackgroundImagePath)
|
||||
else:
|
||||
logger.debug("retrieving desktop image path")
|
||||
|
||||
focussedScreen = NSScreen.mainScreen()
|
||||
if not focussedScreen:
|
||||
raise RuntimeError("mainScreen error")
|
||||
|
||||
ws = NSWorkspace.sharedWorkspace()
|
||||
if not ws:
|
||||
raise RuntimeError("sharedWorkspace error")
|
||||
|
||||
# If we're just checking the image path, check it and then return.
|
||||
# A successful exit code (0) indicates the paths match.
|
||||
if args.checkBackgroundImagePath is not None:
|
||||
# Get existing desktop image path and resolve it
|
||||
existingImageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
existingImagePath = existingImageURL.path()
|
||||
existingImagePathReal = os.path.realpath(existingImagePath)
|
||||
logger.debug("existing desktop image: %s" % existingImagePath)
|
||||
logger.debug("existing desktop image realpath: %s" % existingImagePath)
|
||||
|
||||
# Resolve the path we're going to check
|
||||
checkImagePathReal = os.path.realpath(args.checkBackgroundImagePath)
|
||||
logger.debug("check desktop image: %s" % args.checkBackgroundImagePath)
|
||||
logger.debug("check desktop image realpath: %s" % checkImagePathReal)
|
||||
|
||||
if existingImagePathReal == checkImagePathReal:
|
||||
print("desktop image path matches provided path")
|
||||
return True
|
||||
|
||||
print("desktop image path does NOT match provided path")
|
||||
return False
|
||||
|
||||
# Log the current desktop image
|
||||
if args.verbose:
|
||||
existingImageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
logger.debug("existing desktop image: %s" % existingImageURL.path())
|
||||
|
||||
# Set the desktop image
|
||||
if args.newBackgroundImagePath is not None:
|
||||
newImagePath = args.newBackgroundImagePath
|
||||
if not os.path.exists(newImagePath):
|
||||
logger.critical("%s does not exist" % newImagePath)
|
||||
return False
|
||||
if not os.access(newImagePath, os.R_OK):
|
||||
logger.critical("%s is not readable" % newImagePath)
|
||||
return False
|
||||
|
||||
logger.debug("new desktop image to set: %s" % newImagePath)
|
||||
newImageURL = NSURL.fileURLWithPath_(newImagePath)
|
||||
logger.debug("new desktop image URL to set: %s" % newImageURL)
|
||||
|
||||
status = False
|
||||
(status, error) = ws.setDesktopImageURL_forScreen_options_error_(
|
||||
newImageURL, focussedScreen, None, None
|
||||
)
|
||||
if not status:
|
||||
raise RuntimeError("setDesktopImageURL error")
|
||||
|
||||
# Print the current desktop image
|
||||
imageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
imagePath = imageURL.path()
|
||||
imagePathReal = os.path.realpath(imagePath)
|
||||
logger.debug("updated desktop image URL: %s" % imageURL)
|
||||
logger.debug("updated desktop image path: %s" % imagePath)
|
||||
logger.debug("updated desktop image path (resolved): %s" % imagePathReal)
|
||||
print(imagePathReal)
|
||||
return True
|
||||
|
||||
|
||||
def getCurrentDesktopImageURL(focussedScreen, workspace, logger):
|
||||
imageURL = workspace.desktopImageURLForScreen_(focussedScreen)
|
||||
if not imageURL:
|
||||
raise RuntimeError("desktopImageURLForScreen returned invalid URL")
|
||||
if not imageURL.isFileURL():
|
||||
logger.warning("desktop image URL is not a file URL")
|
||||
return imageURL
|
||||
imageURL = workspace.desktopImageURLForScreen_(focussedScreen)
|
||||
if not imageURL:
|
||||
raise RuntimeError("desktopImageURLForScreen returned invalid URL")
|
||||
if not imageURL.isFileURL():
|
||||
logger.warning("desktop image URL is not a file URL")
|
||||
return imageURL
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not main():
|
||||
sys.exit(1)
|
||||
else:
|
||||
sys.exit(0)
|
||||
if not main():
|
||||
sys.exit(1)
|
||||
else:
|
||||
sys.exit(0)
|
||||
|
||||
@@ -5,14 +5,22 @@
|
||||
[DEFAULT]
|
||||
prefs = ["zen.workspaces.separate-essentials=false"]
|
||||
|
||||
["browser_pinned_unload_changed.js"]
|
||||
["browser_pinned_unload_noreset.js"]
|
||||
["browser_pinned_nounload_reset.js"]
|
||||
["browser_pinned_switch.js"]
|
||||
["browser_pinned_reset_noswitch.js"]
|
||||
["browser_pinned_close.js"]
|
||||
["browser_issue_8726.js"]
|
||||
|
||||
["browser_pinned_changed.js"]
|
||||
|
||||
["browser_pinned_close.js"]
|
||||
|
||||
["browser_pinned_created.js"]
|
||||
|
||||
["browser_pinned_nounload_reset.js"]
|
||||
|
||||
["browser_pinned_reset_noswitch.js"]
|
||||
|
||||
["browser_pinned_switch.js"]
|
||||
|
||||
["browser_pinned_to_essential.js"]
|
||||
|
||||
["browser_issue_8726.js"]
|
||||
["browser_pinned_unload_changed.js"]
|
||||
|
||||
["browser_pinned_unload_noreset.js"]
|
||||
|
||||
@@ -9,9 +9,15 @@ support-files = [
|
||||
]
|
||||
|
||||
["browser_basic_split_view.js"]
|
||||
["browser_split_inset_checks.js"]
|
||||
["browser_split_groups.js"]
|
||||
|
||||
["browser_split_browser_duplication.js"]
|
||||
["browser_split_view_with_glance.js"]
|
||||
["browser_split_view_with_folders.js"]
|
||||
|
||||
["browser_split_groups.js"]
|
||||
|
||||
["browser_split_inset_checks.js"]
|
||||
|
||||
["browser_split_view_empty.js"]
|
||||
|
||||
["browser_split_view_with_folders.js"]
|
||||
|
||||
["browser_split_view_with_glance.js"]
|
||||
|
||||
@@ -7,12 +7,16 @@ support-files = [
|
||||
"head.js",
|
||||
]
|
||||
|
||||
["browser_tabs_empty_checks.js"]
|
||||
["browser_tabs_close_recently.js"]
|
||||
["browser_tabs_fetch_checks.js"]
|
||||
["browser_tabs_cycle_by_attribute.js"]
|
||||
["browser_drag_drop_vertical.js"]
|
||||
tags = [
|
||||
"drag-drop",
|
||||
"vertical-tabs"
|
||||
]
|
||||
|
||||
["browser_tabs_close_recently.js"]
|
||||
|
||||
["browser_tabs_cycle_by_attribute.js"]
|
||||
|
||||
["browser_tabs_empty_checks.js"]
|
||||
|
||||
["browser_tabs_fetch_checks.js"]
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
["browser_ub_actions_search.js"]
|
||||
[DEFAULT]
|
||||
|
||||
["browser_ub_actions_search.js"]
|
||||
|
||||
@@ -9,4 +9,5 @@ support-files = [
|
||||
]
|
||||
|
||||
["browser_floating_urlbar.js"]
|
||||
|
||||
["browser_issue_7385.js"]
|
||||
|
||||
@@ -8,5 +8,6 @@ support-files = [
|
||||
"head.js",
|
||||
]
|
||||
|
||||
["browser_sync_tab_open.js"]
|
||||
["browser_sync_tab_label.js"]
|
||||
|
||||
["browser_sync_tab_open.js"]
|
||||
|
||||
@@ -9,13 +9,19 @@ support-files = [
|
||||
]
|
||||
|
||||
["browser_basic_workspaces.js"]
|
||||
["browser_workspace_bookmarks.js"]
|
||||
["browser_double_click_newtab.js"]
|
||||
["browser_overflow_scrollbox.js"]
|
||||
|
||||
["browser_issue_8699.js"]
|
||||
["browser_issue_9900.js"]
|
||||
["browser_double_click_newtab.js"]
|
||||
|
||||
["browser_issue_10455.js"]
|
||||
|
||||
["browser_issue_8699.js"]
|
||||
|
||||
["browser_issue_9900.js"]
|
||||
|
||||
["browser_overflow_scrollbox.js"]
|
||||
|
||||
["browser_private_mode.js"]
|
||||
|
||||
["browser_private_mode_startup.js"]
|
||||
|
||||
["browser_workspace_bookmarks.js"]
|
||||
|
||||
@@ -25,10 +25,10 @@ using WindowGlobalChild = mozilla::dom::WindowGlobalChild;
|
||||
|
||||
namespace {
|
||||
/**
|
||||
* @brief Helper function to fetch the most recent window proxy.
|
||||
* @param aWindow The window to query.
|
||||
* @returns The most recent window.
|
||||
*/
|
||||
* @brief Helper function to fetch the most recent window proxy.
|
||||
* @param aWindow The window to query.
|
||||
* @returns The most recent window.
|
||||
*/
|
||||
static nsresult GetMostRecentWindowProxy(mozIDOMWindowProxy** aWindow) {
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIWindowMediator> med(
|
||||
@@ -40,9 +40,9 @@ static nsresult GetMostRecentWindowProxy(mozIDOMWindowProxy** aWindow) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
/**
|
||||
* @brief Helper function to query and get a reference to the window.
|
||||
* @param aWindow The window to query.
|
||||
*/
|
||||
* @brief Helper function to query and get a reference to the window.
|
||||
* @param aWindow The window to query.
|
||||
*/
|
||||
static nsCOMPtr<mozIDOMWindowProxy> GetMostRecentWindow() {
|
||||
nsCOMPtr<mozIDOMWindowProxy> aWindow;
|
||||
nsresult rv = GetMostRecentWindowProxy(getter_AddRefs(aWindow));
|
||||
@@ -51,12 +51,12 @@ static nsCOMPtr<mozIDOMWindowProxy> GetMostRecentWindow() {
|
||||
}
|
||||
return aWindow;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
using mozilla::dom::WindowGlobalChild;
|
||||
|
||||
#define NS_ZEN_CAN_SHARE_FAILURE() \
|
||||
*canShare = false; \
|
||||
*canShare = false; \
|
||||
return NS_OK;
|
||||
|
||||
NS_IMETHODIMP
|
||||
@@ -80,28 +80,29 @@ ZenCommonUtils::CanShare(bool* canShare) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ZenCommonUtils::Share(nsIURI* url, const nsACString& title, const nsACString& text,
|
||||
uint32_t aX, uint32_t aY, uint32_t aWidth, uint32_t aHeight) {
|
||||
ZenCommonUtils::Share(nsIURI* url, const nsACString& title,
|
||||
const nsACString& text, uint32_t aX, uint32_t aY,
|
||||
uint32_t aWidth, uint32_t aHeight) {
|
||||
auto aWindow = GetMostRecentWindow();
|
||||
if (!aWindow) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
if (!IsSharingSupported()) {
|
||||
return NS_OK; // We don't want to throw an error here
|
||||
return NS_OK; // We don't want to throw an error here
|
||||
}
|
||||
return ShareInternal(aWindow, url, title, text, aX, aY, aWidth, aHeight);
|
||||
}
|
||||
|
||||
nsresult ZenCommonUtils::ShareInternal(nsCOMPtr<mozIDOMWindowProxy>& aWindow, nsIURI* url,
|
||||
const nsACString& title, const nsACString& text, uint32_t aX, uint32_t aY,
|
||||
uint32_t aWidth, uint32_t aHeight) {
|
||||
nsresult ZenCommonUtils::ShareInternal(nsCOMPtr<mozIDOMWindowProxy>& aWindow,
|
||||
nsIURI* url, const nsACString& title,
|
||||
const nsACString& text, uint32_t aX,
|
||||
uint32_t aY, uint32_t aWidth,
|
||||
uint32_t aHeight) {
|
||||
// We shoud've had done pointer checks before, so we can assume
|
||||
// aWindow is valid.
|
||||
#ifdef NS_ZEN_CAN_SHARE_NATIVE
|
||||
return ::nsZenNativeShareInternal::ShowNativeDialog(
|
||||
aWindow, url, title, text,
|
||||
aX, aY, aWidth, aHeight
|
||||
);
|
||||
return ::nsZenNativeShareInternal::ShowNativeDialog(aWindow, url, title, text,
|
||||
aX, aY, aWidth, aHeight);
|
||||
#else
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#endif
|
||||
@@ -118,4 +119,4 @@ auto ZenCommonUtils::IsSharingSupported() -> bool {
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace: zen
|
||||
} // namespace zen
|
||||
|
||||
@@ -40,9 +40,9 @@ class ZenCommonUtils final : public nsIZenCommonUtils {
|
||||
* @returns A promise that resolves when the share is complete.
|
||||
*/
|
||||
static auto ShareInternal(nsCOMPtr<mozIDOMWindowProxy>& aWindow, nsIURI* url,
|
||||
const nsACString& title, const nsACString& text, uint32_t aX, uint32_t aY,
|
||||
uint32_t aWidth, uint32_t aHeight)
|
||||
-> nsresult;
|
||||
const nsACString& title, const nsACString& text,
|
||||
uint32_t aX, uint32_t aY, uint32_t aWidth,
|
||||
uint32_t aHeight) -> nsresult;
|
||||
/**
|
||||
* @brief Helper function to play haptic feedback.
|
||||
*/
|
||||
@@ -56,6 +56,6 @@ class ZenCommonUtils final : public nsIZenCommonUtils {
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace zen
|
||||
} // namespace zen
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,26 +12,27 @@
|
||||
#include "nsIURI.h"
|
||||
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
#define NS_ZEN_CAN_SHARE_NATIVE true
|
||||
# define NS_ZEN_CAN_SHARE_NATIVE true
|
||||
|
||||
class nsZenNativeShareInternal final {
|
||||
public:
|
||||
/**
|
||||
* @brief Use the native share dialog. This only works on Windows and MacOS
|
||||
* since the native share dialog is not available on other platforms.
|
||||
* Macos does need pointer coordinates to show the share dialog while
|
||||
* Windows does not since it just displays a dialog on the middle of the
|
||||
* screen.
|
||||
* @param aWindow The window to use for the share dialog.
|
||||
* @param aUrl The URL to share.
|
||||
* @param aTitle The title of the share.
|
||||
* @param aText The text to share.
|
||||
* @returns void
|
||||
*/
|
||||
static auto ShowNativeDialog(nsCOMPtr<mozIDOMWindowProxy>& aWindow, nsIURI* aUrl,
|
||||
const nsACString& aTitle, const nsACString& aText, uint32_t aX = 0, uint32_t aY = 0,
|
||||
uint32_t aWidth = 0, uint32_t aHeight = 0)
|
||||
-> nsresult;
|
||||
* @brief Use the native share dialog. This only works on Windows and MacOS
|
||||
* since the native share dialog is not available on other platforms.
|
||||
* Macos does need pointer coordinates to show the share dialog while
|
||||
* Windows does not since it just displays a dialog on the middle of the
|
||||
* screen.
|
||||
* @param aWindow The window to use for the share dialog.
|
||||
* @param aUrl The URL to share.
|
||||
* @param aTitle The title of the share.
|
||||
* @param aText The text to share.
|
||||
* @returns void
|
||||
*/
|
||||
static auto ShowNativeDialog(nsCOMPtr<mozIDOMWindowProxy>& aWindow,
|
||||
nsIURI* aUrl, const nsACString& aTitle,
|
||||
const nsACString& aText, uint32_t aX = 0,
|
||||
uint32_t aY = 0, uint32_t aWidth = 0,
|
||||
uint32_t aHeight = 0) -> nsresult;
|
||||
|
||||
nsZenNativeShareInternal() = default;
|
||||
~nsZenNativeShareInternal() = default;
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace zen {
|
||||
nsresult ZenCommonUtils::PlayHapticFeedbackInternal() {
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
if (@available(macOS 10.14, *)) {
|
||||
id<NSHapticFeedbackPerformer> performer = [NSHapticFeedbackManager defaultPerformer];
|
||||
id<NSHapticFeedbackPerformer> performer =
|
||||
[NSHapticFeedbackManager defaultPerformer];
|
||||
[performer performFeedbackPattern:NSHapticFeedbackPatternAlignment
|
||||
performanceTime:NSHapticFeedbackPerformanceTimeDefault];
|
||||
}
|
||||
@@ -29,4 +30,4 @@ nsresult ZenCommonUtils::PlayHapticFeedbackInternal() {
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_OK);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace zen
|
||||
|
||||
@@ -26,8 +26,8 @@ using ::mozilla::widget::WidgetUtils;
|
||||
* @param a_nativeWindow The pointer to the native NSWindow.
|
||||
* @return NS_OK on success, or an error code on failure.
|
||||
*/
|
||||
static nsresult GetNativeWindowPointerFromDOMWindow(mozIDOMWindowProxy* a_window,
|
||||
NSWindow** a_nativeWindow) {
|
||||
static nsresult GetNativeWindowPointerFromDOMWindow(
|
||||
mozIDOMWindowProxy* a_window, NSWindow** a_nativeWindow) {
|
||||
*a_nativeWindow = nil;
|
||||
if (!a_window) return NS_ERROR_INVALID_ARG;
|
||||
nsPIDOMWindowOuter* win = nsPIDOMWindowOuter::From(a_window);
|
||||
@@ -38,12 +38,12 @@ static nsresult GetNativeWindowPointerFromDOMWindow(mozIDOMWindowProxy* a_window
|
||||
*a_nativeWindow = (NSWindow*)widget->GetNativeData(NS_NATIVE_WINDOW);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
} // namespace zen
|
||||
|
||||
auto nsZenNativeShareInternal::ShowNativeDialog(nsCOMPtr<mozIDOMWindowProxy>& aWindow,
|
||||
nsIURI* aUrl, const nsACString& aTitle, const nsACString& aText, uint32_t aX, uint32_t aY,
|
||||
uint32_t aWidth, uint32_t aHeight)
|
||||
-> nsresult {
|
||||
auto nsZenNativeShareInternal::ShowNativeDialog(
|
||||
nsCOMPtr<mozIDOMWindowProxy>& aWindow, nsIURI* aUrl,
|
||||
const nsACString& aTitle, const nsACString& aText, uint32_t aX, uint32_t aY,
|
||||
uint32_t aWidth, uint32_t aHeight) -> nsresult {
|
||||
// Just use the URL since apple doesn't support sharing text
|
||||
// and title in the share dialog
|
||||
nsAutoCString pageUrlAsStringTemp;
|
||||
@@ -53,9 +53,8 @@ auto nsZenNativeShareInternal::ShowNativeDialog(nsCOMPtr<mozIDOMWindowProxy>& aW
|
||||
} else {
|
||||
pageUrlAsStringTemp.SetIsVoid(true);
|
||||
}
|
||||
NSURL* pageUrl = nsCocoaUtils::ToNSURL(
|
||||
NS_ConvertUTF8toUTF16(pageUrlAsStringTemp)
|
||||
);
|
||||
NSURL* pageUrl =
|
||||
nsCocoaUtils::ToNSURL(NS_ConvertUTF8toUTF16(pageUrlAsStringTemp));
|
||||
if (!pageUrl || (![pageUrl.scheme isEqualToString:@"https"] &&
|
||||
![pageUrl.scheme isEqualToString:@"http"])) {
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
@@ -20,7 +20,7 @@ interface nsIZenCommonUtils : nsISupports {
|
||||
* @param y The y coordinate of the share dialog.
|
||||
* @returns A promise that resolves when the share is complete.
|
||||
*/
|
||||
void share(in nsIURI url, in ACString title, in ACString text,
|
||||
void share(in nsIURI url, in ACString title, in ACString text,
|
||||
in uint32_t x, in uint32_t y, in uint32_t width, in uint32_t height);
|
||||
/*
|
||||
* @brief Check if the current context can share data.
|
||||
@@ -33,4 +33,3 @@ interface nsIZenCommonUtils : nsISupports {
|
||||
*/
|
||||
void playHapticFeedback();
|
||||
};
|
||||
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
|
||||
namespace zen {
|
||||
/**
|
||||
* @brief Helper function to convert UTF-8 to UTF-16.
|
||||
* @param aStr The UTF-8 string to convert.
|
||||
* @returns The converted UTF-16 string.
|
||||
*/
|
||||
* @brief Helper function to convert UTF-8 to UTF-16.
|
||||
* @param aStr The UTF-8 string to convert.
|
||||
* @returns The converted UTF-16 string.
|
||||
*/
|
||||
inline NS_ConvertUTF8toUTF16 NS_ConvertUTF8toUTF16_MaybeVoid(
|
||||
const nsACString& aStr) {
|
||||
auto str = NS_ConvertUTF8toUTF16(aStr);
|
||||
str.SetIsVoid(aStr.IsVoid());
|
||||
return str;
|
||||
}
|
||||
} // namespace: zen
|
||||
} // namespace zen
|
||||
|
||||
auto nsZenNativeShareInternal::ShowNativeDialog(
|
||||
nsCOMPtr<mozIDOMWindowProxy>& aWindow, nsIURI* aUrl, const nsACString& aTitle,
|
||||
const nsACString& aText, uint32_t aX, uint32_t aY, uint32_t aWidth, uint32_t aHeight)
|
||||
-> nsresult {
|
||||
nsCOMPtr<mozIDOMWindowProxy>& aWindow, nsIURI* aUrl,
|
||||
const nsACString& aTitle, const nsACString& aText, uint32_t aX, uint32_t aY,
|
||||
uint32_t aWidth, uint32_t aHeight) -> nsresult {
|
||||
nsAutoCString urlString;
|
||||
if (aUrl) {
|
||||
nsresult rv = aUrl->GetSpec(urlString);
|
||||
|
||||
4
src/zen/vendor/motion.min.mjs
vendored
4
src/zen/vendor/motion.min.mjs
vendored
File diff suppressed because one or more lines are too long
@@ -3,4 +3,4 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
content/browser/zen-components/ZenWelcome.mjs (../../zen/welcome/ZenWelcome.mjs)
|
||||
content/browser/zen-styles/zen-welcome.css (../../zen/welcome/zen-welcome.css)
|
||||
content/browser/zen-styles/zen-welcome.css (../../zen/welcome/zen-welcome.css)
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
display: none;
|
||||
background: var(--zen-branding-bg);
|
||||
border-radius: 1em;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 60%;
|
||||
height: 60%;
|
||||
@@ -83,7 +82,7 @@
|
||||
@media (max-width: 1000px) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 0px;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#zen-welcome-page-sidebar {
|
||||
|
||||
@@ -60,8 +60,8 @@ zen-workspace-creation {
|
||||
|
||||
& .zen-workspace-creation-icon-label {
|
||||
position: relative;
|
||||
width: 24px;
|
||||
height: 20px;
|
||||
width: var(--size-item-medium);
|
||||
height: var(--icon-size-medium);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
@@ -73,8 +73,8 @@ zen-workspace-creation {
|
||||
|
||||
& image {
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: var(--size-item-small);
|
||||
height: var(--size-item-small);
|
||||
-moz-context-properties: fill-opacity, fill;
|
||||
fill: currentColor;
|
||||
}
|
||||
@@ -132,7 +132,6 @@ zen-workspace-creation {
|
||||
& .zen-workspace-creation-profile {
|
||||
margin: 0;
|
||||
padding: 6px !important;
|
||||
border-radius: 99px;
|
||||
padding-inline-end: 0;
|
||||
appearance: none;
|
||||
background: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
content/browser/zen-components/ZenWorkspaceBookmarksStorage.js (../../zen/workspaces/ZenWorkspaceBookmarksStorage.js)
|
||||
content/browser/zen-components/ZenGradientGenerator.mjs (../../zen/workspaces/ZenGradientGenerator.mjs)
|
||||
* content/browser/zen-styles/zen-workspaces.css (../../zen/workspaces/zen-workspaces.css)
|
||||
content/browser/zen-styles/zen-gradient-generator.css (../../zen/workspaces/zen-gradient-generator.css)
|
||||
content/browser/zen-styles/zen-gradient-generator.css (../../zen/workspaces/zen-gradient-generator.css)
|
||||
|
||||
@@ -158,8 +158,8 @@
|
||||
background: var(--zen-theme-picker-dot-color);
|
||||
border: 1px solid var(--zen-colors-border);
|
||||
border-radius: 5px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: var(--icon-size-medium);
|
||||
height: var(--icon-size-medium);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: calc(100% - 8px);
|
||||
height: 16px;
|
||||
height: var(--size-item-small);
|
||||
background: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
|
||||
border-radius: 999px;
|
||||
pointer-events: none;
|
||||
@@ -257,8 +257,8 @@
|
||||
& .zen-theme-picker-dot {
|
||||
position: fixed;
|
||||
z-index: 2;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: var(--icon-size-medium);
|
||||
height: var(--icon-size-medium);
|
||||
border-radius: 50%;
|
||||
background: var(--zen-theme-picker-dot-color);
|
||||
@media (-prefers-color-scheme: dark) {
|
||||
@@ -275,7 +275,6 @@
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-width: 4px;
|
||||
z-index: 2;
|
||||
pointer-events: all;
|
||||
transition: transform 0.2s;
|
||||
z-index: 999;
|
||||
@@ -314,7 +313,7 @@
|
||||
#PanelUI-zen-gradient-generator-scheme {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
bottom: var(--size-item-xsmall);
|
||||
left: 50%;
|
||||
z-index: 1;
|
||||
transform: translateX(-50%);
|
||||
@@ -323,7 +322,6 @@
|
||||
& button {
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
min-width: fit-content !important;
|
||||
transition: background 0.2s;
|
||||
appearance: none;
|
||||
max-height: 30px;
|
||||
@@ -353,9 +351,10 @@
|
||||
|
||||
#PanelUI-zen-gradient-generator-scheme {
|
||||
top: 15px;
|
||||
max-height: 32px;
|
||||
max-height: var(--size-item-large);
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media not -moz-pref("zen.theme.gradient.show-custom-colors") {
|
||||
#PanelUI-zen-gradient-generator-custom-colors {
|
||||
display: none !important;
|
||||
@@ -420,7 +419,7 @@
|
||||
|
||||
& #PanelUI-zen-gradient-generator-texture-handler {
|
||||
width: 6px;
|
||||
height: 12px;
|
||||
height: var(--size-item-xsmall);
|
||||
background: light-dark(#757575, #d1d1d1);
|
||||
position: absolute;
|
||||
transition: height 0.1s;
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
&:is(img) {
|
||||
width: 14px;
|
||||
}
|
||||
|
||||
|
||||
&[no-icon='true'] {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
@@ -109,7 +109,7 @@
|
||||
scale: 1 !important;
|
||||
}
|
||||
|
||||
/* Inlcude separately since ther'es a bug in the
|
||||
/* Include separately since ther'es a bug in the
|
||||
* rendering of XUL in firefox */
|
||||
& toolbarbutton:not([active='true']) {
|
||||
%include overflow-icons.inc.css
|
||||
@@ -298,7 +298,7 @@
|
||||
}
|
||||
|
||||
:root[zen-unsynced-window='true']
|
||||
#navigator-toolbox[zen-has-implicit-hover='true']
|
||||
#navigator-toolbox[zen-has-implicit-hover='true']
|
||||
& .zen-workspaces-actions,
|
||||
:root:not([zen-unsynced-window]) &:hover .zen-workspaces-actions,
|
||||
& .zen-workspaces-actions[open='true'] {
|
||||
|
||||
Reference in New Issue
Block a user