Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI improvements #2215

Merged
merged 7 commits into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ market.trades.tooltip.candle.date=Date:

offerbook.createOffer=Create offer
offerbook.takeOffer=Take offer
offerbook.takeOfferToBuy=Take offer to buy {0}
offerbook.takeOfferToSell=Take offer to sell {0}
offerbook.trader=Trader
offerbook.offerersBankId=Maker''s bank ID (BIC/SWIFT): {0}
offerbook.offerersBankName=Maker''s bank name: {0}
Expand Down Expand Up @@ -2026,6 +2028,9 @@ popup.attention.forTradeWithId=Attention required for trade with ID {0}
popup.roundedFiatValues.headline=New privacy feature: Rounded fiat values
popup.roundedFiatValues.msg=To increase privacy of your trade the {0} amount was rounded.\n\nDepending on the client version you''ll pay or receive either values with decimals or rounded ones.\n\nBoth values do comply from now on with the trade protocol.\n\nAlso be aware that BTC values are changed automatically to match the rounded fiat amount as close as possible.

popup.info.multiplePaymentAccounts.headline=Multiple payment accounts available
popup.info.multiplePaymentAccounts.msg=You have multiple payment accounts available for this offer. Please make sure you've picked the right one.


####################################################################
# Notifications
Expand Down
10 changes: 5 additions & 5 deletions desktop/src/main/java/bisq/desktop/bisq.css
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,11 @@ bg color of non edit textFields: fafafa
}

.jfx-button:hover, .jfx-button:focused {
-fx-background-color: derive(-bs-rd-grey-light, -30%);
-fx-background-color: derive(-bs-rd-grey-light, -10%);
}

.action-button:hover, .action-button:focused {
-fx-background-color: derive(-bs-rd-green-dark, -30%);
-fx-background-color: derive(-bs-rd-green-dark, -10%);
}

.action-button {
Expand Down Expand Up @@ -1718,9 +1718,9 @@ textfield */
-fx-text-fill: -bs-rd-white;
}

#buy-button-big:hover, #buy-button:hover,
#buy-button-big:hover, #buy-button:hover,
#buy-button-big:focused, #buy-button:focused {
-fx-background-color: derive(-bs-buy, -30%);
-fx-background-color: derive(-bs-buy, -10%);
}

#sell-button-big {
Expand All @@ -1736,7 +1736,7 @@ textfield */

#sell-button-big:hover, #sell-button:hover,
#sell-button-big:focused, #sell-button:focused {
-fx-background-color: derive(-bs-sell, -30%);
-fx-background-color: derive(-bs-sell, -10%);
}

#sell-button-big.grey-style, #buy-button-big.grey-style,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

<TableView fx:id="tableView" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="selectColumn" minWidth="110" maxWidth="110" sortable="false"/>
<TableColumn fx:id="addressColumn" minWidth="320"/>
<TableColumn fx:id="balanceColumn" minWidth="150"/>
<TableColumn fx:id="confirmationsColumn" minWidth="150"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import bisq.desktop.common.view.ActivatableView;
import bisq.desktop.common.view.FxmlView;
import bisq.desktop.components.AddressTextField;
import bisq.desktop.components.AutoTooltipButton;
import bisq.desktop.components.AutoTooltipLabel;
import bisq.desktop.components.HyperlinkWithIcon;
import bisq.desktop.components.InputTextField;
Expand Down Expand Up @@ -98,7 +97,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
@FXML
TableView<DepositListItem> tableView;
@FXML
TableColumn<DepositListItem, DepositListItem> selectColumn, addressColumn, balanceColumn, confirmationsColumn, usageColumn;
TableColumn<DepositListItem, DepositListItem> addressColumn, balanceColumn, confirmationsColumn, usageColumn;
private ImageView qrCodeImageView;
private AddressTextField addressTextField;
private Button generateNewAddressButton;
Expand Down Expand Up @@ -134,7 +133,6 @@ private DepositView(BtcWalletService walletService,
public void initialize() {

paymentLabelString = Res.get("funds.deposit.fundBisqWallet");
selectColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.select")));
addressColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.address")));
balanceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode())));
confirmationsColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.confirmations")));
Expand All @@ -152,7 +150,6 @@ public void initialize() {
}
};

setSelectColumnCellFactory();
setAddressColumnCellFactory();
setBalanceColumnCellFactory();
setUsageColumnCellFactory();
Expand Down Expand Up @@ -342,42 +339,8 @@ public void updateItem(final DepositListItem item, boolean empty) {
});
}

private void setSelectColumnCellFactory() {
selectColumn.getStyleClass().add("first-column");
selectColumn.setCellValueFactory((addressListItem) ->
new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
selectColumn.setCellFactory(
new Callback<>() {

@Override
public TableCell<DepositListItem, DepositListItem> call(TableColumn<DepositListItem,
DepositListItem> column) {
return new TableCell<>() {
Button button;

@Override
public void updateItem(final DepositListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
if (button == null) {
button = new AutoTooltipButton(Res.get("shared.select"));
setGraphic(button);
}
button.setOnAction(e -> tableView.getSelectionModel().select(item));
} else {
setGraphic(null);
if (button != null) {
button.setOnAction(null);
button = null;
}
}
}
};
}
});
}

private void setAddressColumnCellFactory() {
addressColumn.getStyleClass().add("first-column");
addressColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));

