-
-
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
Added minimum window sizing for creating new entries #12033
base: main
Are you sure you want to change the base?
Conversation
…m/jabref into fixing-minimum-window-sizing-11944
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.
Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.
You can check review dog's comments at the tab "Files changed" of your pull request.
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.
use the fxml for this
@@ -87,6 +88,10 @@ public EntryTypeView(LibraryTab libraryTab, DialogService dialogService, GuiPref | |||
.load() | |||
.setAsDialogPane(this); | |||
|
|||
Stage stage = (Stage) getDialogPane().getScene().getWindow(); |
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.
Why don't you simply adjust this in the fxml?
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 have attempted a simple adjustment to the FXML (specifically setting the minWidth and minHeight properties in the root DialogPane), but it doesn't seem to affect the minimum window size, as the window itself can be resized to smaller than the set values. I believe this is because the FXML is encoding the internals and minimum size of those, while we need to set the minimum size for the stage as a whole. I have looked at incorporating the stage into the FXML, however, even if this path can work it seems to lead to a significantly more convoluted change to achieve the same effect. This also reflects the way it was done for the main stage in JabRefGUI:
jabref/src/main/java/org/jabref/gui/JabRefGUI.java
Lines 209 to 210 in a06804e
mainStage.setMinWidth(580); | |
mainStage.setMinHeight(330); |
Please tell me if I have missed something, I am new to FXML and may just be missing something quite obvious.
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.
Since EntryTypeView extends BaseDialog<EntryType>
, shouldn't that go into org.jabref.gui.util.BaseDialog#BaseDialog
?
@Siedlerchr I see a big unclearness: Why don't the children of BaseDialog
call the constructor? Or do I miss some JavaMagic (I would search for super()
in the constructors).
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 a constructor body does not begin with an explicit constructor invocation and the constructor being declared is not part of the primordial class Object, then the constructor body implicitly begins with a superclass constructor invocation "super();", an invocation of the constructor of its direct superclass that takes no arguments.
https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.8.7
Okay, fine, please fix the checkstyle issue and it's okay from my side |
Closes #11944
Added minimum sizing for windows to create new entries.
Minimum window size for creating a new entry:
It was also observed that the same issue is present for creating a new entry from plain text, so minimal window sizing was also included for this.:
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)