Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font size increase does not increase preferences font size #6039

Closed
koppor opened this issue Feb 27, 2020 · 5 comments · Fixed by #6828
Closed

Font size increase does not increase preferences font size #6039

koppor opened this issue Feb 27, 2020 · 5 comments · Fixed by #6828
Labels
bug Confirmed bugs or reports that are very likely to be bugs ui

Comments

@koppor
Copy link
Member

koppor commented Feb 27, 2020

grafik

@tobiasdiez tobiasdiez added bug Confirmed bugs or reports that are very likely to be bugs ui labels Mar 5, 2020
@LuckyOne09
Copy link
Contributor

Hi, I found something strange when I try to reproduce this bug. If I increase the font size too large, then the UI will be like this:
bug_related_font_size
You can see when font size is too large, there is no menu displaying above. Hence, it will be very difficult to find what I want(In fact, I spent long time to try to find preference tab again.). So I guess that it may be another bug?

@LuckyOne09
Copy link
Contributor

Hi,@koppor

I have been working on this for a long time. I feel that I have found some useful things. But I am still confused about some implementations of JabRef.
I found that in the ThemeLoader.java, there are codes that are responsible for changing the font-size according to JabRefPreferences.

/**
* Installs the base css file as a stylesheet in the given scene. Changes in the css file lead to a redraw of the
* scene using the new css file.
*/
public void installCss(Scene scene, JabRefPreferences preferences) {
addAndWatchForChanges(scene, JabRefFrame.class.getResource(MAIN_CSS), 0);
additionalCssToLoad.ifPresent(file -> addAndWatchForChanges(scene, file, 1));
preferences.getFontSize().ifPresent(size -> scene.getRoot().setStyle("-fx-font-size: " + size + "pt;"));
}

I guess that the cause of this bug is that these codes only change the font size of elements in root. But like elements in Apperance tab, they are in other more specific style class.

<Label styleClass="titleHeader" text="%Appearance"/>
<Label styleClass="sectionHeader" text="%Font"/>

Therefore, I think that is why the font size change in root can't affect the preferences font size. (By the way, except preferences dialog, nearly every dialog suffer this bug.)
bug1

I tried to get the specific style class of preferences dialog,so I added codes in Themeloader.java to solve this problem like that:

solution

Unluckily, it didn't work.

I am wandering now...... So I will appreciate you very much if you could give me some hints or suggestions.

@Siedlerchr
Copy link
Member

Hi, maybe that helps: The PreferencesDialog has it's own CSS file, I am not sure how it's overriden or related to the main file
https://github.com/JabRef/jabref/blob/master/src/main/java/org/jabref/gui/preferences/PreferencesDialog.css

@LuckyOne09
Copy link
Contributor

Hi,@Siedlerchr
Thanks for your help.
But I found that there are no invocation to add PreferencesDialog.css to any scene.

screenShot

And in the PreferencesDialog, there are no settings about font size. Therefore, it seems that it is not useful for fixing this bug?

@LuckyOne09
Copy link
Contributor

LuckyOne09 commented May 5, 2020

Now, we guess that maybe the cause is that when click Preferences.
many scenes will be created according to the codes:

public PreferencesDialogViewModel(DialogService dialogService, JabRefFrame frame) {
this.dialogService = dialogService;
this.preferences = Globals.prefs;
this.frame = frame;
preferenceTabs = FXCollections.observableArrayList(
new GeneralTabView(preferences),
new FileTabView(preferences),
new TableTabView(preferences),
new TableColumnsTabView(preferences),
new PreviewTabView(preferences),
new ExternalTabView(preferences, frame),
new GroupsTabView(preferences),
new EntryEditorTabView(preferences),
new BibtexKeyPatternTabView(preferences),
new ImportTabView(preferences),
new ExportSortingTabView(preferences),
new NameFormatterTabView(preferences),
new XmpPrivacyTabView(preferences),
new AdvancedTabView(preferences),
new AppearanceTabView(preferences)
);
}

