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

Bring back the scrollbars #5515

Merged
merged 2 commits into from
Oct 26, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -28,6 +28,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an exception which occurred when closing JabRef. [#5348](https://github.com/JabRef/jabref/issues/5348)
- We fixed a few problems that prevented JabFox to communicate with JabRef. [#4737](https://github.com/JabRef/jabref/issues/4737) [#4303](https://github.com/JabRef/jabref/issues/4303)
- We fixed an error where the groups containing an entry loose their highlight color when scrolling. [#5022](https://github.com/JabRef/jabref/issues/5022)
- We fixed an error where scrollbar were not shown. [#5374](https://github.com/JabRef/jabref/issues/5374)
tobiasdiez marked this conversation as resolved.
Show resolved Hide resolved
- We fixed an error where an exception was thrown when merging entries. [#5169](https://github.com/JabRef/jabref/issues/5169)
- After assigning an entry to a group, the item count is now properly colored to reflect the new membership of the entry. [#3112](https://github.com/JabRef/jabref/issues/3112)
- The group panel is now properly updated when switching between libraries (or when closing/opening one). [#3142](https://github.com/JabRef/jabref/issues/3142)
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
-jr-sidepane-header-color: -jr-theme-text;

/* Specs for the scrollbars */
-jr-scrollbar-thumb: -fx-outer-border;
-jr-scrollbar-track: -fx-control-inner-background;
-jr-scrollbar-thumb: derive(-fx-outer-border, -30%);
-jr-scrollbar-track: derive(-fx-control-inner-background, -10%);

-jr-separator: derive(-fx-color, -5%);

Expand Down Expand Up @@ -698,13 +698,13 @@

.scroll-bar {
-fx-background-color: transparent;
-fx-opacity: 0;
-fx-opacity: 0.3;
}

.scroll-bar:horizontal .track,
.scroll-bar:vertical .track {
-fx-background-color: -jr-scrollbar-track;
-fx-opacity: 0.2;
-fx-opacity: 0.6;
-fx-background-radius: 0em;
}

Expand All @@ -718,7 +718,7 @@

.scroll-bar .thumb:hover,
.scroll-bar .thumb:pressed {
-fx-background-color: derive(-jr-scrollbar-thumb, -20%);
-fx-background-color: derive(-jr-scrollbar-thumb, -30%);
}

/* Hide increment and decrement buttons */
Expand Down Expand Up @@ -751,7 +751,7 @@
-fx-padding: 0em 0.333em 0em 0.333em; /* 2 4 2 4 */
}

/* Only show scrollbars for hovered elements */
/* Restore full visibility of scrollbars for active elements */
.list-view:hover .scroll-bar,
.tree-view:hover .scroll-bar,
.table-view:hover .scroll-bar,
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import javafx.beans.binding.Bindings;
import javafx.geometry.Orientation;
import javafx.scene.Node;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.StackPane;

Expand Down Expand Up @@ -745,10 +744,7 @@ public void setupMainPanel() {

createMainTable();

ScrollPane pane = mainTable.getPane();
pane.setFitToHeight(true);
pane.setFitToWidth(true);
splitPane.getItems().add(pane);
splitPane.getItems().add(mainTable);

// Set up name autocompleter for search:
setupAutoCompletion();
Expand Down
12 changes: 1 addition & 11 deletions src/main/java/org/jabref/gui/maintable/MainTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import javax.swing.undo.UndoManager;

import javafx.collections.ListChangeListener;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.SelectionMode;
import javafx.scene.control.TableRow;
import javafx.scene.control.TableView;
Expand Down Expand Up @@ -56,7 +55,6 @@ public class MainTable extends TableView<BibEntryTableViewModel> {

private final BasePanel panel;

private final ScrollPane pane;
private final BibDatabaseContext database;
private final UndoManager undoManager;

Expand Down Expand Up @@ -118,11 +116,7 @@ public MainTable(MainTableDataModel model, JabRefFrame frame,

this.panel = panel;

pane = new ScrollPane(this);
pane.setFitToHeight(true);
pane.setFitToWidth(true);

this.pane.getStylesheets().add(MainTable.class.getResource("MainTable.css").toExternalForm());
this.getStylesheets().add(MainTable.class.getResource("MainTable.css").toExternalForm());

// Store visual state
new PersistenceVisualStateTable(this, Globals.prefs);
Expand Down Expand Up @@ -335,10 +329,6 @@ public void addSelectionListener(ListChangeListener<? super BibEntryTableViewMod
getSelectionModel().getSelectedItems().addListener(listener);
}

public ScrollPane getPane() {
return pane;
}

public MainTableDataModel getTableModel() {
return model;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ private Boolean initColumnSize(TableView<?> table) {
for (TableColumnBase col : visibleLeafColumns) {
double share = col.getPrefWidth() / totalPrefWidth;
double newSize = tableWidth * share;

// Just to make sure that we are staying under the total table width (due to rounding errors)
newSize -= 2;
tobiasdiez marked this conversation as resolved.
Show resolved Hide resolved

resize(col, newSize - col.getWidth());
}
}
Expand All @@ -68,7 +72,7 @@ private Boolean constrainedResize(TableView.ResizeFeatures<?> prop) {
List<? extends TableColumnBase<?, ?>> visibleLeafColumns = table.getVisibleLeafColumns();
return constrainedResize(prop,
false,
getContentWidth(table),
getContentWidth(table) - 2,
visibleLeafColumns);
}

Expand Down