JabRef 5.0.0-dev--2019-10-17----e81d58c51
Windows 10 10.0 amd64
Java 12.0.2
The entry preview does not adapt to dark mode. This issue has already been reported by @Siedlerchr here (including an image):
https://github.com/JabRef/jabref/issues/5244#issuecomment-528028140
Hello, I'm pretty new to github but would like to work on this issue. Is it okay?
@taerim25 Sure, go ahead ! I think it should work if you adapt the background color of the entry preview control in the dark theme css file
Please have a look at our contributing guide for gettings things done.
https://github.com/JabRef/jabref/blob/master/CONTRIBUTING.md
UPDATE: Preview content itself was updated in form of HTML injected in previewView = new WebView() (located in PreviewViewer.java). I was able to change the color of WebView object itself, but it wouldn't show on the app as the injected HTML is placed on top of it. I can modify the css of the injected HTML by manually making a new css file and embedding it on to the HTML, but that wouldn't make it compatible with existing css files (Dark.css and Base.css).
Anybody has any idea on how to approach this?
@tobiasdiez do we have a variable for checking if Dark Mode is enabled?
Yes, sadly it is not possible to style the content of the webview using the central javafx css. The easiest solution is probably to embed the correct style directly as done here:
https://github.com/JabRef/jabref/blob/bc26c3ac5a3f3e0e7d806ac3639bf079c98441e0/src/main/java/org/jabref/gui/preview/PreviewViewer.java#L43-L48
@taerim25 Actually there is a preferences key which stores which theme the user has selected. So you could use this for checking and adapting the css,
Thanks to the good work of @taerim25 this should be fixed in the latest development version. Could you please check the build from http://builds.jabref.org/master/. Thanks! Please remember to make a backup of your library before trying-out this version.
JabRef 5.0.0-dev--2019-10-20----dfad2fdea
Windows 10 10.0 amd64
Java 12.0.2
Cannot confirm. The entry preview is not visible at all. And sometimes the exception reported below occurs, when trying to open the entry preview/entry editor. Note, that the issue does not appear, if the dark mode is not activated, so it is very likely that these issues are related to the attempted fix herein:
Uncaught exception in Thread[JavaFX Application Thread,5,main]
Invalid stylesheet URL
java.lang.IllegalArgumentException: Invalid stylesheet URL
at org.jabref.merged.module/javafx.scene.web.WebEngine$2.invalidated(Unknown Source)
at org.jabref.merged.module/javafx.beans.property.StringPropertyBase.markInvalid(Unknown Source)
at org.jabref.merged.module/javafx.beans.property.StringPropertyBase.set(Unknown Source)
at org.jabref.merged.module/javafx.beans.property.StringPropertyBase.set(Unknown Source)
at org.jabref.merged.module/javafx.scene.web.WebEngine.setUserStyleSheetLocation(Unknown Source)
at org.jabref/org.jabref.gui.preview.PreviewViewer.setTheme(Unknown Source)
at org.jabref/org.jabref.gui.preview.PreviewPanel.<init>(Unknown Source)
at org.jabref/org.jabref.gui.entryeditor.PreviewTab.bindToEntry(Unknown Source)
at org.jabref/org.jabref.gui.entryeditor.EntryEditorTab.notifyAboutFocus(Unknown Source)
at org.jabref/org.jabref.gui.entryeditor.EntryEditor.setEntry(Unknown Source)
at org.jabref/org.jabref.gui.BasePanel.lambda$createMainTable$21(Unknown Source)
at java.base/java.util.Optional.ifPresent(Unknown Source)
at org.jabref/org.jabref.gui.BasePanel.lambda$createMainTable$22(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
at org.jabref.merged.module/javafx.collections.ObservableListBase.fireChange(Unknown Source)
at org.jabref.merged.module/javafx.collections.ListChangeBuilder.commit(Unknown Source)
at org.jabref.merged.module/javafx.collections.ListChangeBuilder.endChange(Unknown Source)
at org.jabref.merged.module/javafx.collections.ObservableListBase.endChange(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.scene.control.SelectedItemsReadOnlyObservableList.lambda$new$1(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
at org.jabref.merged.module/javafx.collections.ObservableListBase.fireChange(Unknown Source)
at org.jabref.merged.module/javafx.collections.ListChangeBuilder.commit(Unknown Source)
at org.jabref.merged.module/javafx.collections.ListChangeBuilder.endChange(Unknown Source)
at org.jabref.merged.module/javafx.collections.ObservableListBase.endChange(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList._endChange(Unknown Source)
at org.jabref.merged.module/javafx.scene.control.MultipleSelectionModelBase$SelectedIndicesList._endChange(Unknown Source)
at org.jabref.merged.module/javafx.scene.control.ControlUtils.updateSelectedIndices(Unknown Source)
at org.jabref.merged.module/javafx.scene.control.TableView$TableViewArrayListSelectionModel.fireCustomSelectedCellsListChangeEvent(Unknown Source)
at org.jabref.merged.module/javafx.scene.control.TableView$TableViewArrayListSelectionModel.clearAndSelect(Unknown Source)
at org.jabref.merged.module/javafx.scene.control.TableView$TableViewSelectionModel.clearAndSelect(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.scene.control.behavior.TableCellBehaviorBase.simpleSelect(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.scene.control.behavior.TableCellBehaviorBase.doSelect(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.scene.control.behavior.CellBehaviorBase.mousePressed(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.scene.control.inputmap.InputMap.handle(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source)
at org.jabref.merged.module/javafx.scene.Scene$MouseHandler.process(Unknown Source)
at org.jabref.merged.module/javafx.scene.Scene.processMouseEvent(Unknown Source)
at org.jabref.merged.module/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
at org.jabref.merged.module/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
at org.jabref.merged.module/com.sun.glass.ui.View.notifyMouse(Unknown Source)
at org.jabref.merged.module/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at org.jabref.merged.module/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
@tobiasdiez I guess it's due to the variable you replaced with the constant
This should be fixed now in the latest master.
JabRef 5.0.0-dev--2019-10-25----681d6aa6f
Windows 10 10.0 amd64
Java 12.0.2
I can confirm that this has been fixed in the current dev version. Nice work!