And we guess that these new scenes don't install css. Therefore we add some codes in

void showAllPreferences() { viewModel.showPreferences(); }

we change it to this:

    @FXML
    void showAllPreferences() {
        preferenceTabList.getItems().forEach(tab -> Globals.getThemeLoader().installCss(tab.getBuilder().getScene(), Globals.prefs));
        viewModel.showPreferences();
    }

But it does not work again. So, I want to ask if there are some misunderstanding I have here?

Thanks very much for your patience and kindness

tobiasdiez added a commit that referenced this issue Aug 31, 2020
tobiasdiez added a commit that referenced this issue Sep 1, 2020
* Apply css files correctly to dialogs

Fixes #6039.

* Update CHANGELOG.md
koppor pushed a commit that referenced this issue Jul 15, 2022
39fede5 Update associacao-brasileira-de-normas-tecnicas.csl (#6138)
fde7695 Include chapter title (#6140)
1e3d8b4 Update n.d. abbreivation for DGP style (#6136)
ebb728b suffix '.' after first group; changed e-mail (#6135)
eed4f07 Update and rename sciences-po-ecole-doctorale-note-french.csl to scie… (#6127)
f194647 Delete TU Dresden Medizin as requested by library (#6131)
d8423d8 Create entomological-review.csl (#6120)
064a394 Create australasian-journal-of-philosophy.csl (#6063)
a998ded Add composer.json (#5668)
37083c9 Update copernicus-publications.csl (#6062)
694c97b Create chaucer review (#6061)
625a424 Create haffner-style-manual.csl (#6054)
8b7224b make annals-of-allergy-asthma-and-immunology independent (#6041)
710748c Create university-of-pretoria-harvard-theology-religion.csl (#6106)
d16dffd Create health-physics.csl (#6040)
ca9e184 Update style-manual-australian-government.csl (#6119)
e412277 Create chemical-engineering-technology.csl (#6039)
bebdb48 Create bibliothek-forschung-und-praxis.csl (#6038)
29e49cd Update nature.csl (#6117)
891897d fix short title for SBL (#6118)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 39fede5
koppor pushed a commit that referenced this issue Aug 1, 2022
c750b6e APA: Put conditional event-title logic in a macro (#6161)
a87414f Remove month from association-for-compuational-linguistics.csl (#6158)
6153db0 Remove issue numbers from BJOC style (#6155)
e231ea3 Bug fix for `event` regression (#6154)
0dab651 Add event-title to other APA styles (#6153)
698cf1c APA: `event-title` and conditional `event` (#6152)
58d3f8f Update vancouver-author-date.csl (#6148)
f1638a9 add substitute to Vancouver author date (#6147)
39fede5 Update associacao-brasileira-de-normas-tecnicas.csl (#6138)
fde7695 Include chapter title (#6140)
1e3d8b4 Update n.d. abbreivation for DGP style (#6136)
ebb728b suffix '.' after first group; changed e-mail (#6135)
eed4f07 Update and rename sciences-po-ecole-doctorale-note-french.csl to scie… (#6127)
f194647 Delete TU Dresden Medizin as requested by library (#6131)
d8423d8 Create entomological-review.csl (#6120)
064a394 Create australasian-journal-of-philosophy.csl (#6063)
a998ded Add composer.json (#5668)
37083c9 Update copernicus-publications.csl (#6062)
694c97b Create chaucer review (#6061)
625a424 Create haffner-style-manual.csl (#6054)
8b7224b make annals-of-allergy-asthma-and-immunology independent (#6041)
710748c Create university-of-pretoria-harvard-theology-religion.csl (#6106)
d16dffd Create health-physics.csl (#6040)
ca9e184 Update style-manual-australian-government.csl (#6119)
e412277 Create chemical-engineering-technology.csl (#6039)
bebdb48 Create bibliothek-forschung-und-praxis.csl (#6038)
29e49cd Update nature.csl (#6117)
891897d fix short title for SBL (#6118)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: c750b6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs ui
Projects
Archived in project
4 participants