-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Attempt to fix the issue #6039 Font size increase does not increase preferences font size #6429
Closed
Closed
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6e62a53
Merge pull request #1 from JabRef/master
LuckyOne09 7d0b7fd
Merge pull request #2 from JabRef/master
LuckyOne09 2a431e0
Merge pull request #3 from JabRef/master
LuckyOne09 3e449a6
Merge pull request #4 from JabRef/master
LuckyOne09 3c6bd01
Merge pull request #5 from JabRef/master
LuckyOne09 5e6093f
Merge pull request #6 from JabRef/master
LuckyOne09 9af83f4
attempt to fix the issue #6039: Font size increase does not increase …
Luckylys 75198fb
Pass the ThemeLoader object and JabRefPreferences object into ShowPre…
Luckylys dee3543
Create journalList.mv
4b33736
Revert "Pass the ThemeLoader object and JabRefPreferences object into…
1928a1b
remove unnecessary import
54a30f0
add record in CHANGELOG.md
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The action shouldn't really care about how the dialog is displayed, that's the job of the dialog itself. Thus, I would prefer if the fix can be moved to the
PreferencesDialogView
class. Maybe to https://github.com/JabRef/jabref/pull/6429/files#diff-39a71e5858d655cd93a5ca0a21ff300aL81 ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @tobiasdiez
Thanks for your suggestions. In fact, I tried to fix it in the PreferencesDialogView, but the PreferencesTab.getBuilder().getScene() is not null only when it is initialized after preferencesDialogView.show(). Therefore, this is the only way I found to fix it. Maybe I missed something important, but I really have no idea to handle that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you tried to add it exactly? The scene should be non-null as soon as the control has been added to the dialog. (But to be honest I don't understand why the preference tab doesn't inherit the css from the preference window).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I write some codes to make my point clear:
The part of result is:
You can see that the result of getScene() is not null only after preferencesDialogView.show().
By the way, I found that preference tab is not the only one having this problem.
Nearly every pop window suffer this problem like this screenshot:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
all those popup dialogs inherit from BaseDialog and there is this line for setting the css as well:
Globals.getThemeLoader().installCss(getDialogPane().getScene(), Globals.prefs);
This would explain why those dialogs still have the same size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thankyou for your guidance.
I tried to use
to replace
in constructor of
BaseDialog
.However, I found that this installCss() was still executed before DialogView.show() (this is pseudo code, if I am press "Customize key bindings", then it should be KeyBindingsDialogView().show())
I am confused now about how to solve this.
The only solution I can come up with is adding some codes after each DialogView.show().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, you could try to use the properties onShown or onShowing https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Dialog.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use
getScene
then you access the current value of the scene (which is null) and this is static, i.e. theReadOnlyObjectWrapper
will never update. To resolve this, you can use thesceneProperty
to get notified about the new value.Something like the following should work:
EasyBind.wrapNullable(getDialogPane().sceneProperty()).subscribeToValues(scene -> Globals.getThemeLoader().installCss(scene, Globals.prefs))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a interesting thing. That is I found that the KeyBindingsDialogView.getDialogPane().getScene() can be initiated properly before KeyBindingsDialogView.show()
To prove this, I add some codes in construtor of BaseDialog:
and see the behaviours in the debug mode.
following is results:
command line output is :
screenshot for debug mode (19 is the font size I set)
I think it means Themeloader.installCss() can apply to KeyBindingsDialogView properly but the font size does not change. I am comfused again about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it also the same scene that is used after the dialog is shown? Maybe it's registering to the old scene that gets replaced?