Skip to content

Commit

Permalink
Apply css files correctly to dialogs
Browse files Browse the repository at this point in the history
Fixes #6039.
  • Loading branch information
tobiasdiez committed Aug 31, 2020
1 parent dfefd4d commit 5bc1792
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
### Changed

### 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
7 changes: 6 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,9 @@ protected BaseDialog() {

setDialogIcon(IconTheme.getJabRefImageFX());
setResizable(true);
Globals.getThemeLoader().installCss(getDialogPane().getScene(), Globals.prefs);
EasyBind.wrapNullable(dialogPaneProperty())
.mapObservable(Node::sceneProperty)
.subscribeToValues(scene -> Globals.getThemeLoader().installCss(scene, Globals.prefs));
}

private Optional<Button> getDefaultButton() {
Expand Down

0 comments on commit 5bc1792

Please sign in to comment.