Skip to content

Commit

Permalink
Helper functions to set margins.
Browse files Browse the repository at this point in the history
  • Loading branch information
counterweightoperator committed Aug 6, 2023
1 parent 98d8add commit 2416bb8
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ protected Hyperlink addLearnMoreHyperlink() {
root.getChildren().add(learnMore);
return learnMore;
}

protected void setHeadlineMargin(Label headlineLabel) {
VBox.setMargin(headlineLabel, new Insets(35, 0, 0, 0));
}

protected void setLastLabelMargin(Label lastLabel) {
VBox.setMargin(lastLabel, new Insets(0, 0, 15, 0));
}

protected abstract String getIconId();

protected abstract String getKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public BisqAcademyView(BisqAcademyModel model, BisqAcademyController controller)
Label tradeSafelyContent = addContentLabel("tradeSafelyContent");
Hyperlink learnMore = addLearnMoreHyperlink();

VBox.setMargin(exchangeDecentralizedHeadline, new Insets(25, 0, 0, 0));
VBox.setMargin(whyBisqHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(tradeSafelyHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(tradeSafelyContent, new Insets(0, 0, 15, 0));
setHeadlineMargin(exchangeDecentralizedHeadline);
setHeadlineMargin(whyBisqHeadline);
setHeadlineMargin(tradeSafelyHeadline);
setLastLabelMargin(tradeSafelyContent);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ public BitcoinAcademyView(BitcoinAcademyModel model, BitcoinAcademyController co
Label whyUseBitcoinContent = addContentLabel("whyUseBitcoinContent");
Hyperlink learnMore = addLearnMoreHyperlink();

VBox.setMargin(whatIsBitcoinHeadline, new Insets(25, 0, 0, 0));
VBox.setMargin(whyUseBitcoinHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(whyUseBitcoinContent, new Insets(0, 0, 15, 0));

setHeadlineMargin(whatIsBitcoinHeadline);
setHeadlineMargin(whyUseBitcoinHeadline);
setLastLabelMargin(whyUseBitcoinContent);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ public FossAcademyView(FossAcademyModel model, FossAcademyController controller)
Label bitcoinAndFossContent = addContentLabel("bitcoinAndFossContent");
Label openSourceBenefitsHeadline = addHeadlineLabel("openSourceBenefitsHeadline");
Label openSourceBenefitsContent = addContentLabel("openSourceBenefitsContent");

Hyperlink learnMore = addLearnMoreHyperlink();

VBox.setMargin(bitcoinAndFossHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(openSourceBenefitsHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(openSourceBenefitsContent, new Insets(0, 0, 15, 0));
setHeadlineMargin(bitcoinAndFossHeadline);
setHeadlineMargin(openSourceBenefitsHeadline);
setLastLabelMargin(openSourceBenefitsContent);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ public PrivacyAcademyView(PrivacyAcademyModel model, PrivacyAcademyController co
Label giveUpPrivacyContent = addContentLabel("giveUpPrivacyContent");
Label bisqProtectsPrivacyHeadline = addHeadlineLabel("bisqProtectsPrivacyHeadline");
Label bisqProtectsPrivacyContent = addContentLabel("bisqProtectsPrivacyContent");

Hyperlink learnMore = addLearnMoreHyperlink();

VBox.setMargin(introContent, new Insets(25, 0, 0, 0));
VBox.setMargin(whyPrivacyHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(giveUpPrivacyHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(bisqProtectsPrivacyHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(bisqProtectsPrivacyContent, new Insets(0, 0, 15, 0));
setHeadlineMargin(introContent);
setHeadlineMargin(whyPrivacyHeadline);
setHeadlineMargin(giveUpPrivacyHeadline);
setHeadlineMargin(bisqProtectsPrivacyHeadline);
setLastLabelMargin(bisqProtectsPrivacyContent);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public SecurityAcademyView(SecurityAcademyModel model, SecurityAcademyController
Label avoidScamsContent = addContentLabel("avoidScamsContent");
Hyperlink learnMore = addLearnMoreHyperlink();

VBox.setMargin(introContent, new Insets(25, 0, 0, 0));
VBox.setMargin(securingYourKeysHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(avoidScamsHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(avoidScamsContent, new Insets(0, 0, 15, 0));
setHeadlineMargin(introContent);
setHeadlineMargin(securingYourKeysHeadline);
setHeadlineMargin(avoidScamsHeadline);
setLastLabelMargin(avoidScamsContent);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ public WalletsAcademyView(WalletsAcademyModel model, WalletsAcademyController co
Label whatIsAWalletContent = addContentLabel("whatIsAWalletContent");
Label howToPickHeadline = addHeadlineLabel("howToPickHeadline");
Label howToPickContent = addContentLabel("howToPickContent");

Hyperlink learnMore = addLearnMoreHyperlink();
VBox.setMargin(whatIsAWalletHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(howToPickHeadline, new Insets(35, 0, 0, 0));
VBox.setMargin(howToPickContent, new Insets(0, 0, 15, 0));

setHeadlineMargin(whatIsAWalletHeadline);
setHeadlineMargin(howToPickHeadline);
setLastLabelMargin(howToPickContent);
}

@Override
Expand Down

0 comments on commit 2416bb8

Please sign in to comment.