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

Added minimum window sizing for creating new entries #12033

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ityyrm
Copy link

@ityyrm ityyrm commented Oct 19, 2024

Closes #11944

Added minimum sizing for windows to create new entries.

Minimum window size for creating a new entry:
image

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.:
image

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@ityyrm ityyrm changed the title Added minimum window sizing for creating new entries #11944 Added minimum window sizing for creating new entries Oct 19, 2024
Copy link
Contributor

@github-actions github-actions bot left a 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.

Copy link
Member

@Siedlerchr Siedlerchr left a 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();
Copy link
Member

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?

Copy link
Author

@ityyrm ityyrm Oct 20, 2024

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:

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.

Copy link
Member

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).

Copy link
Member

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

@Siedlerchr Siedlerchr added the status: changes required Pull requests that are not yet complete label Oct 19, 2024
@Siedlerchr
Copy link
Member

Siedlerchr commented Oct 20, 2024

Okay, fine, please fix the checkstyle issue and it's okay from my side
Import jabrefs's code style and select organize imports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: changes required Pull requests that are not yet complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minimum Window Sizing when Adding a New Entry
3 participants