Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Fixed

- We fixed an issue where the Web search table had extra space, to improve the layout. [#14556](https://github.com/JabRef/jabref/issues/14556)
- We fixed text cursor movement shortcuts (Command+Left/Right for line start/end, Option+Left/Right for word navigation) not working correctly in the BibTeX source editor on macOS. [#5937](https://github.com/JabRef/jabref/issues/5937)
- We fixed PDF import to prefer the content extracted title over filename like XMP metadata titles. [#11999](https://github.com/JabRef/jabref/issues/11999)
- We fixed RIS export writing the full page range into both start page and end page fields instead of splitting them correctly. [#15106](https://github.com/JabRef/jabref/issues/15106)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.util.Optional;

import javafx.beans.InvalidationListener;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.DoubleBinding;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.fxml.FXML;
import javafx.geometry.Pos;
Expand Down Expand Up @@ -94,6 +96,16 @@ public void initialize() {

searchEngineTable.setItems(viewModel.getSearchEngines());

// Dynamic height based on font size and number of items
DoubleBinding rowHeight = Bindings.createDoubleBinding(
() -> enableWebSearch.getFont() != null ? enableWebSearch.getFont().getSize() * 2.5 : 30.0,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use constants instead of magic numbers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! I’ve replaced the magic numbers with named constants (FONT_HEIGHT_MULTIPLIER, DEFAULT_ROW_HEIGHT, HEADER_HEIGHT_ESTIMATE) and added brief comments to clarify their purpose. The table layout still adapts dynamically to the font size.

enableWebSearch.fontProperty());
searchEngineTable.fixedCellSizeProperty().bind(rowHeight);
searchEngineTable.prefHeightProperty().bind(
Bindings.size(searchEngineTable.getItems())
.add(1.1) // Estimate for header height
.multiply(rowHeight));

enableWebSearch.selectedProperty().bindBidirectional(viewModel.enableWebSearchProperty());
warnAboutDuplicatesOnImport.selectedProperty().bindBidirectional(viewModel.warnAboutDuplicatesOnImportProperty());
downloadLinkedOnlineFiles.selectedProperty().bindBidirectional(viewModel.shouldDownloadLinkedOnlineFiles());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<Label text="%( Note: Press return to commit changes in the table! )"/>
<TableView
fx:id="searchEngineTable"
VBox.vgrow="ALWAYS"
editable="true">
<columns>
<TableColumn minWidth="120"
Expand Down
Loading