Merge pull request #13841 from Rob--W/crx-viewerCssTheme

Allow customization of theme in Chrome extension + set default theme
This commit is contained in:
Jonas Jenwald 2021-08-01 20:32:56 +02:00 committed by GitHub
commit bcdf006a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 10 deletions

View File

@ -43,6 +43,19 @@ body {
</div>
</template>
<template id="viewerCssTheme-template">
<div class="settings-row">
<label>
<span></span>
<select>
<option value="0">Use system theme</option>
<option value="1">Light theme</option>
<option value="2">Dark theme</option>
</select>
</label>
</div>
</template>
<template id="viewOnLoad-template">
<div class="settings-row">
<label>

View File

@ -1,6 +1,17 @@
{
"type": "object",
"properties": {
"viewerCssTheme": {
"title": "Theme",
"description": "The theme to use.\n0 = Use system theme.\n1 = Light theme.\n2 = Dark theme.",
"type": "integer",
"enum": [
0,
1,
2
],
"default": 2
},
"showPreviousViewOnLoad": {
"description": "DEPRECATED. Set viewOnLoad to 1 to disable showing the last page/position on load.",
"type": "boolean",
@ -188,15 +199,6 @@
2
],
"default": -1
},
"viewerCssTheme": {
"type": "integer",
"enum": [
0,
1,
2
],
"default": 0
}
}
}

View File

@ -177,7 +177,7 @@ const defaultOptions = {
},
viewerCssTheme: {
/** @type {number} */
value: 0,
value: typeof PDFJSDev !== "undefined" && PDFJSDev.test("CHROME") ? 2 : 0,
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
},
viewOnLoad: {