-
-
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
Truncates the link and/or the link description in the column "linked files" in main table, if too long #6179
Truncates the link and/or the link description in the column "linked files" in main table, if too long #6179
Conversation
…files" in main table, if too long
Thanks for your PR. As this is a display issue, I would prefer if this could be fixed on the GUI side (i.e. no changes in the One option would be to use the built-in javafx facilities and put the text in a |
The first argument in the constructor of the java-fx
So unfortunately my hands are tied here. |
You can set the text overrun property also on the Menu item: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Labeled.html#textOverrunProperty |
I could not find out a way how to adapt it using the |
The |
Not all works as preferred, but at least it is better than without it. |
|
I agree, Truncating the link and the description separately is indeed a good suggestion. Should be able by putting them in separate labels (with pref width + elipse overflow). |
@systemoperator ping 😇 |
The current implementation has the following flaws:
My initial commit truncated the text itself and added centered ellipses, which would eliminate the aforementioned second flaw. Furthermore, there was no need to define a max width, since the text was truncated and thus also the context menu itself did not exceed a specific width and was only as wide as required by the text. As a result it would have eliminated all flaws mentioned above. Considering all the issues concerning the java-fx components, I would tend to a solution which simply truncates the texts itself (as already suggested in earlier comments above). This is, what I currently use for my local JabRef instance. |
Okay, you've convinced me. It's a bit unfortunate that there is no css-based fix, because I really think that truncating should be handled by the JavaFX controls. But well, if it's not possible then yeah... So I'm fine with changing the display text itself as it was done in one of your earliest commits. Please add a helper method to |
@tobiasdiez What do you think about it? |
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.
Thanks! Looks good to me.
Edit: the checkstyle currently fails, that needs to be fixed before merge.
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.
Got a comment about a comment. 😁
Everything else looks very good. Thank you very much.
6ebcb3c
to
92e241f
Compare
Merging now. Thank you very much. |
# By dependabot-preview[bot] (18) and others # Via GitHub (17) and others * upstream/master: (77 commits) Reenable caching of gradle Refactor BibtexKeyPatternPreferences (#6489) Update CHANGELOG.md Add changelog entry and remove unnecessary code EasyBind revision part two Fix Drag and Drop on empty database Truncates DOIs and URLs in the column "Linked identifiers" in main table, if too long (#6498) Bump flexmark-ext-gfm-tasklist from 0.61.26 to 0.61.30 Bump flexmark from 0.61.26 to 0.61.30 Bump xmlunit-matchers from 2.6.4 to 2.7.0 Bump java-string-similarity from 1.2.1 to 2.0.0 Bump flexmark-ext-gfm-strikethrough from 0.61.26 to 0.61.30 Bump xmlunit-core from 2.6.4 to 2.7.0 Truncates the link and/or the link description in the column "linked files" in main table, if too long (#6179) Keep group pane size when resizing window (#6180) (#6423) Changelog: Fix missing citation for biblatex-mla Update AUTHORS Check duplicate DOI (#6333) Fix missing citation for biblatex-mla Change EasyBind dependency (#6480) ... # Conflicts: # src/main/java/org/jabref/gui/actions/ActionHelper.java # src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java # src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java # src/main/java/org/jabref/model/entry/field/FieldFactory.java
references: #6178