Skip to content

Commit

Permalink
fix: set light backdrop according to theme
Browse files Browse the repository at this point in the history
Required to fix regression with Text in Viewer in Nextcloud 30, where we
still want a white viewer header.

Also fixes the header color for PDFs with light theme.

Fixes: nextcloud/text#6386

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Sep 17, 2024
1 parent 7eb5603 commit 57be472
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 14 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@nextcloud/paths": "^2.2.1",
"@nextcloud/router": "^3.0.1",
"@nextcloud/typings": "^1.9.1",
"@nextcloud/vue": "^8.18.0",
"@nextcloud/vue": "^8.19.0",
"@skjnldsv/vue-plyr": "^7.5.0",
"camelcase": "^8.0.0",
"debounce": "^2.1.1",
Expand Down
4 changes: 4 additions & 0 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
:clear-view-delay="-1 /* disable fade-out because of accessibility reasons */"
:close-button-contained="false"
:dark="true"
:light-backdrop="lightBackdrop"
:data-handler="handlerId"
:enable-slideshow="hasPrevious || hasNext"
:slideshow-paused="editing"
Expand Down Expand Up @@ -285,6 +286,7 @@ export default {
canSwipe: true,
isStandalone: false,
theme: null,
lightBackdrop: null,
root: davRemoteURL,
handlerId: '',
Expand Down Expand Up @@ -698,6 +700,8 @@ export default {
}
this.theme = handler.theme ?? 'dark'
const defaultThemeIsLight = window.getComputedStyle(document.body).getPropertyValue('--background-invert-if-dark') !== 'invert(100%)'
this.lightBackdrop = handler.theme === 'light' || defaultThemeIsLight
this.handlerId = handler.id
// check if part of a group, if so retrieve full files list
Expand Down

0 comments on commit 57be472

Please sign in to comment.