Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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 @@ -40,6 +40,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 an issue where the side pane (Groups/Web search) width was not remembered after restarting JabRef. [#8907](https://github.com/JabRef/jabref/issues/8907)
- We fixed the ScienceDirect fulltext fetcher not returning a PDF when the Elsevier API response includes a direct PDF link. [#12161](https://github.com/JabRef/jabref/issues/12161)
- We fixed vertical cursor movement shortcuts (Command+Up/Down for document start/end, Option+Up/Down for paragraph start/end) not working correctly in the BibTeX source editor on macOS. [#5937](https://github.com/JabRef/jabref/issues/5937)
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 @@ -33,6 +35,15 @@
import com.airhacks.afterburner.views.ViewLoader;

public class WebSearchTab extends AbstractPreferenceTabView<WebSearchTabViewModel> implements PreferencesTab {
// Multiplier for row height based on font size
private static final double FONT_HEIGHT_MULTIPLIER = 2.5;

// Default row height if font is not available
private static final double DEFAULT_ROW_HEIGHT = 30.0;

// Estimate for header height (used in table prefHeight calculation)
private static final double HEADER_HEIGHT_ESTIMATE = 1.1;

@FXML private CheckBox enableWebSearch;
@FXML private CheckBox warnAboutDuplicatesOnImport;
@FXML private CheckBox downloadLinkedOnlineFiles;
Expand Down Expand Up @@ -94,6 +105,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() * FONT_HEIGHT_MULTIPLIER : DEFAULT_ROW_HEIGHT,
enableWebSearch.fontProperty());
searchEngineTable.fixedCellSizeProperty().bind(rowHeight);
searchEngineTable.prefHeightProperty().bind(
Bindings.size(searchEngineTable.getItems())
.add(HEADER_HEIGHT_ESTIMATE) // Estimate for header height
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.

redundant comment

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.

I have removed the redundant comment and commited the change ! Thanks for the review .

.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