Skip to content

Commit

Permalink
Improve RichTableView
Browse files Browse the repository at this point in the history
  • Loading branch information
axpoems committed Sep 24, 2024
1 parent a82098c commit 56497fa
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ private RichTableView(SortedList<T> sortedList,
exportHyperlink.setAlignment(Pos.BASELINE_LEFT);

HBox.setMargin(exportHyperlink, new Insets(8, 10, 0, 0));
HBox footerHBox = new HBox(numEntriesLabel, Spacer.fillHBox(), exportHyperlink);
footerHBox.setAlignment(Pos.BASELINE_LEFT);
VBox footerVBox = new VBox(5, numEntriesLabel, exportHyperlink);
footerVBox.setAlignment(Pos.BASELINE_LEFT);

VBox.setMargin(headerBox, new Insets(0, 10, 5, 10));
VBox.setMargin(headerBox, new Insets(0, 0, 5, 0));
VBox.setVgrow(tableView, Priority.ALWAYS);
VBox.setMargin(footerHBox, new Insets(-5, 0, 0, 10));
getChildren().addAll(headerBox, tableView, footerHBox);
VBox.setMargin(footerVBox, new Insets(10, 0, 0, 0));
getChildren().addAll(headerBox, tableView, footerVBox);

listChangeListener = c -> listItemsChanged();
toggleChangeListener = (observable, oldValue, newValue) -> selectedFilterMenuItemChanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static class View extends bisq.desktop.common.view.View<VBox, Model, Cont
private final RichTableView<NodeListItem> nodesTableView;

public View(Model model, Controller controller) {
super(new VBox(20), model, controller);
super(new VBox(40), model, controller);

connectionsTableView = new RichTableView<>(model.getConnectionListItems().getSortedList(),
Res.get("network.connections.title"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ private View(Model model, Controller controller) {
systemLoad.setAlignment(Pos.TOP_LEFT);
systemLoad.setPrefWidth(4000);

VBox.setMargin(powHeadline, new Insets(0, 0, 0, 10));
VBox.setMargin(systemLoadHeadline, new Insets(15, 0, 0, 10));
VBox.setMargin(systemLoadHeadline, new Insets(15, 0, 0, 0));
root.getChildren().addAll(powHeadline, pow, systemLoadHeadline, systemLoad);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ protected void onViewDetached() {

private VBox getVBox(Label headline, Label details) {
headline.getStyleClass().add("standard-table-headline");
VBox.setMargin(headline, new Insets(0, 0, 0, 10));
VBox vBox = new VBox(10, headline, details);
vBox.setAlignment(Pos.TOP_LEFT);
details.getStyleClass().add("standard-table-view");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public BuildReputationView(BuildReputationModel model, BuildReputationController

HBox buttons = new HBox(20, burnBsqButton, bsqBondButton, signedAccountButton, accountAgeButton);

VBox.setMargin(headlineLabel, new Insets(-10, 0, 0, 0));
VBox.setMargin(headlineLabel, new Insets(20, 0, 0, 0));
VBox.setMargin(buttons, new Insets(10, 0, 0, 0));
VBox vBox = new VBox(10, headlineLabel, info, buttons, learnMore);
vBox.getStyleClass().add("bisq-box-2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,24 @@ public class ReputationRankingView extends View<VBox, ReputationRankingModel, Re

public ReputationRankingView(ReputationRankingModel model,
ReputationRankingController controller) {
super(new VBox(20), model, controller);
root.setPadding(new Insets(0, 40, 40, 40));
super(new VBox(), model, controller);

Label headlineLabel = new Label(Res.get("reputation.table.headline"));
headlineLabel.getStyleClass().add("bisq-text-headline-5");

richTableView = new RichTableView<>(model.getSortedList(),
Res.get("reputation.table.headline"),
"",
model.getFilterItems(),
model.getFilterMenuItemToggleGroup(),
controller::applySearchPredicate);
configTableView();

VBox contentBox = new VBox(10);
contentBox.getChildren().addAll(headlineLabel, richTableView);
contentBox.getStyleClass().add("bisq-common-bg");
VBox.setVgrow(richTableView, Priority.ALWAYS);
root.getChildren().addAll(richTableView);
root.getChildren().addAll(contentBox);
root.setPadding(new Insets(0, 40, 20, 40));
}

@Override
Expand Down
8 changes: 7 additions & 1 deletion apps/desktop/desktop/src/main/resources/css/containers.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@

/*******************************************************************************
* *
* StandardTable *
* StandardTable *
* *
******************************************************************************/

Expand All @@ -364,6 +364,12 @@

.standard-table-view {
-fx-background-color: -bisq-dark-grey-20;
-fx-border-color: transparent;
-fx-padding: 0;
}

.standard-table-view .column-header {
-fx-background-color: -bisq-dark-grey-30;
}

.standard-table-num-entries {
Expand Down

0 comments on commit 56497fa

Please sign in to comment.