Skip to content

Commit

Permalink
Apply css files correctly to dialogs (#6828)
Browse files Browse the repository at this point in the history
* Apply css files correctly to dialogs

Fixes #6039.

* Update CHANGELOG.md
  • Loading branch information
tobiasdiez authored Sep 1, 2020
1 parent bf60475 commit 26870b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Fixed

- We fixed the wrong behavior that font size changes are not reflected in dialogs. [#6039](https://github.com/JabRef/jabref/issues/6039)

### Removed


Expand Down
8 changes: 7 additions & 1 deletion src/main/java/org/jabref/gui/util/BaseDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Optional;

import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog;
Expand All @@ -14,6 +15,8 @@
import org.jabref.gui.keyboard.KeyBinding;
import org.jabref.gui.keyboard.KeyBindingRepository;

import com.tobiasdiez.easybind.EasyBind;

public class BaseDialog<T> extends Dialog<T> implements org.jabref.gui.Dialog<T> {

protected BaseDialog() {
Expand All @@ -36,7 +39,10 @@ protected BaseDialog() {

setDialogIcon(IconTheme.getJabRefImageFX());
setResizable(true);
Globals.prefs.getTheme().installCss(getDialogPane().getScene());

EasyBind.wrapNullable(dialogPaneProperty())
.mapObservable(Node::sceneProperty)
.subscribeToValues(scene -> Globals.prefs.getTheme().installCss(scene));
}

private Optional<Button> getDefaultButton() {
Expand Down

0 comments on commit 26870b7

Please sign in to comment.