mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-10 15:40:22 -04:00
Improve UIs (setting, main)
This commit is contained in:
parent
c2dbd55e77
commit
65ad9aa709
9 changed files with 32 additions and 31 deletions
|
@ -73,7 +73,7 @@ import static io.bitsquare.app.BitsquareEnvironment.APP_NAME_KEY;
|
||||||
public class BitsquareApp extends Application {
|
public class BitsquareApp extends Application {
|
||||||
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
|
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
|
||||||
|
|
||||||
public static final boolean DEV_MODE = false;
|
public static final boolean DEV_MODE = true;
|
||||||
public static final boolean IS_RELEASE_VERSION = !DEV_MODE && true;
|
public static final boolean IS_RELEASE_VERSION = !DEV_MODE && true;
|
||||||
|
|
||||||
private static Environment env;
|
private static Environment env;
|
||||||
|
|
|
@ -74,11 +74,6 @@ bg color of non edit textFields: fafafa
|
||||||
-fx-background: #bbb;
|
-fx-background: #bbb;
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer-bitcoin-network-label {
|
|
||||||
-fx-text-fill: -fx-accent;
|
|
||||||
-fx-font-size: 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
#headline-label {
|
#headline-label {
|
||||||
-fx-font-weight: bold;
|
-fx-font-weight: bold;
|
||||||
-fx-font-size: 18;
|
-fx-font-size: 18;
|
||||||
|
|
|
@ -350,17 +350,16 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||||
blockchainSyncIndicator.progressProperty().bind(model.blockchainSyncProgress);
|
blockchainSyncIndicator.progressProperty().bind(model.blockchainSyncProgress);
|
||||||
|
|
||||||
Label bitcoinNetworkLabel = new Label();
|
Label bitcoinNetworkLabel = new Label();
|
||||||
bitcoinNetworkLabel.setId("footer-bitcoin-network-label");
|
bitcoinNetworkLabel.setText("/ Bitcoin network: " + model.bitcoinNetworkAsString);
|
||||||
bitcoinNetworkLabel.setText(model.bitcoinNetworkAsString);
|
|
||||||
|
|
||||||
model.walletServiceErrorMsg.addListener((ov, oldValue, newValue) -> {
|
model.walletServiceErrorMsg.addListener((ov, oldValue, newValue) -> {
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
bitcoinNetworkLabel.setId("splash-error-state-msg");
|
bitcoinNetworkLabel.setId("splash-error-state-msg");
|
||||||
bitcoinNetworkLabel.setText("Not connected");
|
bitcoinNetworkLabel.setText("/ Bitcoin network: Not connected");
|
||||||
openBTCConnectionErrorPopup(newValue);
|
openBTCConnectionErrorPopup(newValue);
|
||||||
} else {
|
} else {
|
||||||
bitcoinNetworkLabel.setId("footer-bitcoin-network-label");
|
bitcoinNetworkLabel.setId("footer-bitcoin-network-label");
|
||||||
bitcoinNetworkLabel.setText(model.bitcoinNetworkAsString);
|
bitcoinNetworkLabel.setText("/ Bitcoin network: " + model.bitcoinNetworkAsString);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -368,8 +367,6 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||||
if ((double) newValue >= 1) {
|
if ((double) newValue >= 1) {
|
||||||
blockchainSyncIndicator.setVisible(false);
|
blockchainSyncIndicator.setVisible(false);
|
||||||
blockchainSyncIndicator.setManaged(false);
|
blockchainSyncIndicator.setManaged(false);
|
||||||
blockchainSyncLabel.setVisible(false);
|
|
||||||
blockchainSyncLabel.setManaged(false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -252,7 +252,7 @@ class MainViewModel implements ViewModel {
|
||||||
log.debug("Bitcoin peers " + newValue);
|
log.debug("Bitcoin peers " + newValue);
|
||||||
numBTCPeers = (int) newValue;
|
numBTCPeers = (int) newValue;
|
||||||
numBTCPeersAsString.set(String.valueOf(newValue) + " peers");
|
numBTCPeersAsString.set(String.valueOf(newValue) + " peers");
|
||||||
if (blockchainSyncProgress.get() >= 1 && numBTCPeers > 1)
|
if (blockchainSyncProgress.get() >= 1 && numBTCPeers > 0)
|
||||||
blockchainSyncInfoFooter.set("Bitcoin network: Peers: " + numBTCPeers);
|
blockchainSyncInfoFooter.set("Bitcoin network: Peers: " + numBTCPeers);
|
||||||
|
|
||||||
/* if ((int) newValue < 1) {
|
/* if ((int) newValue < 1) {
|
||||||
|
@ -591,6 +591,7 @@ class MainViewModel implements ViewModel {
|
||||||
|
|
||||||
blockchainSyncInfo.set("Blockchain synchronization complete." + nrOfPeers);
|
blockchainSyncInfo.set("Blockchain synchronization complete." + nrOfPeers);
|
||||||
blockchainSyncIconId.set("image-connection-synced");
|
blockchainSyncIconId.set("image-connection-synced");
|
||||||
|
blockchainSyncInfoFooter.set("Bitcoin network: Peers: " + numBTCPeers);
|
||||||
} else if (value > 0.0) {
|
} else if (value > 0.0) {
|
||||||
// We stop as soon the download started the timeout
|
// We stop as soon the download started the timeout
|
||||||
stopBlockchainSyncTimeout();
|
stopBlockchainSyncTimeout();
|
||||||
|
|
|
@ -51,8 +51,10 @@ public class AccountSettingsView extends ActivatableViewAndModel {
|
||||||
private MenuItem password, seedWords, backup, paymentAccount, arbitratorSelection;
|
private MenuItem password, seedWords, backup, paymentAccount, arbitratorSelection;
|
||||||
private Navigation.Listener listener;
|
private Navigation.Listener listener;
|
||||||
|
|
||||||
@FXML private VBox leftVBox;
|
@FXML
|
||||||
@FXML private AnchorPane content;
|
private VBox leftVBox;
|
||||||
|
@FXML
|
||||||
|
private AnchorPane content;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AccountSettingsView(CachingViewLoader viewLoader, Navigation navigation) {
|
private AccountSettingsView(CachingViewLoader viewLoader, Navigation navigation) {
|
||||||
|
@ -77,7 +79,7 @@ public class AccountSettingsView extends ActivatableViewAndModel {
|
||||||
arbitratorSelection = new MenuItem(navigation, toggleGroup, "Arbitrator selection", ArbitratorSelectionView.class, AwesomeIcon.USER_MD);
|
arbitratorSelection = new MenuItem(navigation, toggleGroup, "Arbitrator selection", ArbitratorSelectionView.class, AwesomeIcon.USER_MD);
|
||||||
// registration = new MenuItem(navigation, toggleGroup, "Renew your account", RegistrationView.class, AwesomeIcon.BRIEFCASE);
|
// registration = new MenuItem(navigation, toggleGroup, "Renew your account", RegistrationView.class, AwesomeIcon.BRIEFCASE);
|
||||||
|
|
||||||
leftVBox.getChildren().addAll(password, seedWords, backup, paymentAccount, arbitratorSelection);
|
leftVBox.getChildren().addAll(arbitratorSelection, paymentAccount, password, seedWords, backup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -85,9 +87,8 @@ public class AccountSettingsView extends ActivatableViewAndModel {
|
||||||
navigation.addListener(listener);
|
navigation.addListener(listener);
|
||||||
ViewPath viewPath = navigation.getCurrentPath();
|
ViewPath viewPath = navigation.getCurrentPath();
|
||||||
if (viewPath.size() == 3 && viewPath.indexOf(AccountSettingsView.class) == 2) {
|
if (viewPath.size() == 3 && viewPath.indexOf(AccountSettingsView.class) == 2) {
|
||||||
navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, PasswordView.class);
|
navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, ArbitratorSelectionView.class);
|
||||||
}
|
} else if (viewPath.size() == 4 && viewPath.indexOf(AccountSettingsView.class) == 2) {
|
||||||
else if (viewPath.size() == 4 && viewPath.indexOf(AccountSettingsView.class) == 2) {
|
|
||||||
loadView(viewPath.get(3));
|
loadView(viewPath.get(3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,8 +149,7 @@ class MenuItem extends ToggleButton {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
setId("account-settings-item-background-selected");
|
setId("account-settings-item-background-selected");
|
||||||
icon.setTextFill(Colors.BLUE);
|
icon.setTextFill(Colors.BLUE);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
setId("account-settings-item-background-active");
|
setId("account-settings-item-background-active");
|
||||||
icon.setTextFill(Paint.valueOf("#333"));
|
icon.setTextFill(Paint.valueOf("#333"));
|
||||||
}
|
}
|
||||||
|
@ -159,8 +159,7 @@ class MenuItem extends ToggleButton {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
setId("account-settings-item-background-disabled");
|
setId("account-settings-item-background-disabled");
|
||||||
icon.setTextFill(Paint.valueOf("#ccc"));
|
icon.setTextFill(Paint.valueOf("#ccc"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
setId("account-settings-item-background-active");
|
setId("account-settings-item-background-active");
|
||||||
icon.setTextFill(Paint.valueOf("#333"));
|
icon.setTextFill(Paint.valueOf("#333"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@
|
||||||
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
|
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
|
||||||
xmlns:fx="http://javafx.com/fxml">
|
xmlns:fx="http://javafx.com/fxml">
|
||||||
|
|
||||||
<Tab fx:id="preferencesTab" text="Preferences" closable="false"/>
|
|
||||||
<Tab fx:id="networkSettingsTab" text="Network info" closable="false"/>
|
<Tab fx:id="networkSettingsTab" text="Network info" closable="false"/>
|
||||||
|
<Tab fx:id="preferencesTab" text="Preferences" closable="false"/>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
|
|
@ -52,13 +52,14 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
addTitledGroupBg(root, gridRow, 9, "Preferences");
|
addTitledGroupBg(root, gridRow, 3, "Preferences");
|
||||||
|
tradeCurrencyComboBox = addLabelComboBox(root, gridRow, "Preferred currency:", Layout.FIRST_ROW_DISTANCE).second;
|
||||||
tradeCurrencyComboBox = addLabelComboBox(root, ++gridRow, "Preferred currency:", Layout.FIRST_ROW_DISTANCE).second;
|
|
||||||
languageComboBox = addLabelComboBox(root, ++gridRow, "Language:").second;
|
languageComboBox = addLabelComboBox(root, ++gridRow, "Language:").second;
|
||||||
// btcDenominationComboBox = addLabelComboBox(root, gridRow, "Bitcoin denomination:", Layout.FIRST_ROW_DISTANCE).second;
|
// btcDenominationComboBox = addLabelComboBox(root, ++gridRow, "Bitcoin denomination:").second;
|
||||||
blockExplorerComboBox = addLabelComboBox(root, ++gridRow, "Bitcoin block explorer:").second;
|
blockExplorerComboBox = addLabelComboBox(root, ++gridRow, "Bitcoin block explorer:").second;
|
||||||
useAnimationsCheckBox = addLabelCheckBox(root, ++gridRow, "Use animations:", "").second;
|
|
||||||
|
addTitledGroupBg(root, ++gridRow, 5, "Display options", Layout.GROUP_DISTANCE);
|
||||||
|
useAnimationsCheckBox = addLabelCheckBox(root, gridRow, "Use animations:", "", Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
|
||||||
useEffectsCheckBox = addLabelCheckBox(root, ++gridRow, "Use effects:", "").second;
|
useEffectsCheckBox = addLabelCheckBox(root, ++gridRow, "Use effects:", "").second;
|
||||||
showPlaceOfferConfirmationCheckBox = addLabelCheckBox(root, ++gridRow, "Show confirmation at place offer:", "").second;
|
showPlaceOfferConfirmationCheckBox = addLabelCheckBox(root, ++gridRow, "Show confirmation at place offer:", "").second;
|
||||||
showTakeOfferConfirmationCheckBox = addLabelCheckBox(root, ++gridRow, "Show confirmation at take offer:", "").second;
|
showTakeOfferConfirmationCheckBox = addLabelCheckBox(root, ++gridRow, "Show confirmation at take offer:", "").second;
|
||||||
|
|
|
@ -176,6 +176,8 @@ public class NetworkSettingsView extends ActivatableViewAndModel<GridPane, Activ
|
||||||
preferences.setBitcoinNetwork(netWorkComboBox.getSelectionModel().getSelectedItem());
|
preferences.setBitcoinNetwork(netWorkComboBox.getSelectionModel().getSelectedItem());
|
||||||
UserThread.runAfter(() -> BitsquareApp.shutDownHandler.run(), 1);
|
UserThread.runAfter(() -> BitsquareApp.shutDownHandler.run(), 1);
|
||||||
})
|
})
|
||||||
|
.actionButtonText("Shut down")
|
||||||
|
.closeButtonText("Cancel")
|
||||||
.onClose(() -> netWorkComboBox.getSelectionModel().select(preferences.getBitcoinNetwork()))
|
.onClose(() -> netWorkComboBox.getSelectionModel().select(preferences.getBitcoinNetwork()))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,11 +358,17 @@ public class FormBuilder {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public static Tuple2<Label, CheckBox> addLabelCheckBox(GridPane gridPane, int rowIndex, String title, String checkBoxTitle) {
|
public static Tuple2<Label, CheckBox> addLabelCheckBox(GridPane gridPane, int rowIndex, String title, String checkBoxTitle) {
|
||||||
|
return addLabelCheckBox(gridPane, rowIndex, title, checkBoxTitle, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Tuple2<Label, CheckBox> addLabelCheckBox(GridPane gridPane, int rowIndex, String title, String checkBoxTitle, double top) {
|
||||||
Label label = addLabel(gridPane, rowIndex, title, -3);
|
Label label = addLabel(gridPane, rowIndex, title, -3);
|
||||||
|
GridPane.setMargin(label, new Insets(top, 0, 0, 0));
|
||||||
|
|
||||||
CheckBox checkBox = new CheckBox(checkBoxTitle);
|
CheckBox checkBox = new CheckBox(checkBoxTitle);
|
||||||
GridPane.setRowIndex(checkBox, rowIndex);
|
GridPane.setRowIndex(checkBox, rowIndex);
|
||||||
GridPane.setColumnIndex(checkBox, 1);
|
GridPane.setColumnIndex(checkBox, 1);
|
||||||
|
GridPane.setMargin(checkBox, new Insets(top, 0, 0, 0));
|
||||||
gridPane.getChildren().add(checkBox);
|
gridPane.getChildren().add(checkBox);
|
||||||
|
|
||||||
return new Tuple2<>(label, checkBox);
|
return new Tuple2<>(label, checkBox);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue