Skip to content

Commit

Permalink
Merge pull request #1392 from ripcurlx/add-disabled-style
Browse files Browse the repository at this point in the history
Add disabled style for offer
  • Loading branch information
ManfredKarrer authored Feb 23, 2018
2 parents bdd9326 + 918995d commit 429b5c5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions gui/src/main/java/io/bisq/gui/bisq.css
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,11 @@ textfield */
-fx-background-color: -bs-content-bg-grey;
}

/* Open Offer */
.offer-disabled {
-fx-text-fill: -bs-light-grey;
}

/* Account setup */
#wizard-title-deactivated {
-fx-font-weight: bold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,12 @@ public TableCell<OpenOfferListItem, OpenOfferListItem> call(
@Override
public void updateItem(final OpenOfferListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null)
if (item != null) {
if (model.isDeactivated(item)) getStyleClass().add("offer-disabled");
setText(model.getDate(item));
else
} else {
setText("");
}
}
};
}
Expand All @@ -249,6 +251,7 @@ public TableCell<OpenOfferListItem, OpenOfferListItem> call(
@Override
public void updateItem(final OpenOfferListItem item, boolean empty) {
super.updateItem(item, empty);
if (model.isDeactivated(item)) getStyleClass().add("offer-disabled");
setText(model.getAmount(item));
}
};
Expand All @@ -268,6 +271,7 @@ public TableCell<OpenOfferListItem, OpenOfferListItem> call(
@Override
public void updateItem(final OpenOfferListItem item, boolean empty) {
super.updateItem(item, empty);
if (model.isDeactivated(item)) getStyleClass().add("offer-disabled");
setText(model.getPrice(item));
}
};
Expand All @@ -287,10 +291,12 @@ public TableCell<OpenOfferListItem, OpenOfferListItem> call(
@Override
public void updateItem(final OpenOfferListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null)
if (item != null) {
if (model.isDeactivated(item)) getStyleClass().add("offer-disabled");
setText(model.getVolume(item));
else
} else {
setText("");
}
}
};
}
Expand All @@ -309,6 +315,7 @@ public TableCell<OpenOfferListItem, OpenOfferListItem> call(
@Override
public void updateItem(final OpenOfferListItem item, boolean empty) {
super.updateItem(item, empty);
if (model.isDeactivated(item)) getStyleClass().add("offer-disabled");
setText(model.getDirectionLabel(item));
}
};
Expand All @@ -328,6 +335,7 @@ public TableCell<OpenOfferListItem, OpenOfferListItem> call(
@Override
public void updateItem(final OpenOfferListItem item, boolean empty) {
super.updateItem(item, empty);
if (model.isDeactivated(item)) getStyleClass().add("offer-disabled");
setText(model.getMarketLabel(item));
}
};
Expand Down Expand Up @@ -376,6 +384,7 @@ public void updateItem(final OpenOfferListItem item, boolean empty) {
onDeactivateOpenOffer(item.getOpenOffer());
}
updateState(item.getOpenOffer());
tableView.refresh();
});
} else {
setGraphic(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ String getDate(OpenOfferListItem item) {
return formatter.formatDateTime(item.getOffer().getDate());
}

boolean isDeactivated(OpenOfferListItem item){
return item != null && item.getOpenOffer() != null && item.getOpenOffer().isDeactivated();
}

boolean isBootstrapped() {
return p2PService.isBootstrapped();
}
Expand Down

0 comments on commit 429b5c5

Please sign in to comment.