Ass styles for buy/sell at confirmation popups, add focus colors

This commit is contained in:
Manfred Karrer 2016-03-02 11:39:56 +01:00
parent 61eee8f445
commit 29aac699f8
5 changed files with 68 additions and 35 deletions

View File

@ -105,6 +105,7 @@ public class FileManager<T> {
if (savePending.getAndSet(true))
return; // Already pending.
executor.schedule(saveFileTask, delayInMilli, TimeUnit.MILLISECONDS);
}

View File

@ -77,7 +77,7 @@ import static io.bitsquare.app.BitsquareEnvironment.APP_NAME_KEY;
public class BitsquareApp extends Application {
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
public static final boolean DEV_MODE = true;
public static final boolean DEV_MODE = false;
public static final boolean IS_RELEASE_VERSION = !DEV_MODE && true;
private static Environment env;

View File

@ -32,11 +32,11 @@ bg color of non edit textFields: fafafa
-fx-accent: #0f87c3;
-bs-blue-soft: derive(-fx-accent, 60%);
-bs-blue-transparent: #0f87c344;
-bs-green: #00aa33;
-bs-green-soft: derive(-bs-green, 60%);
-bs-green-transparent: #00aa3344;
-bs-error-red: #dd0000;
-bs-red-soft: derive(-bs-error-red, 60%);
@ -57,13 +57,18 @@ bg color of non edit textFields: fafafa
-bs-warning: -bs-orange;
-bs-buy: -bs-yellow;
-bs-buy-dark: derive(-bs-buy, -10%);
-bs-buy-focus: derive(-bs-buy, -50%);
-bs-buy-hover: derive(-bs-buy, -10%);
-bs-buy-transparent: derive(-bs-buy, 95%);
-bs-sell: -bs-turquoise;
-bs-sell-dark: derive(-bs-sell, -10%);
-bs-sell-focus: derive(-bs-sell, -50%);
-bs-sell-hover: derive(-bs-sell, -10%);
-bs-sell-transparent: derive(-bs-sell, 95%);
-bs-cancel: -bs-light-grey;
-bs-cancel-focus: derive(-bs-cancel, -50%);
-bs-cancel-hover: derive(-bs-cancel, -10%);
-fx-default-button: derive(-fx-accent, 95%);
-fx-focus-color: -fx-accent;
@ -869,8 +874,26 @@ textfield */
-fx-background-radius: 5;
}
#buy-button-big:focused {
-fx-background-color: -bs-buy-focus, -fx-inner-border, -fx-body-color, -fx-faint-focus-color, -fx-body-color;
}
#buy-button-big:hover {
-fx-base: -bs-buy-dark;
-fx-base: -bs-buy-hover;
}
#buy-button {
-fx-base: -bs-buy;
-fx-text-fill: white;
-fx-font-weight: bold;
}
#buy-button:focused {
-fx-background-color: -bs-buy-focus, -fx-inner-border, -fx-body-color, -fx-faint-focus-color, -fx-body-color;
}
#buy-button:hover {
-fx-base: -bs-buy-hover;
}
#sell-button-big {
@ -881,18 +904,12 @@ textfield */
-fx-background-radius: 5;
}
#sell-button-big:focused {
-fx-background-color: -bs-sell-focus, -fx-inner-border, -fx-body-color, -fx-faint-focus-color, -fx-body-color;
}
#sell-button-big:hover {
-fx-base: -bs-sell-dark;
}
#buy-button {
-fx-base: -bs-buy;
-fx-text-fill: white;
-fx-font-weight: bold;
}
#buy-button:hover {
-fx-base: -bs-buy-dark;
-fx-base: -bs-sell-hover;
}
#sell-button {
@ -901,18 +918,26 @@ textfield */
-fx-font-weight: bold;
}
#sell-button:focused {
-fx-background-color: -bs-sell-focus, -fx-inner-border, -fx-body-color, -fx-faint-focus-color, -fx-body-color;
}
#sell-button:hover {
-fx-base: -bs-sell-dark;
-fx-base: -bs-sell-hover;
}
#cancel-button {
-fx-base: -bs-light-grey;
-fx-base: -bs-cancel;
-fx-text-fill: white;
-fx-font-weight: bold;
}
#cancel-button:hover {
-fx-base: derive(-bs-light-grey, -10%);
-fx-base: -bs-cancel-hover;
}
#cancel-button:focused {
-fx-background-color: -bs-cancel-focus, -fx-inner-border, -fx-body-color, -fx-faint-focus-color, -fx-body-color;
}
/********************************************************************************************************************

View File

@ -224,30 +224,33 @@ public class OfferDetailsPopup extends Popup {
addTitledGroupBg(gridPane, ++rowIndex, 1, "Commitment", Layout.GROUP_DISTANCE);
addLabelTextField(gridPane, rowIndex, "Please note:", Offer.TAC_OFFERER, Layout.FIRST_ROW_AND_GROUP_DISTANCE);
Button cancelButton = addConfirmButton(true);
addCancelButton(cancelButton);
addConfirmAndCancelButtons(true);
} else if (takeOfferHandlerOptional.isPresent()) {
addTitledGroupBg(gridPane, ++rowIndex, 1, "Contract", Layout.GROUP_DISTANCE);
addLabelTextField(gridPane, rowIndex, "Terms and conditions:", Offer.TAC_TAKER, Layout.FIRST_ROW_AND_GROUP_DISTANCE);
Button cancelButton = addConfirmButton(false);
addCancelButton(cancelButton);
addConfirmAndCancelButtons(false);
} else {
Button cancelButton = addButtonAfterGroup(gridPane, ++rowIndex, "Close");
cancelButton.setOnAction(e -> {
closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
closeHandlerOptional.ifPresent(Runnable::run);
hide();
});
}
}
@NotNull
private Button addConfirmButton(boolean isPlaceOffer) {
private void addConfirmAndCancelButtons(boolean isPlaceOffer) {
Tuple2<Button, Button> tuple = add2ButtonsAfterGroup(gridPane,
++rowIndex,
isPlaceOffer ? "Confirm place offer" : "Confirm take offer",
"Cancel");
Button placeButton = tuple.first;
boolean isBuyOffer = offer.getDirection() == Offer.Direction.BUY;
boolean isBuyStyle = isPlaceOffer ? isBuyOffer : !isBuyOffer;
placeButton.setId(isBuyStyle ? "buy-button" : "sell-button");
placeButton.setOnAction(e -> {
if (user.getAcceptedArbitrators().size() > 0) {
if (isPlaceOffer)
@ -262,12 +265,11 @@ public class OfferDetailsPopup extends Popup {
}
hide();
});
return tuple.second;
}
private void addCancelButton(Button cancelButton) {
Button cancelButton = tuple.second;
cancelButton.setId("cancel-button");
cancelButton.setOnAction(e -> {
closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
closeHandlerOptional.ifPresent(Runnable::run);
hide();
});
}

View File

@ -397,23 +397,28 @@ public class BSFormatter {
}
public String getDirectionBothSides(Offer.Direction direction) {
return direction == Offer.Direction.BUY ? "Offerer as bitcoin buyer / Taker as bitcoin seller" : "Offerer as bitcoin seller / Taker as bitcoin buyer";
return direction == Offer.Direction.BUY ? "Offerer as bitcoin buyer / Taker as bitcoin seller" :
"Offerer as bitcoin seller / Taker as bitcoin buyer";
}
public String getDirectionForBuyer(boolean isMyOffer) {
return isMyOffer ? "You are buying bitcoin as offerer / Taker is selling bitcoin" : "You are buying bitcoin as taker / Offerer is selling bitcoin";
return isMyOffer ? "You are buying bitcoin as offerer / Taker is selling bitcoin" :
"You are buying bitcoin as taker / Offerer is selling bitcoin";
}
public String getDirectionForSeller(boolean isMyOffer) {
return isMyOffer ? "You are selling bitcoin as offerer / Taker is buying bitcoin" : "You are selling bitcoin as taker / Offerer is buying bitcoin";
return isMyOffer ? "You are selling bitcoin as offerer / Taker is buying bitcoin" :
"You are selling bitcoin as taker / Offerer is buying bitcoin";
}
public String getDirectionForTaker(Offer.Direction direction) {
return direction == Offer.Direction.BUY ? "You are selling bitcoin (take an offer for buying bitcoin)" : "You are buying bitcoin (take an offer for selling bitcoin)";
return direction == Offer.Direction.BUY ? "You are selling bitcoin (take an offer from someone who wants to buy bitcoin)" :
"You are buying bitcoin (take an offer from someone who wants to sell bitcoin)";
}
public String getOfferDirection(Offer.Direction direction) {
return direction == Offer.Direction.BUY ? "Offer for buying bitcoin" : "Offer for selling bitcoin";
return direction == Offer.Direction.BUY ? "Offer for buying bitcoin" :
"Offer for selling bitcoin";
}
public String getRole(boolean isBuyerOffererAndSellerTaker, boolean isOfferer) {