addressColumn.setCellFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public void initialize() {

tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
tableView.setPlaceholder(new AutoTooltipLabel(Res.get("funds.tx.noTxAvailable")));
tableView.getStyleClass().add("large-rows");

setDateColumnCellFactory();
setDetailsColumnCellFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public SpreadView(SpreadViewModel model, BSFormatter formatter) {
@Override
public void initialize() {
tableView = new TableView<>();
tableView.getStyleClass().add("large-rows");

int gridRow = 0;
GridPane.setRowIndex(tableView, gridRow);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

import bisq.core.alert.PrivateNotificationManager;
import bisq.core.app.AppOptionKeys;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.FiatCurrency;
import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
Expand Down Expand Up @@ -784,7 +785,7 @@ public void updateItem(final OfferBookListItem item, boolean empty) {
private TableColumn<OfferBookListItem, OfferBookListItem> getActionColumn() {
TableColumn<OfferBookListItem, OfferBookListItem> column = new AutoTooltipTableColumn<>(Res.get("shared.actions")) {
{
setMinWidth(80);
setMinWidth(200);
setSortable(false);
}
};
Expand All @@ -803,8 +804,8 @@ public TableCell<OfferBookListItem, OfferBookListItem> call(TableColumn<OfferBoo

{
button.setGraphic(iconView);
button.setMinWidth(130);
button.setMaxWidth(130);
button.setMinWidth(200);
button.setMaxWidth(200);
button.setGraphicTextGap(10);
}

Expand Down Expand Up @@ -870,7 +871,15 @@ public void updateItem(final OfferBookListItem newItem, boolean empty) {
iconView.setId(isSellOffer ? "image-buy-white" : "image-sell-white");
button.setId(isSellOffer ? "buy-button" : "sell-button");
button.setStyle("-fx-text-fill: white;"); // does not take the font colors sometimes from the style
title = Res.get("offerbook.takeOffer");
if (isSellOffer) {
title = CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
Res.get("offerbook.takeOfferToBuy", offer.getOfferPayload().getBaseCurrencyCode()) :
Res.get("offerbook.takeOfferToSell", offer.getCurrencyCode());
} else {
title = CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
Res.get("offerbook.takeOfferToSell", offer.getOfferPayload().getBaseCurrencyCode()) :
Res.get("offerbook.takeOfferToBuy", offer.getCurrencyCode());
}
button.setTooltip(new Tooltip(Res.get("offerbook.takeOfferButton.tooltip", model.getDirectionLabelTooltip(offer))));
button.setOnAction(e -> onTakeOffer(offer));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,17 @@ protected void activate() {
volumeDescriptionLabel.setText(model.volumeDescriptionLabel.get());

if (model.getPossiblePaymentAccounts().size() > 1) {

new Popup<>().headLine(Res.get("popup.info.multiplePaymentAccounts.headline"))
.information(Res.get("popup.info.multiplePaymentAccounts.msg"))
.dontShowAgainId("MultiplePaymentAccountsAvailableWarning")
.show();

PaymentAccount lastPaymentAccount = model.getLastSelectedPaymentAccount();
paymentAccountsComboBox.setItems(model.getPossiblePaymentAccounts());
paymentAccountsComboBox.getSelectionModel().select(lastPaymentAccount);
model.onPaymentAccountSelected(lastPaymentAccount);
paymentAccountTitledGroupBg.setText(Res.get("shared.selectTradingAccount"));

// TODO if we have multiple payment accounts we should show some info/warning to
// make sure the user has selected the account he wants to use.
// To use a popup is not recommended as we have already 3 popups at the first time (if user has not clicked
// don't show again).
// @Christoph Maybe a similar warn triangle as used in create offer might work?
}

balanceTextField.setTargetAmount(model.dataModel.getTotalToPayAsCoin().get());
Expand Down Expand Up @@ -484,6 +484,10 @@ private void onShowPayFundsScreen() {

model.onShowPayFundsScreen();

paymentAccountsComboBox.setMouseTransparent(true);
paymentAccountsComboBox.setDisable(true);
paymentAccountsComboBox.setFocusTraversable(false);

amountTextField.setMouseTransparent(true);
amountTextField.setDisable(false);
amountTextField.setFocusTraversable(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import bisq.desktop.main.overlays.Overlay;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.Layout;
import bisq.desktop.util.Transitions;

import bisq.core.btc.wallet.WalletsManager;
Expand Down Expand Up @@ -189,7 +190,7 @@ protected void setupKeyHandler(Scene scene) {
}

private void addInputFields() {
passwordTextField = addPasswordTextField(gridPane, ++rowIndex, Res.get("password.enterPassword"));
passwordTextField = addPasswordTextField(gridPane, ++rowIndex, Res.get("password.enterPassword"), Layout.FLOATING_LABEL_DISTANCE);
GridPane.setColumnSpan(passwordTextField, 1);
GridPane.setHalignment(passwordTextField, HPos.LEFT);
changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(!passwordTextField.validate());
Expand Down Expand Up @@ -247,7 +248,7 @@ protected void addButtons() {

HBox hBox = new HBox();
hBox.setMinWidth(560);
hBox.setPadding(new Insets(15, 0, 0, 0));
hBox.setPadding(new Insets(0, 0, 0, 0));
hBox.setSpacing(10);
GridPane.setRowIndex(hBox, ++rowIndex);
hBox.setAlignment(Pos.CENTER_LEFT);
Expand Down