Skip to content

Commit 8335db0

Browse files
authored
Jabref dialog doesnt respect font size 13558 (#13667)
* Made the AboutDialog's View's Fonts Size's Relative - note 18 :: 30 == 1.44 :: 2.4 == 0.6 - manually verified original and modified pixel heights * AboutDialogView responds to preference's font size changes * Renamed some unused vars to remove IDEA warnings. * Added information about our fix. * Removed offending trailing space. See https://github.com/JabRef/jabref/actions/runs/16790829755/job/47551968304 * AboutAction does not do its own injection now. See #13667 (comment)
1 parent 6b33e88 commit 8335db0

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
6969
- We introduced walkthrough functionality [#12664](https://github.com/JabRef/jabref/issues/12664)
7070

7171
### Fixed
72-
72+
73+
- We fixed an issue whereby the 'About' dialog was not honouring the user's configured font preferences. [#13558](https://github.com/JabRef/jabref/issues/13558)
7374
- We fixed an issue where the Pagetotal column was sorting the values alphabetically instead of numerically. [#12533](https://github.com/JabRef/jabref/issues/12533)
7475
- We fixed dark mode of BibTeX Source dialog in Citation Relations tab. [#13599](https://github.com/JabRef/jabref/issues/13599)
7576
- We fixed an issue where the LibreOffice integration did not support citation keys containing Unicode characters. [#13301](https://github.com/JabRef/jabref/issues/13301)

jabgui/src/main/java/org/jabref/gui/frame/MainMenu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public void execute() {
406406

407407
new SeparatorMenuItem(),
408408

409-
factory.createMenuItem(StandardActions.ABOUT, new AboutAction())
409+
factory.createMenuItem(StandardActions.ABOUT, new AboutAction(dialogService))
410410
);
411411

412412
// @formatter:on

jabgui/src/main/java/org/jabref/gui/help/AboutAction.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,18 @@
33
import org.jabref.gui.DialogService;
44
import org.jabref.gui.actions.SimpleCommand;
55

6-
import com.airhacks.afterburner.injection.Injector;
7-
86
public class AboutAction extends SimpleCommand {
97

108
private final AboutDialogView aboutDialogView;
9+
private final DialogService dialogService;
1110

12-
public AboutAction() {
11+
public AboutAction(final DialogService dialogService) {
1312
this.aboutDialogView = new AboutDialogView();
13+
this.dialogService = dialogService;
1414
}
1515

1616
@Override
1717
public void execute() {
18-
DialogService dialogService = Injector.instantiateModelOrService(DialogService.class);
1918
dialogService.showCustomDialog(aboutDialogView);
2019
}
21-
22-
public AboutDialogView getAboutDialogView() {
23-
return aboutDialogView;
24-
}
2520
}

jabgui/src/main/java/org/jabref/gui/help/AboutDialogView.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.jabref.gui.ClipBoardManager;
88
import org.jabref.gui.DialogService;
99
import org.jabref.gui.preferences.GuiPreferences;
10+
import org.jabref.gui.theme.ThemeManager;
1011
import org.jabref.gui.util.BaseDialog;
1112
import org.jabref.gui.util.ControlHelper;
1213
import org.jabref.logic.l10n.Localization;
@@ -24,6 +25,7 @@ public class AboutDialogView extends BaseDialog<Void> {
2425
@Inject private GuiPreferences preferences;
2526
@Inject private ClipBoardManager clipBoardManager;
2627
@Inject private BuildInfo buildInfo;
28+
@Inject private ThemeManager themeManager;
2729

2830
private AboutDialogViewModel viewModel;
2931

@@ -34,7 +36,15 @@ public AboutDialogView() {
3436
.load()
3537
.setAsDialogPane(this);
3638

37-
ControlHelper.setAction(copyVersionButton, getDialogPane(), event -> copyVersionToClipboard());
39+
ControlHelper.setAction(copyVersionButton, getDialogPane(), ignored -> copyVersionToClipboard());
40+
41+
getDialogPane()
42+
.sceneProperty()
43+
.addListener((_, ignored, newScene) -> {
44+
if (newScene != null) {
45+
themeManager.updateFontStyle(newScene);
46+
}
47+
});
3848
}
3949

4050
public AboutDialogViewModel getViewModel() {

jabgui/src/main/resources/org/jabref/gui/Base.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ We want to have a look that matches our icons in the tool-bar */
18531853

18541854
/* AboutDialog */
18551855
#aboutDialog .about-heading {
1856-
-fx-font-size: 30;
1856+
-fx-font-size: 2.40em;
18571857
-fx-text-fill: -jr-theme;
18581858
}
18591859

@@ -1866,12 +1866,12 @@ We want to have a look that matches our icons in the tool-bar */
18661866
}
18671867

18681868
#aboutDialog .dev-heading {
1869-
-fx-font-size: 18;
1869+
-fx-font-size: 1.44em;
18701870
-fx-padding: -10 0 0 0;
18711871
}
18721872

18731873
#aboutDialog .sub-heading {
1874-
-fx-font-size: 18;
1874+
-fx-font-size: 1.44em;
18751875
-fx-padding: 0.312em;
18761876
}
18771877

0 commit comments

Comments
 (0)