Skip to content

Commit

Permalink
Use FormBuilder.getIcon instead of AwesomeDude.createIconLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Oct 23, 2018
1 parent 501050d commit 0bbafc0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

package bisq.desktop.components;

import bisq.desktop.util.FormBuilder;

import bisq.core.locale.Res;

import bisq.common.UserThread;

import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;

import javafx.scene.Parent;
Expand Down Expand Up @@ -61,7 +62,7 @@ public class InfoDisplay extends Parent {

private boolean useReadMore;

private final Label icon = AwesomeDude.createIconLabel(AwesomeIcon.INFO_SIGN);
private final Label icon = FormBuilder.getIcon(AwesomeIcon.INFO_SIGN);
private final TextFlow textFlow;
private final Label label;
private final Hyperlink link;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package bisq.desktop.main.dao.governance.proposals;

import bisq.desktop.util.FormBuilder;

import bisq.core.dao.DaoFacade;
import bisq.core.dao.governance.ballot.Ballot;
import bisq.core.dao.governance.ballot.vote.Vote;
Expand All @@ -25,7 +27,6 @@
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;

import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;

import javafx.scene.control.Button;
Expand Down Expand Up @@ -120,8 +121,7 @@ public void onPhaseChanged(DaoPhase.Phase phase) {
//noinspection IfCanBeSwitch
Label icon;
if (phase == DaoPhase.Phase.PROPOSAL) {
//icon = AwesomeDude.createIconLabel(AwesomeIcon.TRASH);
icon = AwesomeDude.createIconLabel(AwesomeIcon.TRASH);
icon = FormBuilder.getIcon(AwesomeIcon.TRASH);

icon.getStyleClass().addAll("icon", "dao-remove-proposal-icon");
iconButton = new Button("", icon);
Expand All @@ -143,18 +143,18 @@ public void onPhaseChanged(DaoPhase.Phase phase) {

if (vote != null) {
if ((vote).isAccepted()) {
icon = AwesomeDude.createIconLabel(AwesomeIcon.THUMBS_UP);
icon = FormBuilder.getIcon(AwesomeIcon.THUMBS_UP);
icon.getStyleClass().addAll("icon", "dao-accepted-icon");
iconButton = new Button("", icon);
iconButton.setUserData(IconButtonTypes.ACCEPT);
} else {
icon = AwesomeDude.createIconLabel(AwesomeIcon.THUMBS_DOWN);
icon = FormBuilder.getIcon(AwesomeIcon.THUMBS_DOWN);
icon.getStyleClass().addAll("icon", "dao-rejected-icon");
iconButton = new Button("", icon);
iconButton.setUserData(IconButtonTypes.REJECT);
}
} else {
icon = AwesomeDude.createIconLabel(AwesomeIcon.MINUS);
icon = FormBuilder.getIcon(AwesomeIcon.MINUS);
icon.getStyleClass().addAll("icon", "dao-ignored-icon");
iconButton = new Button("", icon);
iconButton.setUserData(IconButtonTypes.IGNORE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package bisq.desktop.main.dao.governance.result;

import bisq.desktop.util.FormBuilder;

import bisq.core.dao.governance.ballot.Ballot;
import bisq.core.dao.governance.ballot.vote.Vote;
import bisq.core.dao.governance.proposal.Proposal;
Expand All @@ -33,7 +35,6 @@

import org.bitcoinj.core.Coin;

import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;

import javafx.scene.control.Label;
Expand Down Expand Up @@ -66,14 +67,14 @@ public Label getMyVoteIcon() {
Label myVoteIcon;
if (vote != null) {
if ((vote).isAccepted()) {
myVoteIcon = AwesomeDude.createIconLabel(AwesomeIcon.THUMBS_UP);
myVoteIcon = FormBuilder.getIcon(AwesomeIcon.THUMBS_UP);
myVoteIcon.getStyleClass().add("dao-accepted-icon");
} else {
myVoteIcon = AwesomeDude.createIconLabel(AwesomeIcon.THUMBS_DOWN);
myVoteIcon = FormBuilder.getIcon(AwesomeIcon.THUMBS_DOWN);
myVoteIcon.getStyleClass().add("dao-rejected-icon");
}
} else {
myVoteIcon = AwesomeDude.createIconLabel(AwesomeIcon.MINUS);
myVoteIcon = FormBuilder.getIcon(AwesomeIcon.MINUS);
myVoteIcon.getStyleClass().add("dao-ignored-icon");
}
return myVoteIcon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

import javax.inject.Inject;

import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;

import javafx.scene.control.Label;
Expand Down Expand Up @@ -569,7 +568,7 @@ public void updateItem(final BsqTxListItem item, boolean empty) {
style = "dao-tx-type-unverified-icon";
break;
}
Label label = AwesomeDude.createIconLabel(awesomeIcon);
Label label = FormBuilder.getIcon(awesomeIcon);
label.getStyleClass().addAll("icon", style);
label.setTooltip(new Tooltip(toolTipText));
if (doRotate)
Expand Down

0 comments on commit 0bbafc0

Please sign in to comment.