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

Co-authored-by: Jonas <jonas@freesources.org>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux and mejo- committed Sep 17, 2024
1 parent dd69611 commit f6e89de
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
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 @@ -51,6 +51,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 @@ -286,6 +287,7 @@ export default {
canSwipe: true,
isStandalone: false,
theme: null,
lightBackdrop: null,
root: davRemoteURL,
handlerId: '',
Expand Down Expand Up @@ -687,6 +689,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' || (handler.theme === 'default' && defaultThemeIsLight)
this.handlerId = handler.id
// check if part of a group, if so retrieve full files list
Expand Down

0 comments on commit f6e89de

Please sign in to comment.