Extract general icon behavior ("hand cursor") and remove styles that have no effect.

This commit is contained in:
Christoph Atteneder 2017-12-14 13:53:21 +01:00
parent 867c310cd5
commit c4f3f5cdfc
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
10 changed files with 22 additions and 35 deletions

View file

@ -192,6 +192,11 @@ bg color of non edit textFields: fafafa
-fx-background-color: -bs-bg-light; -fx-background-color: -bs-bg-light;
} }
.display-text-field {
-fx-alignment: center;
-fx-background-color: -bs-white;
}
.text-area:readonly .content { .text-area:readonly .content {
-fx-background-color: -bs-bg-light; -fx-background-color: -bs-bg-light;
} }
@ -206,6 +211,10 @@ bg color of non edit textFields: fafafa
-fx-underline: true; -fx-underline: true;
} }
.icon, icon:hover {
-fx-cursor: hand;
}
#icon-button { #icon-button {
-fx-cursor: hand; -fx-cursor: hand;
-fx-background-color: transparent; -fx-background-color: transparent;
@ -213,12 +222,10 @@ bg color of non edit textFields: fafafa
.copy-icon { .copy-icon {
-fx-text-fill: -fx-accent; -fx-text-fill: -fx-accent;
-fx-cursor: hand;
} }
.copy-icon-disputes { .copy-icon-disputes {
-fx-text-fill: -bs-white; -fx-text-fill: -bs-white;
-fx-cursor: hand;
} }
.copy-icon:hover { .copy-icon:hover {
@ -227,82 +234,61 @@ bg color of non edit textFields: fafafa
.external-link-icon { .external-link-icon {
-fx-text-fill: -fx-accent; -fx-text-fill: -fx-accent;
-fx-cursor: hand;
} }
.received-funds-icon { .received-funds-icon {
-fx-text-fill: -bs-green-soft; -fx-text-fill: -bs-green-soft;
-fx-cursor: hand;
}
.received-funds-icon:hover {
-fx-text-fill: -bs-black;
-fx-cursor: hand;
} }
.sent-funds-icon { .sent-funds-icon {
-fx-text-fill: -bs-red-soft; -fx-text-fill: -bs-red-soft;
-fx-cursor: hand;
}
.sent-funds-icon:hover {
-fx-text-fill: -bs-black;
-fx-cursor: hand;
} }
/* TODO: not used at the moment*/
.internal-funds-icon { .internal-funds-icon {
-fx-text-fill: -bs-dark-grey; -fx-text-fill: -bs-dark-grey;
-fx-cursor: hand; -fx-cursor: hand;
} }
.dao-tx-type-unverified-icon, .dao-tx-type-unverified-icon,
.dao-tx-type-unverified-icon:hover { .dao-tx-type-unverified-icon:hover {
-fx-text-fill: -bs-yellow; -fx-text-fill: -bs-yellow;
-fx-cursor: hand;
} }
.dao-tx-type-invalid-icon, .dao-tx-type-invalid-icon,
.dao-tx-type-invalid-icon:hover { .dao-tx-type-invalid-icon:hover {
-fx-text-fill: -bs-error-red; -fx-text-fill: -bs-error-red;
-fx-cursor: hand;
} }
.dao-tx-type-default-icon, .dao-tx-type-default-icon,
.dao-tx-type-default-icon:hover { .dao-tx-type-default-icon:hover {
-fx-text-fill: -bs-grey; -fx-text-fill: -bs-grey;
-fx-cursor: hand;
} }
.dao-tx-type-genesis-icon, .dao-tx-type-genesis-icon,
.dao-tx-type-genesis-icon:hover { .dao-tx-type-genesis-icon:hover {
-fx-text-fill: -fx-accent; -fx-text-fill: -fx-accent;
-fx-cursor: hand;
} }
.dao-tx-type-received-funds-icon, .dao-tx-type-received-funds-icon,
.dao-tx-type-received-funds-icon:hover { .dao-tx-type-received-funds-icon:hover {
-fx-text-fill: -bs-green-soft; -fx-text-fill: -bs-green-soft;
-fx-cursor: hand;
} }
.dao-tx-type-sent-funds-icon, .dao-tx-type-sent-funds-icon,
.dao-tx-type-sent-funds-icon:hover { .dao-tx-type-sent-funds-icon:hover {
-fx-text-fill: -bs-red-soft; -fx-text-fill: -bs-red-soft;
-fx-cursor: hand;
} }
.dao-tx-type-default-icon, .dao-tx-type-default-icon,
.dao-tx-type-default-icon:hover { .dao-tx-type-default-icon:hover {
-fx-text-fill: -bs-grey; -fx-text-fill: -bs-grey;
-fx-cursor: hand;
} }
.dao-tx-type-issuance-icon, .dao-tx-type-issuance-icon,
.dao-tx-type-issuance-icon:hover { .dao-tx-type-issuance-icon:hover {
-fx-text-fill: -bs-green; -fx-text-fill: -bs-green;
-fx-cursor: hand;
} }

View file

@ -72,14 +72,14 @@ public class AddressTextField extends AnchorPane {
Label extWalletIcon = new Label(); Label extWalletIcon = new Label();
extWalletIcon.setLayoutY(3); extWalletIcon.setLayoutY(3);
extWalletIcon.getStyleClass().add("copy-icon"); extWalletIcon.getStyleClass().addAll("icon", "copy-icon");
extWalletIcon.setTooltip(new Tooltip(tooltipText)); extWalletIcon.setTooltip(new Tooltip(tooltipText));
AwesomeDude.setIcon(extWalletIcon, AwesomeIcon.SIGNIN); AwesomeDude.setIcon(extWalletIcon, AwesomeIcon.SIGNIN);
extWalletIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet)); extWalletIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet));
Label copyIcon = new Label(); Label copyIcon = new Label();
copyIcon.setLayoutY(3); copyIcon.setLayoutY(3);
copyIcon.getStyleClass().add("copy-icon"); copyIcon.getStyleClass().addAll("icon", "copy-icon");
Tooltip.install(copyIcon, new Tooltip(Res.get("addressTextField.copyToClipboard"))); Tooltip.install(copyIcon, new Tooltip(Res.get("addressTextField.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY); AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
copyIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> { copyIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> {

View file

@ -22,6 +22,7 @@ public class AddressWithIconAndDirection extends AnchorPane {
public AddressWithIconAndDirection(String text, String address, AwesomeIcon awesomeIcon, boolean received) { public AddressWithIconAndDirection(String text, String address, AwesomeIcon awesomeIcon, boolean received) {
Label directionIcon = new Label(); Label directionIcon = new Label();
directionIcon.setLayoutY(3); directionIcon.setLayoutY(3);
directionIcon.getStyleClass().add("icon");
directionIcon.getStyleClass().add(received ? "received-funds-icon" : "sent-funds-icon"); directionIcon.getStyleClass().add(received ? "received-funds-icon" : "sent-funds-icon");
AwesomeDude.setIcon(directionIcon, received ? AwesomeIcon.SIGNIN : AwesomeIcon.SIGNOUT); AwesomeDude.setIcon(directionIcon, received ? AwesomeIcon.SIGNIN : AwesomeIcon.SIGNOUT);
directionIcon.setMouseTransparent(true); directionIcon.setMouseTransparent(true);
@ -45,7 +46,7 @@ public class AddressWithIconAndDirection extends AnchorPane {
openLinkIcon = new Label(); openLinkIcon = new Label();
openLinkIcon.setLayoutY(3); openLinkIcon.setLayoutY(3);
openLinkIcon.getStyleClass().add("external-link-icon"); openLinkIcon.getStyleClass().addAll("icon", "external-link-icon");
openLinkIcon.setOpacity(0.7); openLinkIcon.setOpacity(0.7);
AwesomeDude.setIcon(openLinkIcon, awesomeIcon); AwesomeDude.setIcon(openLinkIcon, awesomeIcon);

View file

@ -74,7 +74,7 @@ public class BsqAddressTextField extends AnchorPane {
Label copyIcon = new Label(); Label copyIcon = new Label();
copyIcon.setLayoutY(3); copyIcon.setLayoutY(3);
copyIcon.getStyleClass().add("copy-icon"); copyIcon.getStyleClass().addAll("icon", "copy-icon");
copyIcon.setTooltip(new Tooltip(Res.get("addressTextField.copyToClipboard"))); copyIcon.setTooltip(new Tooltip(Res.get("addressTextField.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY); AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
copyIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> { copyIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> {

View file

@ -29,7 +29,7 @@ public class HyperlinkWithIcon extends HBox {
hyperlink = new Hyperlink(text); hyperlink = new Hyperlink(text);
icon = new Label(); icon = new Label();
icon.getStyleClass().add("external-link-icon"); icon.getStyleClass().addAll("icon", "external-link-icon");
AwesomeDude.setIcon(icon, awesomeIcon); AwesomeDude.setIcon(icon, awesomeIcon);
icon.setMinWidth(20); icon.setMinWidth(20);
icon.setOpacity(0.7); icon.setOpacity(0.7);

View file

@ -42,7 +42,7 @@ public class TextFieldWithCopyIcon extends AnchorPane {
public TextFieldWithCopyIcon() { public TextFieldWithCopyIcon() {
Label copyIcon = new Label(); Label copyIcon = new Label();
copyIcon.setLayoutY(3); copyIcon.setLayoutY(3);
copyIcon.getStyleClass().add("copy-icon"); copyIcon.getStyleClass().addAll("icon", "copy-icon");
copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard"))); copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY); AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
AnchorPane.setRightAnchor(copyIcon, 0.0); AnchorPane.setRightAnchor(copyIcon, 0.0);

View file

@ -75,7 +75,7 @@ public class TxIdTextField extends AnchorPane {
copyIcon = new Label(); copyIcon = new Label();
copyIcon.setLayoutY(3); copyIcon.setLayoutY(3);
copyIcon.getStyleClass().add("copy-icon"); copyIcon.getStyleClass().addAll("icon", "copy-icon");
copyIcon.setTooltip(new Tooltip(Res.get("txIdTextField.copyIcon.tooltip"))); copyIcon.setTooltip(new Tooltip(Res.get("txIdTextField.copyIcon.tooltip")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY); AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
AnchorPane.setRightAnchor(copyIcon, 30.0); AnchorPane.setRightAnchor(copyIcon, 30.0);
@ -83,7 +83,7 @@ public class TxIdTextField extends AnchorPane {
Tooltip tooltip = new Tooltip(Res.get("txIdTextField.blockExplorerIcon.tooltip")); Tooltip tooltip = new Tooltip(Res.get("txIdTextField.blockExplorerIcon.tooltip"));
blockExplorerIcon = new Label(); blockExplorerIcon = new Label();
blockExplorerIcon.getStyleClass().add("external-link-icon"); blockExplorerIcon.getStyleClass().addAll("icon", "external-link-icon");
blockExplorerIcon.setTooltip(tooltip); blockExplorerIcon.setTooltip(tooltip);
AwesomeDude.setIcon(blockExplorerIcon, AwesomeIcon.EXTERNAL_LINK); AwesomeDude.setIcon(blockExplorerIcon, AwesomeIcon.EXTERNAL_LINK);
blockExplorerIcon.setMinWidth(20); blockExplorerIcon.setMinWidth(20);

View file

@ -284,7 +284,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
textField.setPrefWidth(115); //140 textField.setPrefWidth(115); //140
textField.setMouseTransparent(true); textField.setMouseTransparent(true);
textField.setFocusTraversable(false); textField.setFocusTraversable(false);
textField.setStyle("-fx-alignment: center; -fx-background-color: white;"); textField.getStyleClass().add("display-text-field");
Label label = new Label(text); Label label = new Label(text);
label.setId("nav-balance-label"); label.setId("nav-balance-label");

View file

@ -481,7 +481,7 @@ public class BsqTxView extends ActivatableView<GridPane, Void> {
break; break;
} }
Label label = AwesomeDude.createIconLabel(awesomeIcon); Label label = AwesomeDude.createIconLabel(awesomeIcon);
label.getStyleClass().add(style); label.getStyleClass().addAll("icon", style);
label.setTooltip(new Tooltip(toolTipText)); label.setTooltip(new Tooltip(toolTipText));
setGraphic(label); setGraphic(label);
} else { } else {

View file

@ -852,7 +852,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
// Need to set it here otherwise style is not correct // Need to set it here otherwise style is not correct
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY, "16.0"); AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY, "16.0");
copyIcon.getStyleClass().add("copy-icon-disputes"); copyIcon.getStyleClass().addAll("icon", "copy-icon-disputes");
// TODO There are still some cell rendering issues on updates // TODO There are still some cell rendering issues on updates
setGraphic(messageAnchorPane); setGraphic(messageAnchorPane);