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

Fix/improve clickable areas of toggle buttons #6307

Merged
merged 2 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
34 changes: 18 additions & 16 deletions desktop/src/main/java/bisq/desktop/components/chart/ChartView.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,28 +177,29 @@ public void initialize() {

// Put all together
VBox timelineNavigationBox = new VBox();
double paddingLeft = 15;
double paddingTop = 0;
double paddingRight = 89;
double paddingLeft = 15;
// Y-axis width depends on data so we register a listener to get correct value
yAxisWidthListener = (observable, oldValue, newValue) -> {
double width = newValue.doubleValue();
if (width > 0) {
double rightPadding = width + 14;
VBox.setMargin(timeIntervalBox, new Insets(0, rightPadding, 0, paddingLeft));
VBox.setMargin(timelineNavigation, new Insets(0, rightPadding, 0, paddingLeft));
VBox.setMargin(timelineLabels, new Insets(0, rightPadding, 0, paddingLeft));
VBox.setMargin(timeIntervalBox, new Insets(paddingTop, rightPadding, 0, paddingLeft));
VBox.setMargin(timelineNavigation, new Insets(paddingTop, rightPadding, 0, paddingLeft));
VBox.setMargin(timelineLabels, new Insets(paddingTop, rightPadding, 0, paddingLeft));
VBox.setMargin(legendBox1, new Insets(10, rightPadding, 0, paddingLeft));
if (legendBox2 != null) {
VBox.setMargin(legendBox2, new Insets(-20, rightPadding, 0, paddingLeft));
VBox.setMargin(legendBox2, new Insets(paddingTop, rightPadding, 0, paddingLeft));
}
if (legendBox3 != null) {
VBox.setMargin(legendBox3, new Insets(-20, rightPadding, 0, paddingLeft));
VBox.setMargin(legendBox3, new Insets(paddingTop, rightPadding, 0, paddingLeft));
}
if (legendBox4 != null) {
VBox.setMargin(legendBox4, new Insets(-20, rightPadding, 0, paddingLeft));
VBox.setMargin(legendBox4, new Insets(paddingTop, rightPadding, 0, paddingLeft));
}
if (legendBox5 != null) {
VBox.setMargin(legendBox5, new Insets(-20, rightPadding, 0, paddingLeft));
VBox.setMargin(legendBox5, new Insets(paddingTop, rightPadding, 0, paddingLeft));
}

if (model.getDividerPositions()[0] == 0 && model.getDividerPositions()[1] == 1) {
Expand All @@ -207,25 +208,25 @@ public void initialize() {
}
};

VBox.setMargin(timeIntervalBox, new Insets(0, paddingRight, 0, paddingLeft));
VBox.setMargin(timelineNavigation, new Insets(0, paddingRight, 0, paddingLeft));
VBox.setMargin(timelineLabels, new Insets(0, paddingRight, 0, paddingLeft));
VBox.setMargin(legendBox1, new Insets(0, paddingRight, 0, paddingLeft));
VBox.setMargin(timeIntervalBox, new Insets(paddingTop, paddingRight, 0, paddingLeft));
VBox.setMargin(timelineNavigation, new Insets(paddingTop, paddingRight, 0, paddingLeft));
VBox.setMargin(timelineLabels, new Insets(paddingTop, paddingRight, 0, paddingLeft));
VBox.setMargin(legendBox1, new Insets(paddingTop, paddingRight, 0, paddingLeft));
timelineNavigationBox.getChildren().addAll(timelineNavigation, timelineLabels, legendBox1);
if (legendBox2 != null) {
VBox.setMargin(legendBox2, new Insets(-20, paddingRight, 0, paddingLeft));
VBox.setMargin(legendBox2, new Insets(paddingTop, paddingRight, 0, paddingLeft));
timelineNavigationBox.getChildren().add(legendBox2);
}
if (legendBox3 != null) {
VBox.setMargin(legendBox3, new Insets(-20, paddingRight, 0, paddingLeft));
VBox.setMargin(legendBox3, new Insets(paddingTop, paddingRight, 0, paddingLeft));
timelineNavigationBox.getChildren().add(legendBox3);
}
if (legendBox4 != null) {
VBox.setMargin(legendBox4, new Insets(-20, paddingRight, 0, paddingLeft));
VBox.setMargin(legendBox4, new Insets(paddingTop, paddingRight, 0, paddingLeft));
timelineNavigationBox.getChildren().add(legendBox4);
}
if (legendBox5 != null) {
VBox.setMargin(legendBox5, new Insets(-20, paddingRight, 0, paddingLeft));
VBox.setMargin(legendBox5, new Insets(paddingTop, paddingRight, 0, paddingLeft));
timelineNavigationBox.getChildren().add(legendBox5);
}
root.getChildren().addAll(timeIntervalBox, chart, timelineNavigationBox);
Expand Down Expand Up @@ -407,6 +408,7 @@ protected HBox initLegendsAndGetLegendBox(Collection<XYChart.Series<Number, Numb
toggle.setText(seriesId);
toggle.setId("charts-legend-toggle" + seriesIndexMap.get(seriesId));
toggle.setSelected(false);
toggle.setPadding(new Insets(0,0,0,10));
maybeAddToolTip(toggle, series);
hBox.getChildren().add(toggle);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ public void initialize() {
return row;
});

selectToggleButton.setPadding(new Insets(0, 90, -20, 0));
selectToggleButton.setPadding(new Insets(0, 0, -20, 0));
selectToggleButton.setText(Res.get("shared.enabled"));
selectToggleButton.setDisable(true);
HBox.setMargin(selectToggleButton, new Insets(0, 90, 0, 0));

numItems.setId("num-offers");
numItems.setPadding(new Insets(-5, 0, 0, 10));
Expand Down