Skip to content

Commit

Permalink
Merge pull request #6307 from Android-X13/fix-issue-6263
Browse files Browse the repository at this point in the history
Fix/improve clickable areas of toggle buttons
ripcurlx authored Aug 17, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 01ba30a + 402eb99 commit ad92129
Showing 2 changed files with 20 additions and 17 deletions.
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
@@ -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) {
@@ -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);
@@ -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);
});
Original file line number Diff line number Diff line change
@@ -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));

0 comments on commit ad92129

Please sign in to comment.