diff --git a/gui/src/main/java/io/bisq/gui/app/BisqApp.java b/gui/src/main/java/io/bisq/gui/app/BisqApp.java index c551fb3ee0c..e913ee9251c 100644 --- a/gui/src/main/java/io/bisq/gui/app/BisqApp.java +++ b/gui/src/main/java/io/bisq/gui/app/BisqApp.java @@ -60,6 +60,7 @@ import io.bisq.gui.common.view.View; import io.bisq.gui.common.view.ViewLoader; import io.bisq.gui.common.view.guice.InjectorViewFactory; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.main.MainView; import io.bisq.gui.main.debug.DebugView; import io.bisq.gui.main.overlays.popups.Popup; @@ -398,7 +399,7 @@ private void showDebugWindow() { } private void showFPSWindow() { - Label label = new Label(); + Label label = new AutoTooltipLabel(); EventStreams.animationTicks() .latestN(100) .map(ticks -> { diff --git a/gui/src/main/java/io/bisq/gui/components/AddressTextField.java b/gui/src/main/java/io/bisq/gui/components/AddressTextField.java index ac83ee12b09..812852939d3 100644 --- a/gui/src/main/java/io/bisq/gui/components/AddressTextField.java +++ b/gui/src/main/java/io/bisq/gui/components/AddressTextField.java @@ -71,14 +71,14 @@ public AddressTextField() { //TODO app wide focus //focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus()); - Label extWalletIcon = new Label(); + Label extWalletIcon = new AutoTooltipLabel(); extWalletIcon.setLayoutY(3); extWalletIcon.getStyleClass().addAll("icon", "highlight"); extWalletIcon.setTooltip(new Tooltip(tooltipText)); AwesomeDude.setIcon(extWalletIcon, AwesomeIcon.SIGNIN); extWalletIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet)); - Label copyIcon = new Label(); + Label copyIcon = new AutoTooltipLabel(); copyIcon.setLayoutY(3); copyIcon.getStyleClass().addAll("icon", "highlight"); Tooltip.install(copyIcon, new Tooltip(Res.get("addressTextField.copyToClipboard"))); diff --git a/gui/src/main/java/io/bisq/gui/components/AddressWithIconAndDirection.java b/gui/src/main/java/io/bisq/gui/components/AddressWithIconAndDirection.java index 33ec25d3b2b..eea0aca51d3 100644 --- a/gui/src/main/java/io/bisq/gui/components/AddressWithIconAndDirection.java +++ b/gui/src/main/java/io/bisq/gui/components/AddressWithIconAndDirection.java @@ -20,7 +20,7 @@ public class AddressWithIconAndDirection extends AnchorPane { private final Label openLinkIcon; public AddressWithIconAndDirection(String text, String address, AwesomeIcon awesomeIcon, boolean received) { - Label directionIcon = new Label(); + Label directionIcon = new AutoTooltipLabel(); directionIcon.setLayoutY(3); directionIcon.getStyleClass().add("icon"); directionIcon.getStyleClass().add(received ? "received-funds-icon" : "sent-funds-icon"); @@ -29,7 +29,7 @@ public AddressWithIconAndDirection(String text, String address, AwesomeIcon awes HBox hBox = new HBox(); hBox.setSpacing(-1); - Label label = new Label(text); + Label label = new AutoTooltipLabel(text); label.setMouseTransparent(true); HBox.setMargin(label, new Insets(4, 0, 0, 0)); HBox.setHgrow(label, Priority.ALWAYS); @@ -44,7 +44,7 @@ public AddressWithIconAndDirection(String text, String address, AwesomeIcon awes hBox.getChildren().addAll(label, hyperlink); - openLinkIcon = new Label(); + openLinkIcon = new AutoTooltipLabel(); openLinkIcon.setLayoutY(3); openLinkIcon.getStyleClass().addAll("icon", "highlight"); openLinkIcon.setOpacity(0.7); diff --git a/gui/src/main/java/io/bisq/gui/components/AutoTooltipButton.java b/gui/src/main/java/io/bisq/gui/components/AutoTooltipButton.java new file mode 100644 index 00000000000..4a8ba390a83 --- /dev/null +++ b/gui/src/main/java/io/bisq/gui/components/AutoTooltipButton.java @@ -0,0 +1,40 @@ +package io.bisq.gui.components; + +import com.sun.javafx.scene.control.skin.ButtonSkin; +import javafx.scene.Node; +import javafx.scene.control.Button; +import javafx.scene.control.Skin; + +import static io.bisq.gui.components.TooltipUtil.showTooltipIfTruncated; + +public class AutoTooltipButton extends Button { + + public AutoTooltipButton() { + super(); + } + + public AutoTooltipButton(String text) { + super(text); + } + + public AutoTooltipButton(String text, Node graphic) { + super(text, graphic); + } + + @Override + protected Skin createDefaultSkin() { + return new AutoTooltipButtonSkin(this); + } + + private class AutoTooltipButtonSkin extends ButtonSkin { + public AutoTooltipButtonSkin(Button button) { + super(button); + } + + @Override + protected void layoutChildren(double x, double y, double w, double h) { + super.layoutChildren(x, y, w, h); + showTooltipIfTruncated(this, getSkinnable()); + } + } +} diff --git a/gui/src/main/java/io/bisq/gui/components/AutoTooltipLabel.java b/gui/src/main/java/io/bisq/gui/components/AutoTooltipLabel.java new file mode 100644 index 00000000000..0ef27e02c27 --- /dev/null +++ b/gui/src/main/java/io/bisq/gui/components/AutoTooltipLabel.java @@ -0,0 +1,37 @@ +package io.bisq.gui.components; + +import com.sun.javafx.scene.control.skin.LabelSkin; +import javafx.scene.Node; +import javafx.scene.control.*; +import javafx.scene.text.Text; + +import static io.bisq.gui.components.TooltipUtil.showTooltipIfTruncated; + +public class AutoTooltipLabel extends Label { + + public AutoTooltipLabel(){ + super(); + } + + public AutoTooltipLabel(String text) { + super(text); + } + + @Override + protected Skin createDefaultSkin() { + return new AutoTooltipLabelSkin(this); + } + + private class AutoTooltipLabelSkin extends LabelSkin { + + public AutoTooltipLabelSkin(Label label) { + super(label); + } + + @Override + protected void layoutChildren(double x, double y, double w, double h) { + super.layoutChildren(x, y, w, h); + showTooltipIfTruncated(this, getSkinnable()); + } + } +} diff --git a/gui/src/main/java/io/bisq/gui/components/AutoTooltipTableColumn.java b/gui/src/main/java/io/bisq/gui/components/AutoTooltipTableColumn.java new file mode 100644 index 00000000000..a0e1010b7a7 --- /dev/null +++ b/gui/src/main/java/io/bisq/gui/components/AutoTooltipTableColumn.java @@ -0,0 +1,12 @@ +package io.bisq.gui.components; + +import javafx.scene.control.TableColumn; + +public class AutoTooltipTableColumn extends TableColumn { + + public AutoTooltipTableColumn(String text) { + super(); + + setGraphic(new AutoTooltipLabel(text)); + } +} diff --git a/gui/src/main/java/io/bisq/gui/components/AutoTooltipToggleButton.java b/gui/src/main/java/io/bisq/gui/components/AutoTooltipToggleButton.java new file mode 100644 index 00000000000..73306d6a291 --- /dev/null +++ b/gui/src/main/java/io/bisq/gui/components/AutoTooltipToggleButton.java @@ -0,0 +1,40 @@ +package io.bisq.gui.components; + +import com.sun.javafx.scene.control.skin.ToggleButtonSkin; +import javafx.scene.Node; +import javafx.scene.control.Skin; +import javafx.scene.control.ToggleButton; + +import static io.bisq.gui.components.TooltipUtil.showTooltipIfTruncated; + +public class AutoTooltipToggleButton extends ToggleButton { + + public AutoTooltipToggleButton() { + super(); + } + + public AutoTooltipToggleButton(String text) { + super(text); + } + + public AutoTooltipToggleButton(String text, Node graphic) { + super(text, graphic); + } + + @Override + protected Skin createDefaultSkin() { + return new AutoTooltipToggleButtonSkin(this); + } + + private class AutoTooltipToggleButtonSkin extends ToggleButtonSkin { + public AutoTooltipToggleButtonSkin(ToggleButton toggleButton) { + super(toggleButton); + } + + @Override + protected void layoutChildren(double x, double y, double w, double h) { + super.layoutChildren(x, y, w, h); + showTooltipIfTruncated(this, getSkinnable()); + } + } +} diff --git a/gui/src/main/java/io/bisq/gui/components/BsqAddressTextField.java b/gui/src/main/java/io/bisq/gui/components/BsqAddressTextField.java index b8520de37e7..18cbdc24023 100644 --- a/gui/src/main/java/io/bisq/gui/components/BsqAddressTextField.java +++ b/gui/src/main/java/io/bisq/gui/components/BsqAddressTextField.java @@ -73,7 +73,7 @@ public BsqAddressTextField() { //focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus()); - Label copyIcon = new Label(); + Label copyIcon = new AutoTooltipLabel(); copyIcon.setLayoutY(3); copyIcon.getStyleClass().addAll("icon", "highlight"); copyIcon.setTooltip(new Tooltip(Res.get("addressTextField.copyToClipboard"))); diff --git a/gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java b/gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java index 686b06da23e..9d58998d689 100644 --- a/gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java +++ b/gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java @@ -28,7 +28,7 @@ public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon, boolean isCentere setSpacing(5); hyperlink = new Hyperlink(text); - icon = new Label(); + icon = new AutoTooltipLabel(); icon.getStyleClass().addAll("icon", "highlight"); AwesomeDude.setIcon(icon, awesomeIcon); icon.setMinWidth(20); diff --git a/gui/src/main/java/io/bisq/gui/components/InfoDisplay.java b/gui/src/main/java/io/bisq/gui/components/InfoDisplay.java index 613906868c7..b099ad1a215 100644 --- a/gui/src/main/java/io/bisq/gui/components/InfoDisplay.java +++ b/gui/src/main/java/io/bisq/gui/components/InfoDisplay.java @@ -68,7 +68,7 @@ public InfoDisplay() { GridPane.setMargin(icon, new Insets(-2, 0, 0, 0)); GridPane.setRowSpan(icon, 2); - label = new Label(); + label = new AutoTooltipLabel(); label.textProperty().bind(text); label.setTextOverrun(OverrunStyle.WORD_ELLIPSIS); // width is set a frame later so we hide it first @@ -79,7 +79,7 @@ public InfoDisplay() { // We need that to know if we have a wrapping or not. // Did not find a way to get that from the API. - Label testLabel = new Label(); + Label testLabel = new AutoTooltipLabel(); testLabel.textProperty().bind(text); textFlow = new TextFlow(); diff --git a/gui/src/main/java/io/bisq/gui/components/InputTextField.java b/gui/src/main/java/io/bisq/gui/components/InputTextField.java index 7a5a10d166f..af17e1e3883 100644 --- a/gui/src/main/java/io/bisq/gui/components/InputTextField.java +++ b/gui/src/main/java/io/bisq/gui/components/InputTextField.java @@ -172,7 +172,7 @@ private Point2D getErrorPopupPosition() { private static void createErrorPopOver(String errorMessage) { - Label errorLabel = new Label(errorMessage); + Label errorLabel = new AutoTooltipLabel(errorMessage); errorLabel.setId("validation-error"); errorLabel.setPadding(new Insets(0, 10, 0, 10)); errorLabel.setOnMouseClicked(e -> hideErrorMessageDisplay()); @@ -183,4 +183,4 @@ private static void createErrorPopOver(String errorMessage) { errorMessageDisplay.setArrowIndent(5); } -} \ No newline at end of file +} diff --git a/gui/src/main/java/io/bisq/gui/components/PasswordTextField.java b/gui/src/main/java/io/bisq/gui/components/PasswordTextField.java index dd6ec36c8b8..3e43faae59c 100644 --- a/gui/src/main/java/io/bisq/gui/components/PasswordTextField.java +++ b/gui/src/main/java/io/bisq/gui/components/PasswordTextField.java @@ -159,7 +159,7 @@ private Point2D getErrorPopupPosition() { private static void createErrorPopOver(String errorMessage) { - Label errorLabel = new Label(errorMessage); + Label errorLabel = new AutoTooltipLabel(errorMessage); errorLabel.setId("validation-error"); errorLabel.setPadding(new Insets(0, 10, 0, 10)); errorLabel.setOnMouseClicked(e -> hideErrorMessageDisplay()); @@ -170,4 +170,4 @@ private static void createErrorPopOver(String errorMessage) { errorMessageDisplay.setArrowIndent(5); } -} \ No newline at end of file +} diff --git a/gui/src/main/java/io/bisq/gui/components/PeerInfoIcon.java b/gui/src/main/java/io/bisq/gui/components/PeerInfoIcon.java index f2824fad833..00985cced36 100644 --- a/gui/src/main/java/io/bisq/gui/components/PeerInfoIcon.java +++ b/gui/src/main/java/io/bisq/gui/components/PeerInfoIcon.java @@ -132,7 +132,7 @@ public PeerInfoIcon(NodeAddress nodeAddress, numTradesPane.setMouseTransparent(true); ImageView numTradesCircle = new ImageView(); numTradesCircle.setId("image-green_circle"); - numTradesLabel = new Label(); + numTradesLabel = new AutoTooltipLabel(); numTradesLabel.relocate(5, 1); numTradesLabel.setId("ident-num-label"); numTradesPane.getChildren().addAll(numTradesCircle, numTradesLabel); @@ -142,7 +142,7 @@ public PeerInfoIcon(NodeAddress nodeAddress, tagPane.setMouseTransparent(true); ImageView tagCircle = new ImageView(); tagCircle.setId("image-blue_circle"); - tagLabel = new Label(); + tagLabel = new AutoTooltipLabel(); tagLabel.relocate(5, 1); tagLabel.setId("ident-num-label"); tagPane.getChildren().addAll(tagCircle, tagLabel); diff --git a/gui/src/main/java/io/bisq/gui/components/TableGroupHeadline.java b/gui/src/main/java/io/bisq/gui/components/TableGroupHeadline.java index 10f3ce86564..aed27fccd94 100644 --- a/gui/src/main/java/io/bisq/gui/components/TableGroupHeadline.java +++ b/gui/src/main/java/io/bisq/gui/components/TableGroupHeadline.java @@ -51,7 +51,7 @@ public TableGroupHeadline(String title) { bg.prefWidthProperty().bind(widthProperty()); bg.prefHeightProperty().bind(heightProperty()); - label = new Label(); + label = new AutoTooltipLabel(); label.textProperty().bind(text); label.setLayoutX(8); label.setPadding(new Insets(-8, 7, 0, 5)); diff --git a/gui/src/main/java/io/bisq/gui/components/TextFieldWithCopyIcon.java b/gui/src/main/java/io/bisq/gui/components/TextFieldWithCopyIcon.java index 2efbfa76f09..aa940231827 100644 --- a/gui/src/main/java/io/bisq/gui/components/TextFieldWithCopyIcon.java +++ b/gui/src/main/java/io/bisq/gui/components/TextFieldWithCopyIcon.java @@ -40,7 +40,7 @@ public class TextFieldWithCopyIcon extends AnchorPane { /////////////////////////////////////////////////////////////////////////////////////////// public TextFieldWithCopyIcon() { - Label copyIcon = new Label(); + Label copyIcon = new AutoTooltipLabel(); copyIcon.setLayoutY(3); copyIcon.getStyleClass().addAll("icon", "highlight"); copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard"))); diff --git a/gui/src/main/java/io/bisq/gui/components/TitledGroupBg.java b/gui/src/main/java/io/bisq/gui/components/TitledGroupBg.java index d4ed7cfcc38..bb19b9c85e2 100644 --- a/gui/src/main/java/io/bisq/gui/components/TitledGroupBg.java +++ b/gui/src/main/java/io/bisq/gui/components/TitledGroupBg.java @@ -37,7 +37,7 @@ public TitledGroupBg() { GridPane.setMargin(this, new Insets(-10, -10, -10, -10)); GridPane.setColumnSpan(this, 2); - label = new Label(); + label = new AutoTooltipLabel(); label.textProperty().bind(text); label.setLayoutX(8); label.setLayoutY(-8); diff --git a/gui/src/main/java/io/bisq/gui/components/TooltipUtil.java b/gui/src/main/java/io/bisq/gui/components/TooltipUtil.java new file mode 100644 index 00000000000..ca6f6a63a4b --- /dev/null +++ b/gui/src/main/java/io/bisq/gui/components/TooltipUtil.java @@ -0,0 +1,24 @@ +package io.bisq.gui.components; + +import javafx.scene.control.Labeled; +import javafx.scene.control.SkinBase; +import javafx.scene.control.Tooltip; +import javafx.scene.text.Text; + +public class TooltipUtil { + + public static void showTooltipIfTruncated(SkinBase skinBase, Labeled labeled) { + for (Object node : skinBase.getChildren()) { + if (node instanceof Text) { + String displayedText = ((Text) node).getText(); + if (displayedText.equals(labeled.getText())) { + if (labeled.getTooltip() != null) { + labeled.setTooltip(null); + } + } else if (labeled.getText() != null){ + labeled.setTooltip(new Tooltip(labeled.getText())); + } + } + } + } +} diff --git a/gui/src/main/java/io/bisq/gui/components/TxIdTextField.java b/gui/src/main/java/io/bisq/gui/components/TxIdTextField.java index 4adb2d64f89..dddc18f010e 100644 --- a/gui/src/main/java/io/bisq/gui/components/TxIdTextField.java +++ b/gui/src/main/java/io/bisq/gui/components/TxIdTextField.java @@ -73,7 +73,7 @@ public TxIdTextField() { progressIndicatorTooltip = new Tooltip("-"); txConfidenceIndicator.setTooltip(progressIndicatorTooltip); - copyIcon = new Label(); + copyIcon = new AutoTooltipLabel(); copyIcon.setLayoutY(3); copyIcon.getStyleClass().addAll("icon", "highlight"); copyIcon.setTooltip(new Tooltip(Res.get("txIdTextField.copyIcon.tooltip"))); @@ -82,7 +82,7 @@ public TxIdTextField() { Tooltip tooltip = new Tooltip(Res.get("txIdTextField.blockExplorerIcon.tooltip")); - blockExplorerIcon = new Label(); + blockExplorerIcon = new AutoTooltipLabel(); blockExplorerIcon.getStyleClass().addAll("icon", "highlight"); blockExplorerIcon.setTooltip(tooltip); AwesomeDude.setIcon(blockExplorerIcon, AwesomeIcon.EXTERNAL_LINK); diff --git a/gui/src/main/java/io/bisq/gui/main/MainView.java b/gui/src/main/java/io/bisq/gui/main/MainView.java index 0191de8d01a..295ae44eb49 100644 --- a/gui/src/main/java/io/bisq/gui/main/MainView.java +++ b/gui/src/main/java/io/bisq/gui/main/MainView.java @@ -28,6 +28,9 @@ import io.bisq.core.exceptions.BisqException; import io.bisq.gui.Navigation; import io.bisq.gui.common.view.*; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipToggleButton; import io.bisq.gui.components.BusyAnimation; import io.bisq.gui.main.account.AccountView; import io.bisq.gui.main.dao.DaoView; @@ -286,7 +289,7 @@ private Tuple2 getBalanceBox(String text) { textField.setFocusTraversable(false); textField.getStyleClass().add("display-text-field"); - Label label = new Label(text); + Label label = new AutoTooltipLabel(text); label.setId("nav-balance-label"); label.setPadding(new Insets(0, 5, 0, 5)); label.setPrefWidth(textField.getPrefWidth()); @@ -326,7 +329,7 @@ private Tuple2, VBox> getMarketPriceBox() { final ImageView btcAverageIcon = new ImageView(); btcAverageIcon.setId("btcaverage"); - final Button btcAverageIconButton = new Button("", btcAverageIcon); + final Button btcAverageIconButton = new AutoTooltipButton("", btcAverageIcon); btcAverageIconButton.setPadding(new Insets(-1, 0, -1, 0)); btcAverageIconButton.setFocusTraversable(false); btcAverageIconButton.getStyleClass().add("hidden-icon-button"); @@ -350,7 +353,7 @@ private Tuple2, VBox> getMarketPriceBox() { final ImageView poloniexIcon = new ImageView(); poloniexIcon.setId("poloniex"); - final Button poloniexIconButton = new Button("", poloniexIcon); + final Button poloniexIconButton = new AutoTooltipButton("", poloniexIcon); poloniexIconButton.setPadding(new Insets(-3, 0, -3, 0)); poloniexIconButton.setFocusTraversable(false); poloniexIconButton.getStyleClass().add("hidden-icon-button"); @@ -372,7 +375,7 @@ private Tuple2, VBox> getMarketPriceBox() { ); }); - Label label = new Label(Res.get("mainView.marketPrice.provider")); + Label label = new AutoTooltipLabel(Res.get("mainView.marketPrice.provider")); label.setId("nav-balance-label"); label.setPadding(new Insets(0, 5, 0, 2)); @@ -422,7 +425,7 @@ private VBox createSplashScreen() { // createBitcoinInfoBox - btcSplashInfo = new Label(); + btcSplashInfo = new AutoTooltipLabel(); btcSplashInfo.textProperty().bind(model.btcInfo); walletServiceErrorMsgListener = (ov, oldValue, newValue) -> { btcSplashInfo.setId("splash-error-state-msg"); @@ -458,7 +461,7 @@ private VBox createSplashScreen() { // create P2PNetworkBox - splashP2PNetworkLabel = new Label(); + splashP2PNetworkLabel = new AutoTooltipLabel(); splashP2PNetworkLabel.setWrapText(true); splashP2PNetworkLabel.setMaxWidth(500); splashP2PNetworkLabel.setTextAlignment(TextAlignment.CENTER); @@ -478,7 +481,7 @@ private VBox createSplashScreen() { model.p2pNetworkWarnMsg.addListener(splashP2PNetworkErrorMsgListener); - Button showTorNetworkSettingsButton = new Button(Res.get("settings.net.openTorSettingsButton")); + Button showTorNetworkSettingsButton = new AutoTooltipButton(Res.get("settings.net.openTorSettingsButton")); showTorNetworkSettingsButton.setVisible(false); showTorNetworkSettingsButton.setManaged(false); showTorNetworkSettingsButton.setOnAction(e -> { @@ -546,7 +549,7 @@ private AnchorPane createFooter() { setTopAnchor(separator, 0d); // BTC - Label btcInfoLabel = new Label(); + Label btcInfoLabel = new AutoTooltipLabel(); btcInfoLabel.setId("footer-pane"); btcInfoLabel.textProperty().bind(model.btcInfo); @@ -585,7 +588,7 @@ private AnchorPane createFooter() { setBottomAnchor(blockchainSyncBox, 7d); // version - versionLabel = new Label(); + versionLabel = new AutoTooltipLabel(); versionLabel.setId("footer-pane"); versionLabel.setTextAlignment(TextAlignment.CENTER); versionLabel.setAlignment(Pos.BASELINE_CENTER); @@ -608,7 +611,7 @@ private AnchorPane createFooter() { }); // P2P Network - Label p2PNetworkLabel = new Label(); + Label p2PNetworkLabel = new AutoTooltipLabel(); p2PNetworkLabel.setId("footer-pane"); setRightAnchor(p2PNetworkLabel, 33d); setBottomAnchor(p2PNetworkLabel, 7d); @@ -641,7 +644,7 @@ private AnchorPane createFooter() { } private void setupNotificationIcon(Pane buttonHolder) { - Label label = new Label(); + Label label = new AutoTooltipLabel(); label.textProperty().bind(model.numPendingTradesAsString); label.relocate(5, 1); label.setId("nav-alert-label"); @@ -660,7 +663,7 @@ private void setupNotificationIcon(Pane buttonHolder) { } private void setupDisputesIcon(Pane buttonHolder) { - Label label = new Label(); + Label label = new AutoTooltipLabel(); label.textProperty().bind(model.numOpenDisputesAsString); label.relocate(5, 1); label.setId("nav-alert-label"); @@ -678,7 +681,7 @@ private void setupDisputesIcon(Pane buttonHolder) { buttonHolder.getChildren().add(notification); } - private class NavButton extends ToggleButton { + private class NavButton extends AutoTooltipToggleButton { private final Class viewClass; diff --git a/gui/src/main/java/io/bisq/gui/main/account/arbitratorregistration/ArbitratorRegistrationView.java b/gui/src/main/java/io/bisq/gui/main/account/arbitratorregistration/ArbitratorRegistrationView.java index 8fda7ec3d3b..6c73ee8a1e8 100644 --- a/gui/src/main/java/io/bisq/gui/main/account/arbitratorregistration/ArbitratorRegistrationView.java +++ b/gui/src/main/java/io/bisq/gui/main/account/arbitratorregistration/ArbitratorRegistrationView.java @@ -25,6 +25,8 @@ import io.bisq.core.arbitration.Arbitrator; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.main.overlays.popups.Popup; import io.bisq.gui.main.overlays.windows.UnlockArbitrationRegistrationWindow; import io.bisq.gui.util.FormBuilder; @@ -141,9 +143,9 @@ private void buildUI() { @Override public ListCell call(ListView list) { return new ListCell() { - final Label label = new Label(); + final Label label = new AutoTooltipLabel(); final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON); - final Button removeButton = new Button("", icon); + final Button removeButton = new AutoTooltipButton("", icon); final AnchorPane pane = new AnchorPane(label, removeButton); { diff --git a/gui/src/main/java/io/bisq/gui/main/account/content/altcoinaccounts/AltCoinAccountsView.java b/gui/src/main/java/io/bisq/gui/main/account/content/altcoinaccounts/AltCoinAccountsView.java index dd40ddca68c..885429b3539 100644 --- a/gui/src/main/java/io/bisq/gui/main/account/content/altcoinaccounts/AltCoinAccountsView.java +++ b/gui/src/main/java/io/bisq/gui/main/account/content/altcoinaccounts/AltCoinAccountsView.java @@ -29,6 +29,8 @@ import io.bisq.core.payment.payload.PaymentMethod; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.TitledGroupBg; import io.bisq.gui.components.paymentmethods.CryptoCurrencyForm; import io.bisq.gui.components.paymentmethods.PaymentMethodForm; @@ -92,7 +94,7 @@ public void initialize() { if (newValue != null) onSelectAccount(newValue); }; - Label placeholder = new Label(Res.get("shared.noAccountsSetupYet")); + Label placeholder = new AutoTooltipLabel(Res.get("shared.noAccountsSetupYet")); placeholder.setWrapText(true); paymentAccountsListView.setPlaceholder(placeholder); } @@ -208,9 +210,9 @@ private void buildForm() { @Override public ListCell call(ListView list) { return new ListCell() { - final Label label = new Label(); + final Label label = new AutoTooltipLabel(); final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON); - final Button removeButton = new Button("", icon); + final Button removeButton = new AutoTooltipButton("", icon); final AnchorPane pane = new AnchorPane(label, removeButton); { diff --git a/gui/src/main/java/io/bisq/gui/main/account/content/arbitratorselection/ArbitratorSelectionView.java b/gui/src/main/java/io/bisq/gui/main/account/content/arbitratorselection/ArbitratorSelectionView.java index 5e250178c0d..faff968411b 100644 --- a/gui/src/main/java/io/bisq/gui/main/account/content/arbitratorselection/ArbitratorSelectionView.java +++ b/gui/src/main/java/io/bisq/gui/main/account/content/arbitratorselection/ArbitratorSelectionView.java @@ -23,6 +23,9 @@ import io.bisq.common.util.Tuple2; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipTableColumn; import io.bisq.gui.components.TableGroupHeadline; import io.bisq.gui.main.overlays.popups.Popup; import io.bisq.gui.util.ImageUtil; @@ -143,9 +146,9 @@ private void addLanguageGroup() { @Override public ListCell call(ListView list) { return new ListCell() { - final Label label = new Label(); + final Label label = new AutoTooltipLabel(); final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON); - final Button removeButton = new Button("", icon); + final Button removeButton = new AutoTooltipButton("", icon); final AnchorPane pane = new AnchorPane(label, removeButton); { @@ -207,23 +210,23 @@ private void addArbitratorsGroup() { autoSelectAllMatchingCheckBox.setOnAction(event -> model.setAutoSelectArbitrators(autoSelectAllMatchingCheckBox.isSelected())); - TableColumn dateColumn = new TableColumn<>(Res.get("account.arbitratorSelection.regDate")); + TableColumn dateColumn = new AutoTooltipTableColumn<>(Res.get("account.arbitratorSelection.regDate")); dateColumn.setSortable(false); dateColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getRegistrationDate())); dateColumn.setMinWidth(140); dateColumn.setMaxWidth(140); - TableColumn nameColumn = new TableColumn<>(Res.get("shared.onionAddress")); + TableColumn nameColumn = new AutoTooltipTableColumn<>(Res.get("shared.onionAddress")); nameColumn.setSortable(false); nameColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getAddressString())); nameColumn.setMinWidth(90); - TableColumn languagesColumn = new TableColumn<>(Res.get("account.arbitratorSelection.languages")); + TableColumn languagesColumn = new AutoTooltipTableColumn<>(Res.get("account.arbitratorSelection.languages")); languagesColumn.setSortable(false); languagesColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getLanguageCodes())); languagesColumn.setMinWidth(130); - TableColumn selectionColumn = new TableColumn( + TableColumn selectionColumn = new AutoTooltipTableColumn( Res.get("shared.accept")) { { setMinWidth(60); diff --git a/gui/src/main/java/io/bisq/gui/main/account/content/fiataccounts/FiatAccountsView.java b/gui/src/main/java/io/bisq/gui/main/account/content/fiataccounts/FiatAccountsView.java index 513f0df5cd1..6751c68b41d 100644 --- a/gui/src/main/java/io/bisq/gui/main/account/content/fiataccounts/FiatAccountsView.java +++ b/gui/src/main/java/io/bisq/gui/main/account/content/fiataccounts/FiatAccountsView.java @@ -26,6 +26,8 @@ import io.bisq.core.payment.payload.PaymentMethod; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.TitledGroupBg; import io.bisq.gui.components.paymentmethods.*; import io.bisq.gui.main.overlays.popups.Popup; @@ -118,7 +120,7 @@ public void initialize() { if (newValue != null) onSelectAccount(newValue); }; - Label placeholder = new Label(Res.get("shared.noAccountsSetupYet")); + Label placeholder = new AutoTooltipLabel(Res.get("shared.noAccountsSetupYet")); placeholder.setWrapText(true); paymentAccountsListView.setPlaceholder(placeholder); } @@ -221,9 +223,9 @@ private void buildForm() { @Override public ListCell call(ListView list) { return new ListCell() { - final Label label = new Label(); + final Label label = new AutoTooltipLabel(); final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON); - final Button removeButton = new Button("", icon); + final Button removeButton = new AutoTooltipButton("", icon); final AnchorPane pane = new AnchorPane(label, removeButton); { diff --git a/gui/src/main/java/io/bisq/gui/main/account/settings/AccountSettingsView.java b/gui/src/main/java/io/bisq/gui/main/account/settings/AccountSettingsView.java index 77ad0280e68..884479a69cf 100644 --- a/gui/src/main/java/io/bisq/gui/main/account/settings/AccountSettingsView.java +++ b/gui/src/main/java/io/bisq/gui/main/account/settings/AccountSettingsView.java @@ -22,6 +22,8 @@ import io.bisq.common.locale.Res; import io.bisq.gui.Navigation; import io.bisq.gui.common.view.*; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipToggleButton; import io.bisq.gui.main.MainView; import io.bisq.gui.main.account.AccountView; import io.bisq.gui.main.account.content.altcoinaccounts.AltCoinAccountsView; @@ -37,7 +39,6 @@ import javafx.geometry.Pos; import javafx.scene.control.Label; import javafx.scene.control.ScrollPane; -import javafx.scene.control.ToggleButton; import javafx.scene.control.ToggleGroup; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.VBox; @@ -145,7 +146,7 @@ public Class getSelectedViewClass() { } -class MenuItem extends ToggleButton { +class MenuItem extends AutoTooltipToggleButton { private final ChangeListener selectedPropertyChangeListener; private final ChangeListener disablePropertyChangeListener; @@ -163,7 +164,7 @@ class MenuItem extends ToggleButton { setPrefWidth(240); setAlignment(Pos.CENTER_LEFT); - Label icon = new Label(); + Label icon = new AutoTooltipLabel(); AwesomeDude.setIcon(icon, awesomeIcon); icon.setTextFill(Paint.valueOf("#333")); icon.setPadding(new Insets(0, 5, 0, 0)); diff --git a/gui/src/main/java/io/bisq/gui/main/dao/compensation/CompensationView.java b/gui/src/main/java/io/bisq/gui/main/dao/compensation/CompensationView.java index 728e4c6a54d..f2b321415f7 100644 --- a/gui/src/main/java/io/bisq/gui/main/dao/compensation/CompensationView.java +++ b/gui/src/main/java/io/bisq/gui/main/dao/compensation/CompensationView.java @@ -22,6 +22,8 @@ import io.bisq.common.locale.Res; import io.bisq.gui.Navigation; import io.bisq.gui.common.view.*; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipToggleButton; import io.bisq.gui.main.MainView; import io.bisq.gui.main.dao.DaoView; import io.bisq.gui.main.dao.compensation.active.ActiveCompensationRequestView; @@ -33,7 +35,6 @@ import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Label; -import javafx.scene.control.ToggleButton; import javafx.scene.control.ToggleGroup; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.VBox; @@ -125,7 +126,7 @@ public Class getSelectedViewClass() { } -class MenuItem extends ToggleButton { +class MenuItem extends AutoTooltipToggleButton { private final ChangeListener selectedPropertyChangeListener; private final ChangeListener disablePropertyChangeListener; @@ -143,7 +144,7 @@ class MenuItem extends ToggleButton { setPrefWidth(240); setAlignment(Pos.CENTER_LEFT); - Label icon = new Label(); + Label icon = new AutoTooltipLabel(); AwesomeDude.setIcon(icon, awesomeIcon); icon.setTextFill(Paint.valueOf("#333")); icon.setPadding(new Insets(0, 5, 0, 0)); diff --git a/gui/src/main/java/io/bisq/gui/main/dao/compensation/active/ActiveCompensationRequestView.java b/gui/src/main/java/io/bisq/gui/main/dao/compensation/active/ActiveCompensationRequestView.java index bc7361d3901..d6869fb6fb7 100644 --- a/gui/src/main/java/io/bisq/gui/main/dao/compensation/active/ActiveCompensationRequestView.java +++ b/gui/src/main/java/io/bisq/gui/main/dao/compensation/active/ActiveCompensationRequestView.java @@ -25,6 +25,8 @@ import io.bisq.gui.Navigation; import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipTableColumn; import io.bisq.gui.components.InputTextField; import io.bisq.gui.components.TableGroupHeadline; import io.bisq.gui.main.MainView; @@ -124,7 +126,7 @@ public void initialize() { // tableView.setMinHeight(100); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("table.placeholder.noData"))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData"))); sortedList = new SortedList<>(compensationRequestManger.getObservableList()); tableView.setItems(sortedList); setColumns(); @@ -219,7 +221,7 @@ public void onFailure(@NotNull Throwable t) { } private void setColumns() { - TableColumn dateColumn = new TableColumn(Res.get("shared.dateTime")) { + TableColumn dateColumn = new AutoTooltipTableColumn(Res.get("shared.dateTime")) { { setMinWidth(190); setMaxWidth(190); @@ -250,7 +252,7 @@ public void updateItem(final CompensationRequest item, boolean empty) { tableView.getSortOrder().add(dateColumn); - TableColumn nameColumn = new TableColumn<>(Res.get("shared.name")); + TableColumn nameColumn = new AutoTooltipTableColumn<>(Res.get("shared.name")); nameColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue())); nameColumn.setCellFactory( new Callback, TableCell uidColumn = new TableColumn<>(Res.get("shared.id")); + TableColumn uidColumn = new AutoTooltipTableColumn<>(Res.get("shared.id")); uidColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue())); uidColumn.setCellFactory( new Callback, TableCell getSelectedViewClass() { } -class MenuItem extends ToggleButton { +class MenuItem extends AutoTooltipToggleButton { private final ChangeListener selectedPropertyChangeListener; private final ChangeListener disablePropertyChangeListener; @@ -143,7 +144,7 @@ class MenuItem extends ToggleButton { setPrefWidth(240); setAlignment(Pos.CENTER_LEFT); - Label icon = new Label(); + Label icon = new AutoTooltipLabel(); AwesomeDude.setIcon(icon, awesomeIcon); icon.setTextFill(Paint.valueOf("#333")); icon.setPadding(new Insets(0, 5, 0, 0)); diff --git a/gui/src/main/java/io/bisq/gui/main/dao/voting/vote/CompensationViewItem.java b/gui/src/main/java/io/bisq/gui/main/dao/voting/vote/CompensationViewItem.java index c7a52bb6af0..0a7450e0855 100644 --- a/gui/src/main/java/io/bisq/gui/main/dao/voting/vote/CompensationViewItem.java +++ b/gui/src/main/java/io/bisq/gui/main/dao/voting/vote/CompensationViewItem.java @@ -22,6 +22,7 @@ import io.bisq.core.dao.compensation.CompensationRequest; import io.bisq.core.dao.compensation.CompensationRequestPayload; import io.bisq.core.dao.vote.CompensationRequestVoteItem; +import io.bisq.gui.components.AutoTooltipButton; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.MainView; import io.bisq.gui.main.dao.compensation.CompensationRequestDisplay; @@ -171,7 +172,7 @@ private CompensationViewItem(CompensationRequestVoteItem compensationRequestVote }); declineCheckBox.setSelected(compensationRequestVoteItem.isDeclineVote()); - removeButton = new Button(Res.get("shared.remove")); + removeButton = new AutoTooltipButton(Res.get("shared.remove")); removeButton.setOnAction(event -> { vBox.getChildren().remove(hBox); cleanupInstance(); diff --git a/gui/src/main/java/io/bisq/gui/main/dao/voting/vote/ParameterViewItem.java b/gui/src/main/java/io/bisq/gui/main/dao/voting/vote/ParameterViewItem.java index 1317a8e51ba..936eef776ce 100644 --- a/gui/src/main/java/io/bisq/gui/main/dao/voting/vote/ParameterViewItem.java +++ b/gui/src/main/java/io/bisq/gui/main/dao/voting/vote/ParameterViewItem.java @@ -21,6 +21,8 @@ import io.bisq.common.locale.Res; import io.bisq.core.dao.vote.VoteItem; import io.bisq.core.dao.vote.VotingDefaultValues; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.InputTextField; import javafx.beans.property.DoubleProperty; import javafx.beans.value.ChangeListener; @@ -78,7 +80,7 @@ private ParameterViewItem(VoteItem voteItem, VBox vBox, DoubleProperty labelWidt hBox.setSpacing(5); vBox.getChildren().add(hBox); - label = new Label(voteItem.getName() + ":"); + label = new AutoTooltipLabel(voteItem.getName() + ":"); HBox.setMargin(label, new Insets(4, 0, 0, 0)); numberChangeListener = (observable, oldValue, newValue) -> { if ((double) newValue > 0) { @@ -144,10 +146,10 @@ public Double fromString(String string) { }; slider.valueProperty().addListener(sliderListener); - resetButton = new Button(Res.get("shared.reset")); + resetButton = new AutoTooltipButton(Res.get("shared.reset")); resetButton.setOnAction(event -> inputTextField.setText(String.valueOf(originalValue))); - removeButton = new Button(Res.get("shared.remove")); + removeButton = new AutoTooltipButton(Res.get("shared.remove")); removeButton.setOnAction(event -> { vBox.getChildren().remove(hBox); cleanupInstance(); diff --git a/gui/src/main/java/io/bisq/gui/main/dao/wallet/BsqWalletView.java b/gui/src/main/java/io/bisq/gui/main/dao/wallet/BsqWalletView.java index 5907fd9fd46..d732e45497f 100644 --- a/gui/src/main/java/io/bisq/gui/main/dao/wallet/BsqWalletView.java +++ b/gui/src/main/java/io/bisq/gui/main/dao/wallet/BsqWalletView.java @@ -23,6 +23,8 @@ import io.bisq.core.app.BisqEnvironment; import io.bisq.gui.Navigation; import io.bisq.gui.common.view.*; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipToggleButton; import io.bisq.gui.main.MainView; import io.bisq.gui.main.dao.DaoView; import io.bisq.gui.main.dao.wallet.dashboard.BsqDashboardView; @@ -35,7 +37,6 @@ import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Label; -import javafx.scene.control.ToggleButton; import javafx.scene.control.ToggleGroup; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.VBox; @@ -141,7 +142,7 @@ public Class getSelectedViewClass() { } -class MenuItem extends ToggleButton { +class MenuItem extends AutoTooltipToggleButton { private final ChangeListener selectedPropertyChangeListener; private final ChangeListener disablePropertyChangeListener; @@ -159,7 +160,7 @@ class MenuItem extends ToggleButton { setPrefWidth(240); setAlignment(Pos.CENTER_LEFT); - Label icon = new Label(); + Label icon = new AutoTooltipLabel(); AwesomeDude.setIcon(icon, awesomeIcon); icon.setTextFill(Paint.valueOf("#333")); icon.setPadding(new Insets(0, 5, 0, 0)); diff --git a/gui/src/main/java/io/bisq/gui/main/dao/wallet/dashboard/BsqDashboardView.java b/gui/src/main/java/io/bisq/gui/main/dao/wallet/dashboard/BsqDashboardView.java index 1f547f3f075..9bb9142b922 100644 --- a/gui/src/main/java/io/bisq/gui/main/dao/wallet/dashboard/BsqDashboardView.java +++ b/gui/src/main/java/io/bisq/gui/main/dao/wallet/dashboard/BsqDashboardView.java @@ -30,6 +30,7 @@ import io.bisq.core.user.Preferences; import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.dao.wallet.BsqBalanceUtil; import io.bisq.gui.util.BsqFormatter; @@ -91,7 +92,7 @@ public void initialize() { addLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisBlockHeight"), String.valueOf(bsqChainState.getGenesisBlockHeight()), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - Label label = new Label(Res.get("dao.wallet.dashboard.genesisTxId")); + Label label = new AutoTooltipLabel(Res.get("dao.wallet.dashboard.genesisTxId")); GridPane.setRowIndex(label, ++gridRow); root.getChildren().add(label); hyperlinkWithIcon = new HyperlinkWithIcon(bsqChainState.getGenesisTxId(), AwesomeIcon.EXTERNAL_LINK); diff --git a/gui/src/main/java/io/bisq/gui/main/dao/wallet/tx/BsqTxView.java b/gui/src/main/java/io/bisq/gui/main/dao/wallet/tx/BsqTxView.java index 6ef12bd263a..a653919e5a1 100644 --- a/gui/src/main/java/io/bisq/gui/main/dao/wallet/tx/BsqTxView.java +++ b/gui/src/main/java/io/bisq/gui/main/dao/wallet/tx/BsqTxView.java @@ -33,6 +33,8 @@ import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; import io.bisq.gui.components.AddressWithIconAndDirection; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipTableColumn; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.dao.wallet.BsqBalanceUtil; import io.bisq.gui.util.BsqFormatter; @@ -238,7 +240,7 @@ private void layout() { } private void addDateColumn() { - TableColumn column = new TableColumn<>(Res.get("shared.dateTime")); + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.dateTime")); column.setCellValueFactory(item -> new ReadOnlyObjectWrapper<>(item.getValue())); column.setMinWidth(180); column.setMaxWidth(180); @@ -271,7 +273,8 @@ public void updateItem(final BsqTxListItem item, boolean empty) { } private void addTxIdColumn() { - TableColumn column = new TableColumn<>(Res.get("shared.txId")); + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.txId")); + column.setCellValueFactory(item -> new ReadOnlyObjectWrapper<>(item.getValue())); column.setMinWidth(60); column.setCellFactory( @@ -307,7 +310,7 @@ public void updateItem(final BsqTxListItem item, boolean empty) { } private void addAddressColumn() { - TableColumn column = new TableColumn<>(Res.get("shared.address")); + TableColumn column = new AutoTooltipTableColumn<>(Res.get("shared.address")); column.setCellValueFactory(item -> new ReadOnlyObjectWrapper<>(item.getValue())); column.setMinWidth(140); column.setCellFactory( @@ -332,7 +335,7 @@ public void updateItem(final BsqTxListItem item, boolean empty) { if (field != null) field.setOnAction(null); - label = new Label(item.isBurnedBsqTx() ? + label = new AutoTooltipLabel(item.isBurnedBsqTx() ? Res.get("dao.wallet.bsqFee") : Res.get("funds.tx.direction.self")); setGraphic(label); } else { @@ -356,7 +359,7 @@ public void updateItem(final BsqTxListItem item, boolean empty) { } private void addAmountColumn() { - TableColumn column = new TableColumn<>(Res.get("shared.amountWithCur", "BSQ")); + TableColumn column = new AutoTooltipTableColumn<>(Res.get("shared.amountWithCur", "BSQ")); column.setMinWidth(100); column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue())); column.setCellFactory(new Callback, @@ -384,7 +387,7 @@ public void updateItem(final BsqTxListItem item, boolean empty) { } private void addConfidenceColumn() { - TableColumn column = new TableColumn<>(Res.get("shared.confirmations")); + TableColumn column = new AutoTooltipTableColumn<>(Res.get("shared.confirmations")); column.setMinWidth(130); column.setMaxWidth(130); @@ -414,7 +417,7 @@ public void updateItem(final BsqTxListItem item, boolean empty) { } private void addTxTypeColumn() { - TableColumn column = new TableColumn<>(Res.get("dao.wallet.tx.type")); + TableColumn column = new AutoTooltipTableColumn<>(Res.get("dao.wallet.tx.type")); column.setCellValueFactory(item -> new ReadOnlyObjectWrapper<>(item.getValue())); column.setMinWidth(70); column.setMaxWidth(column.getMinWidth()); diff --git a/gui/src/main/java/io/bisq/gui/main/disputes/trader/TraderDisputeView.java b/gui/src/main/java/io/bisq/gui/main/disputes/trader/TraderDisputeView.java index 71cad3bd5bc..596b0a63327 100644 --- a/gui/src/main/java/io/bisq/gui/main/disputes/trader/TraderDisputeView.java +++ b/gui/src/main/java/io/bisq/gui/main/disputes/trader/TraderDisputeView.java @@ -38,10 +38,7 @@ import io.bisq.core.trade.TradeManager; import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; -import io.bisq.gui.components.BusyAnimation; -import io.bisq.gui.components.HyperlinkWithIcon; -import io.bisq.gui.components.InputTextField; -import io.bisq.gui.components.TableGroupHeadline; +import io.bisq.gui.components.*; import io.bisq.gui.main.disputes.arbitrator.ArbitratorDisputeView; import io.bisq.gui.main.overlays.popups.Popup; import io.bisq.gui.main.overlays.windows.ContractWindow; @@ -165,7 +162,7 @@ public TraderDisputeView(DisputeManager disputeManager, @Override public void initialize() { - Label label = new Label(Res.get("support.filter")); + Label label = new AutoTooltipLabel(Res.get("support.filter")); HBox.setMargin(label, new Insets(5, 0, 0, 0)); filterTextField = new InputTextField(); filterTextField.setText("open"); @@ -185,7 +182,7 @@ public void initialize() { root.getChildren().addAll(filterBox, tableView); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - Label placeholder = new Label(Res.get("support.noTickets")); + Label placeholder = new AutoTooltipLabel(Res.get("support.noTickets")); placeholder.setWrapText(true); tableView.setPlaceholder(placeholder); tableView.getSelectionModel().clearSelection(); @@ -625,7 +622,7 @@ private void onSelectDispute(Dispute dispute) { if (!(this instanceof ArbitratorDisputeView)) inputTextArea.setPromptText(Res.get("support.input.prompt")); - sendButton = new Button(Res.get("support.send")); + sendButton = new AutoTooltipButton(Res.get("support.send")); sendButton.setDefaultButton(true); sendButton.setOnAction(e -> { if (p2PService.isBootstrapped()) { @@ -641,10 +638,10 @@ private void onSelectDispute(Dispute dispute) { }); inputTextAreaTextSubscription = EasyBind.subscribe(inputTextArea.textProperty(), t -> sendButton.setDisable(t.isEmpty())); - Button uploadButton = new Button(Res.get("support.addAttachments")); + Button uploadButton = new AutoTooltipButton(Res.get("support.addAttachments")); uploadButton.setOnAction(e -> onRequestUpload()); - sendMsgInfoLabel = new Label(); + sendMsgInfoLabel = new AutoTooltipLabel(); sendMsgInfoLabel.setVisible(false); sendMsgInfoLabel.setManaged(false); sendMsgInfoLabel.setPadding(new Insets(5, 0, 0, 0)); @@ -657,7 +654,7 @@ private void onSelectDispute(Dispute dispute) { buttonBox.getChildren().addAll(sendButton, uploadButton, sendMsgBusyAnimation, sendMsgInfoLabel); if (!isTrader) { - Button closeDisputeButton = new Button(Res.get("support.closeTicket")); + Button closeDisputeButton = new AutoTooltipButton(Res.get("support.closeTicket")); closeDisputeButton.setOnAction(e -> onCloseDispute(selectedDispute)); closeDisputeButton.setDefaultButton(true); Pane spacer = new Pane(); @@ -689,12 +686,12 @@ public ListCell call(ListView sendMsgBusyAnimationListener; final Pane bg = new Pane(); final ImageView arrow = new ImageView(); - final Label headerLabel = new Label(); - final Label messageLabel = new Label(); - final Label copyIcon = new Label(); + final Label headerLabel = new AutoTooltipLabel(); + final Label messageLabel = new AutoTooltipLabel(); + final Label copyIcon = new AutoTooltipLabel(); final HBox attachmentsBox = new HBox(); final AnchorPane messageAnchorPane = new AnchorPane(); - final Label statusIcon = new Label(); + final Label statusIcon = new AutoTooltipLabel(); final double arrowWidth = 15d; final double attachmentsBoxHeight = 20d; final double border = 10d; @@ -825,7 +822,7 @@ else if (item.storedInMailboxProperty().get()) attachmentsBox.getChildren().clear(); if (item.getAttachments() != null && item.getAttachments().size() > 0) { AnchorPane.setBottomAnchor(messageLabel, bottomBorder + attachmentsBoxHeight + 10); - attachmentsBox.getChildren().add(new Label(Res.get("support.attachments") + " ") {{ + attachmentsBox.getChildren().add(new AutoTooltipLabel(Res.get("support.attachments") + " ") {{ setPadding(new Insets(0, 0, 3, 0)); if (isMyMsg) getStyleClass().add("my-message"); @@ -833,7 +830,7 @@ else if (item.storedInMailboxProperty().get()) getStyleClass().add("message"); }}); item.getAttachments().stream().forEach(attachment -> { - final Label icon = new Label(); + final Label icon = new AutoTooltipLabel(); setPadding(new Insets(0, 0, 3, 0)); if (isMyMsg) icon.getStyleClass().add("attachment-icon"); @@ -915,13 +912,11 @@ private void showArrivedIcon() { /////////////////////////////////////////////////////////////////////////////////////////// private TableColumn getSelectColumn() { - TableColumn column = new TableColumn(Res.get("shared.select")) { - { - setMinWidth(80); - setMaxWidth(80); - setSortable(false); - } - }; + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.select")); + column.setMinWidth(80); + column.setMaxWidth(80); + column.setSortable(false); + column.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue())); column.setCellFactory( @@ -941,7 +936,7 @@ public void updateItem(final Dispute item, boolean empty) { if (item != null && !empty) { if (button == null) { - button = new Button(Res.get("shared.select")); + button = new AutoTooltipButton(Res.get("shared.select")); setGraphic(button); } button.setOnAction(e -> tableView.getSelectionModel().select(item)); @@ -960,7 +955,7 @@ public void updateItem(final Dispute item, boolean empty) { } private TableColumn getContractColumn() { - TableColumn column = new TableColumn(Res.get("shared.details")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.details")) { { setMinWidth(80); setSortable(false); @@ -981,7 +976,7 @@ public void updateItem(final Dispute item, boolean empty) { if (item != null && !empty) { if (button == null) { - button = new Button(Res.get("shared.details")); + button = new AutoTooltipButton(Res.get("shared.details")); setGraphic(button); } button.setOnAction(e -> onOpenContract(item)); @@ -1000,7 +995,7 @@ public void updateItem(final Dispute item, boolean empty) { } private TableColumn getDateColumn() { - TableColumn column = new TableColumn(Res.get("shared.date")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.date")) { { setMinWidth(180); } @@ -1026,7 +1021,7 @@ public void updateItem(final Dispute item, boolean empty) { } private TableColumn getTradeIdColumn() { - TableColumn column = new TableColumn(Res.get("shared.tradeId")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.tradeId")) { { setMinWidth(110); } @@ -1067,7 +1062,7 @@ public void updateItem(final Dispute item, boolean empty) { } private TableColumn getBuyerOnionAddressColumn() { - TableColumn column = new TableColumn(Res.get("support.buyerAddress")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("support.buyerAddress")) { { setMinWidth(170); } @@ -1093,7 +1088,7 @@ public void updateItem(final Dispute item, boolean empty) { } private TableColumn getSellerOnionAddressColumn() { - TableColumn column = new TableColumn(Res.get("support.sellerAddress")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("support.sellerAddress")) { { setMinWidth(170); } @@ -1146,7 +1141,7 @@ protected String getSellerOnionAddressColumnLabel(Dispute item) { } private TableColumn getMarketColumn() { - TableColumn column = new TableColumn(Res.get("shared.market")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.market")) { { setMinWidth(130); } @@ -1172,7 +1167,7 @@ public void updateItem(final Dispute item, boolean empty) { } private TableColumn getRoleColumn() { - TableColumn column = new TableColumn(Res.get("support.role")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("support.role")) { { setMinWidth(130); } @@ -1202,7 +1197,7 @@ public void updateItem(final Dispute item, boolean empty) { } private TableColumn getStateColumn() { - TableColumn column = new TableColumn(Res.get("support.state")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("support.state")) { { setMinWidth(50); } diff --git a/gui/src/main/java/io/bisq/gui/main/funds/deposit/DepositView.java b/gui/src/main/java/io/bisq/gui/main/funds/deposit/DepositView.java index 35acb4ba0ed..c2b40881445 100644 --- a/gui/src/main/java/io/bisq/gui/main/funds/deposit/DepositView.java +++ b/gui/src/main/java/io/bisq/gui/main/funds/deposit/DepositView.java @@ -29,10 +29,7 @@ import io.bisq.core.user.Preferences; import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; -import io.bisq.gui.components.AddressTextField; -import io.bisq.gui.components.HyperlinkWithIcon; -import io.bisq.gui.components.InputTextField; -import io.bisq.gui.components.TitledGroupBg; +import io.bisq.gui.components.*; import io.bisq.gui.main.overlays.popups.Popup; import io.bisq.gui.main.overlays.windows.QRCodeWindow; import io.bisq.gui.util.BSFormatter; @@ -112,17 +109,17 @@ private DepositView(BtcWalletService walletService, @Override public void initialize() { paymentLabelString = Res.get("funds.deposit.fundBisqWallet"); - selectColumn.setText(Res.get("shared.select")); - addressColumn.setText(Res.get("shared.address")); - balanceColumn.setText(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode())); - confirmationsColumn.setText(Res.get("shared.confirmations")); - usageColumn.setText(Res.get("shared.usage")); + 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"))); + usageColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.usage"))); // trigger creation of at least 1 savings address walletService.getOrCreateAddressEntry(AddressEntry.Context.AVAILABLE); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("funds.deposit.noAddresses"))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("funds.deposit.noAddresses"))); tableViewSelectionListener = (observableValue, oldValue, newValue) -> { if (newValue != null) fillForm(newValue.getAddressString()); @@ -316,7 +313,7 @@ public TableCell call(TableColumn tableView.getSelectionModel().select(item)); diff --git a/gui/src/main/java/io/bisq/gui/main/funds/locked/LockedListItem.java b/gui/src/main/java/io/bisq/gui/main/funds/locked/LockedListItem.java index 782aab1642b..c2181ed02fb 100644 --- a/gui/src/main/java/io/bisq/gui/main/funds/locked/LockedListItem.java +++ b/gui/src/main/java/io/bisq/gui/main/funds/locked/LockedListItem.java @@ -23,6 +23,7 @@ import io.bisq.core.btc.wallet.WalletService; import io.bisq.core.trade.Tradable; import io.bisq.core.trade.Trade; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.util.BSFormatter; import javafx.scene.control.Label; import org.bitcoinj.core.Address; @@ -58,7 +59,7 @@ public LockedListItem(Trade trade, AddressEntry addressEntry, BtcWalletService b } // balance - balanceLabel = new Label(); + balanceLabel = new AutoTooltipLabel(); balanceListener = new BalanceListener(getAddress()) { @Override public void onBalanceChanged(Coin balance, Transaction tx) { diff --git a/gui/src/main/java/io/bisq/gui/main/funds/locked/LockedView.java b/gui/src/main/java/io/bisq/gui/main/funds/locked/LockedView.java index b1457ca193f..bb33bfd741e 100644 --- a/gui/src/main/java/io/bisq/gui/main/funds/locked/LockedView.java +++ b/gui/src/main/java/io/bisq/gui/main/funds/locked/LockedView.java @@ -30,6 +30,7 @@ import io.bisq.core.user.Preferences; import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.overlays.windows.OfferDetailsWindow; import io.bisq.gui.main.overlays.windows.TradeDetailsWindow; @@ -90,13 +91,13 @@ private LockedView(BtcWalletService btcWalletService, TradeManager tradeManager, @Override public void initialize() { - dateColumn.setText(Res.get("shared.dateTime")); - detailsColumn.setText(Res.get("shared.details")); - addressColumn.setText(Res.get("shared.address")); - balanceColumn.setText(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode())); + dateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.dateTime"))); + detailsColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.details"))); + addressColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.address"))); + balanceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode()))); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("funds.locked.noFunds"))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("funds.locked.noFunds"))); setDateColumnCellFactory(); setDetailsColumnCellFactory(); @@ -254,9 +255,9 @@ public void updateItem(final LockedListItem item, boolean empty) { field.setTooltip(new Tooltip(Res.get("tooltip.openPopupForDetails"))); setGraphic(field); } else if (addressEntry.getContext() == AddressEntry.Context.ARBITRATOR) { - setGraphic(new Label(Res.get("shared.arbitratorsFee"))); + setGraphic(new AutoTooltipLabel(Res.get("shared.arbitratorsFee"))); } else { - setGraphic(new Label(Res.get("shared.noDetailsAvailable"))); + setGraphic(new AutoTooltipLabel(Res.get("shared.noDetailsAvailable"))); } } else { diff --git a/gui/src/main/java/io/bisq/gui/main/funds/reserved/ReservedListItem.java b/gui/src/main/java/io/bisq/gui/main/funds/reserved/ReservedListItem.java index 5dcb31842e8..574f90ac26c 100644 --- a/gui/src/main/java/io/bisq/gui/main/funds/reserved/ReservedListItem.java +++ b/gui/src/main/java/io/bisq/gui/main/funds/reserved/ReservedListItem.java @@ -22,6 +22,7 @@ import io.bisq.core.btc.wallet.BtcWalletService; import io.bisq.core.offer.OpenOffer; import io.bisq.core.trade.Tradable; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.util.BSFormatter; import javafx.scene.control.Label; import org.bitcoinj.core.Address; @@ -48,7 +49,7 @@ public ReservedListItem(OpenOffer openOffer, AddressEntry addressEntry, BtcWalle addressString = addressEntry.getAddressString(); // balance - balanceLabel = new Label(); + balanceLabel = new AutoTooltipLabel(); balanceListener = new BalanceListener(getAddress()) { @Override public void onBalanceChanged(Coin balance, Transaction tx) { diff --git a/gui/src/main/java/io/bisq/gui/main/funds/reserved/ReservedView.java b/gui/src/main/java/io/bisq/gui/main/funds/reserved/ReservedView.java index 9ff001a46e3..1584a0dff40 100644 --- a/gui/src/main/java/io/bisq/gui/main/funds/reserved/ReservedView.java +++ b/gui/src/main/java/io/bisq/gui/main/funds/reserved/ReservedView.java @@ -30,6 +30,7 @@ import io.bisq.core.user.Preferences; import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.overlays.windows.OfferDetailsWindow; import io.bisq.gui.main.overlays.windows.TradeDetailsWindow; @@ -90,13 +91,13 @@ private ReservedView(BtcWalletService btcWalletService, TradeManager tradeManage @Override public void initialize() { - dateColumn.setText(Res.get("shared.dateTime")); - detailsColumn.setText(Res.get("shared.details")); - addressColumn.setText(Res.get("shared.address")); - balanceColumn.setText(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode())); + dateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.dateTime"))); + detailsColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.details"))); + addressColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.address"))); + balanceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode()))); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("funds.reserved.noFunds"))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("funds.reserved.noFunds"))); setDateColumnCellFactory(); setDetailsColumnCellFactory(); @@ -253,9 +254,9 @@ public void updateItem(final ReservedListItem item, boolean empty) { field.setTooltip(new Tooltip(Res.get("tooltip.openPopupForDetails"))); setGraphic(field); } else if (item.getAddressEntry().getContext() == AddressEntry.Context.ARBITRATOR) { - setGraphic(new Label(Res.get("shared.arbitratorsFee"))); + setGraphic(new AutoTooltipLabel(Res.get("shared.arbitratorsFee"))); } else { - setGraphic(new Label(Res.get("shared.noDetailsAvailable"))); + setGraphic(new AutoTooltipLabel(Res.get("shared.noDetailsAvailable"))); } } else { diff --git a/gui/src/main/java/io/bisq/gui/main/funds/transactions/TransactionsView.java b/gui/src/main/java/io/bisq/gui/main/funds/transactions/TransactionsView.java index 3b30adc792f..d3e91ac5352 100644 --- a/gui/src/main/java/io/bisq/gui/main/funds/transactions/TransactionsView.java +++ b/gui/src/main/java/io/bisq/gui/main/funds/transactions/TransactionsView.java @@ -37,6 +37,8 @@ import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; import io.bisq.gui.components.AddressWithIconAndDirection; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.overlays.popups.Popup; import io.bisq.gui.main.overlays.windows.OfferDetailsWindow; @@ -128,16 +130,16 @@ private TransactionsView(BtcWalletService btcWalletService, BsqWalletService bsq @Override public void initialize() { - dateColumn.setText(Res.get("shared.dateTime")); - detailsColumn.setText(Res.get("shared.details")); - addressColumn.setText(Res.get("shared.address")); - transactionColumn.setText(Res.get("shared.txId", Res.getBaseCurrencyCode())); - amountColumn.setText(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); - confidenceColumn.setText(Res.get("shared.confirmations", Res.getBaseCurrencyCode())); - revertTxColumn.setText(Res.get("shared.revert", Res.getBaseCurrencyCode())); + dateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.dateTime"))); + detailsColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.details"))); + addressColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.address"))); + transactionColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.txId", Res.getBaseCurrencyCode()))); + amountColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode()))); + confidenceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.confirmations", Res.getBaseCurrencyCode()))); + revertTxColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.revert", Res.getBaseCurrencyCode()))); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("funds.tx.noTxAvailable"))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("funds.tx.noTxAvailable"))); setDateColumnCellFactory(); setDetailsColumnCellFactory(); @@ -383,7 +385,7 @@ public void updateItem(final TransactionsListItem item, boolean empty) { field.setTooltip(new Tooltip(Res.get("tooltip.openPopupForDetails"))); setGraphic(field); } else { - setGraphic(new Label(item.getDetails())); + setGraphic(new AutoTooltipLabel(item.getDetails())); } } else { setGraphic(null); @@ -539,7 +541,7 @@ public void updateItem(final TransactionsListItem item, boolean empty) { if (confidence != null) { if (confidence.getConfidenceType() == TransactionConfidence.ConfidenceType.PENDING) { if (button == null) { - button = new Button(Res.get("funds.tx.revert")); + button = new AutoTooltipButton(Res.get("funds.tx.revert")); setGraphic(button); } button.setOnAction(e -> revertTransaction(item.getTxId(), item.getTradable())); diff --git a/gui/src/main/java/io/bisq/gui/main/funds/withdrawal/WithdrawalListItem.java b/gui/src/main/java/io/bisq/gui/main/funds/withdrawal/WithdrawalListItem.java index 8fce2ef48f7..a9013e51381 100644 --- a/gui/src/main/java/io/bisq/gui/main/funds/withdrawal/WithdrawalListItem.java +++ b/gui/src/main/java/io/bisq/gui/main/funds/withdrawal/WithdrawalListItem.java @@ -21,6 +21,7 @@ import io.bisq.core.btc.AddressEntry; import io.bisq.core.btc.listeners.BalanceListener; import io.bisq.core.btc.wallet.BtcWalletService; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.util.BSFormatter; import javafx.scene.control.Label; import lombok.Getter; @@ -49,7 +50,7 @@ public WithdrawalListItem(AddressEntry addressEntry, BtcWalletService walletServ addressString = addressEntry.getAddressString(); // balance - balanceLabel = new Label(); + balanceLabel = new AutoTooltipLabel(); balanceListener = new BalanceListener(getAddress()) { @Override public void onBalanceChanged(Coin balance, Transaction tx) { diff --git a/gui/src/main/java/io/bisq/gui/main/funds/withdrawal/WithdrawalView.java b/gui/src/main/java/io/bisq/gui/main/funds/withdrawal/WithdrawalView.java index 4ba9ad71888..15af276f1d5 100644 --- a/gui/src/main/java/io/bisq/gui/main/funds/withdrawal/WithdrawalView.java +++ b/gui/src/main/java/io/bisq/gui/main/funds/withdrawal/WithdrawalView.java @@ -36,6 +36,7 @@ import io.bisq.core.util.CoinUtil; import io.bisq.gui.common.view.ActivatableView; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.overlays.popups.Popup; import io.bisq.gui.main.overlays.windows.WalletPasswordWindow; @@ -143,12 +144,12 @@ public void initialize() { toLabel.setText(Res.get("funds.withdrawal.toLabel", Res.getBaseCurrencyCode())); withdrawButton.setText(Res.get("funds.withdrawal.withdrawButton")); - addressColumn.setText(Res.get("shared.address")); - balanceColumn.setText(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode())); - selectColumn.setText(Res.get("shared.select")); + addressColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.address"))); + balanceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode()))); + selectColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.select"))); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("funds.withdrawal.noFundsAvailable"))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("funds.withdrawal.noFundsAvailable"))); tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); setAddressColumnCellFactory(); diff --git a/gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java b/gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java index 0a4ddb1f1c6..80d3cc53fbe 100644 --- a/gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java +++ b/gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java @@ -26,6 +26,9 @@ import io.bisq.gui.Navigation; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipTableColumn; import io.bisq.gui.main.MainView; import io.bisq.gui.main.offer.BuyOfferView; import io.bisq.gui.main.offer.SellOfferView; @@ -114,7 +117,7 @@ public void initialize() { Res.get("shared.offers"), model.preferences)); - Label currencyLabel = new Label(Res.getWithCol("shared.currency")); + Label currencyLabel = new AutoTooltipLabel(Res.getWithCol("shared.currency")); HBox currencyHBox = new HBox(); currencyHBox.setSpacing(5); currencyHBox.setPadding(new Insets(5, -20, -5, 20)); @@ -391,7 +394,7 @@ public void updateItem(final OfferListItem offerListItem, boolean empty) { }); // amount - TableColumn amountColumn = new TableColumn<>(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); + TableColumn amountColumn = new AutoTooltipTableColumn<>(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); amountColumn.setMinWidth(115); amountColumn.setSortable(false); amountColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue())); @@ -414,7 +417,7 @@ public void updateItem(final OfferListItem offerListItem, boolean empty) { // Lets remove that as it is not really relevant and seems to be confusing to some users // accumulated - /* TableColumn accumulatedColumn = new TableColumn<>(Res.get("shared.sumWithCur", Res.getBaseCurrencyCode())); + /* TableColumn accumulatedColumn = new AutoTooltipTableColumn<>(Res.get("shared.sumWithCur", Res.getBaseCurrencyCode())); accumulatedColumn.setMinWidth(100); accumulatedColumn.setSortable(false); accumulatedColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue())); @@ -448,16 +451,16 @@ public void updateItem(final OfferListItem offerListItem, boolean empty) { } tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - Label placeholder = new Label(Res.get("table.placeholder.noItems", Res.get("shared.offers"))); + Label placeholder = new AutoTooltipLabel(Res.get("table.placeholder.noItems", Res.get("shared.offers"))); placeholder.setWrapText(true); tableView.setPlaceholder(placeholder); - Label titleLabel = new Label(); + Label titleLabel = new AutoTooltipLabel(); titleLabel.getStyleClass().add("table-title "); UserThread.execute(() -> titleLabel.prefWidthProperty().bind(tableView.widthProperty())); boolean isSellOffer = direction == OfferPayload.Direction.SELL; - Button button = new Button(); + Button button = new AutoTooltipButton(); ImageView iconView = new ImageView(); iconView.setId(isSellOffer ? "image-buy-white" : "image-sell-white"); button.setGraphic(iconView); diff --git a/gui/src/main/java/io/bisq/gui/main/market/spread/SpreadView.java b/gui/src/main/java/io/bisq/gui/main/market/spread/SpreadView.java index b7d516d37ea..82aa0fbb0c7 100644 --- a/gui/src/main/java/io/bisq/gui/main/market/spread/SpreadView.java +++ b/gui/src/main/java/io/bisq/gui/main/market/spread/SpreadView.java @@ -21,6 +21,8 @@ import io.bisq.common.locale.Res; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipTableColumn; import io.bisq.gui.util.BSFormatter; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.collections.ListChangeListener; @@ -65,7 +67,7 @@ public void initialize() { GridPane.setVgrow(tableView, Priority.ALWAYS); GridPane.setHgrow(tableView, Priority.ALWAYS); root.getChildren().add(tableView); - Label placeholder = new Label(Res.get("table.placeholder.noData")); + Label placeholder = new AutoTooltipLabel(Res.get("table.placeholder.noData")); placeholder.setWrapText(true); tableView.setPlaceholder(placeholder); @@ -116,10 +118,10 @@ private void updateHeaders() { int numberOfSellOffers = sortedList.stream().mapToInt(item -> item.numberOfSellOffers).sum(); String total = formatter.formatCoin(Coin.valueOf(sortedList.stream().mapToLong(item -> item.totalAmount.value).sum())); - numberOfOffersColumn.setText(Res.get("market.spread.numberOfOffersColumn", numberOfOffers)); - numberOfBuyOffersColumn.setText(Res.get("market.spread.numberOfBuyOffersColumn", numberOfBuyOffers)); - numberOfSellOffersColumn.setText(Res.get("market.spread.numberOfSellOffersColumn", numberOfSellOffers)); - totalAmountColumn.setText(Res.get("market.spread.totalAmountColumn", total)); + numberOfOffersColumn.setGraphic(new AutoTooltipLabel(Res.get("market.spread.numberOfOffersColumn", numberOfOffers))); + numberOfBuyOffersColumn.setGraphic(new AutoTooltipLabel(Res.get("market.spread.numberOfBuyOffersColumn", numberOfBuyOffers))); + numberOfSellOffersColumn.setGraphic(new AutoTooltipLabel((Res.get("market.spread.numberOfSellOffersColumn", numberOfSellOffers)))); + totalAmountColumn.setGraphic(new AutoTooltipLabel(Res.get("market.spread.totalAmountColumn", total))); } @@ -128,7 +130,7 @@ private void updateHeaders() { /////////////////////////////////////////////////////////////////////////////////////////// private TableColumn getCurrencyColumn() { - TableColumn column = new TableColumn(Res.get("shared.currency")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.currency")) { { setMinWidth(160); } @@ -156,7 +158,7 @@ public void updateItem(final SpreadItem item, boolean empty) { } private TableColumn getNumberOfOffersColumn() { - TableColumn column = new TableColumn("Total offers") { + TableColumn column = new TableColumn() { { setMinWidth(100); } @@ -268,7 +270,7 @@ public void updateItem(final SpreadItem item, boolean empty) { } private TableColumn getSpreadColumn() { - TableColumn column = new TableColumn(Res.get("market.spread.spreadColumn")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("market.spread.spreadColumn")) { { setMinWidth(110); } @@ -285,7 +287,7 @@ public TableCell call( public void updateItem(final SpreadItem item, boolean empty) { super.updateItem(item, empty); if (item != null && !empty) { - // TODO maybe show exra colums with item.priceSpread and use real amount diff + // TODO maybe show exra colums with item.priceSpread and use real amount diff // not % based if (item.priceSpread != null) setText(item.percentage); diff --git a/gui/src/main/java/io/bisq/gui/main/market/trades/TradesChartsView.java b/gui/src/main/java/io/bisq/gui/main/market/trades/TradesChartsView.java index bf4cf5be958..4bb6303e0a3 100644 --- a/gui/src/main/java/io/bisq/gui/main/market/trades/TradesChartsView.java +++ b/gui/src/main/java/io/bisq/gui/main/market/trades/TradesChartsView.java @@ -27,6 +27,9 @@ import io.bisq.core.trade.statistics.TradeStatistics2; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; +import io.bisq.gui.components.AutoTooltipTableColumn; +import io.bisq.gui.components.AutoTooltipToggleButton; import io.bisq.gui.main.market.trades.charts.price.CandleStickChart; import io.bisq.gui.main.market.trades.charts.volume.VolumeChart; import io.bisq.gui.util.BSFormatter; @@ -95,6 +98,7 @@ public class TradesChartsView extends ActivatableViewAndModel parentHeightListener; private Pane rootParent; + private ChangeListener priceColumnLabelListener; /////////////////////////////////////////////////////////////////////////////////////////// @@ -117,7 +121,7 @@ public void initialize() { createCharts(); createTable(); - nrOfTradeStatisticsLabel = new Label(" "); // set empty string for layout + nrOfTradeStatisticsLabel = new AutoTooltipLabel(" "); // set empty string for layout nrOfTradeStatisticsLabel.setId("num-offers"); nrOfTradeStatisticsLabel.setPadding(new Insets(-5, 0, -10, 5)); root.getChildren().addAll(toolBox, priceChart, volumeChart, tableView, nrOfTradeStatisticsLabel); @@ -140,6 +144,8 @@ public void initialize() { tradeStatisticsByCurrencyListener = c -> nrOfTradeStatisticsLabel.setText(Res.get("market.trades.nrOfTrades", model.tradeStatisticsByCurrency.size())); parentHeightListener = (observable, oldValue, newValue) -> layout(); + + priceColumnLabelListener = (o, oldVal, newVal) -> priceColumn.setGraphic(new AutoTooltipLabel(newVal)); } @Override @@ -174,7 +180,7 @@ else if (model.getSelectedCurrencyListItem().isPresent()) model.tradeStatisticsByCurrency.addListener(tradeStatisticsByCurrencyListener); priceAxisY.labelProperty().bind(priceColumnLabel); - priceColumn.textProperty().bind(priceColumnLabel); + priceColumnLabel.addListener(priceColumnLabelListener); currencySelectionBinding = EasyBind.combine( model.showAllTradeCurrenciesProperty, model.selectedTradeCurrencyProperty, @@ -184,7 +190,7 @@ else if (model.getSelectedCurrencyListItem().isPresent()) priceColumn.setSortable(!showAll); if (showAll) { - volumeColumn.setText(Res.get("shared.amount")); + volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amount"))); priceColumnLabel.set(Res.get("shared.price")); if (!tableView.getColumns().contains(marketColumn)) tableView.getColumns().add(1, marketColumn); @@ -194,7 +200,7 @@ else if (model.getSelectedCurrencyListItem().isPresent()) volumeChart.setPrefHeight(volumeChart.getMinHeight()); priceSeries.setName(selectedTradeCurrency.getName()); String code = selectedTradeCurrency.getCode(); - volumeColumn.setText(Res.get("shared.amountWithCur", code)); + volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amountWithCur", code))); priceColumnLabel.set(formatter.getPriceWithCurrencyCode(code)); @@ -241,7 +247,7 @@ protected void deactivate() { model.tradeStatisticsByCurrency.removeListener(tradeStatisticsByCurrencyListener); priceAxisY.labelProperty().unbind(); - priceColumn.textProperty().unbind(); + priceColumn.textProperty().removeListener(priceColumnLabelListener); currencySelectionSubscriber.unsubscribe(); @@ -408,7 +414,7 @@ public Number fromString(String string) { /////////////////////////////////////////////////////////////////////////////////////////// private HBox getToolBox() { - Label currencyLabel = new Label(Res.getWithCol("shared.currency")); + Label currencyLabel = new AutoTooltipLabel(Res.getWithCol("shared.currency")); currencyLabel.setPadding(new Insets(0, 4, 0, 0)); currencyComboBox = new ComboBox<>(); @@ -420,7 +426,7 @@ private HBox getToolBox() { Pane spacer = new Pane(); HBox.setHgrow(spacer, Priority.ALWAYS); - Label label = new Label("Interval:"); + Label label = new AutoTooltipLabel("Interval:"); label.setPadding(new Insets(0, 4, 0, 0)); toggleGroup = new ToggleGroup(); @@ -440,7 +446,7 @@ private HBox getToolBox() { } private ToggleButton getToggleButton(String label, TradesChartsViewModel.TickUnit tickUnit, ToggleGroup toggleGroup, String style) { - ToggleButton toggleButton = new ToggleButton(label); + ToggleButton toggleButton = new AutoTooltipToggleButton(label); toggleButton.setPadding(new Insets(0, 5, 0, 5)); toggleButton.setUserData(tickUnit); toggleButton.setToggleGroup(toggleGroup); @@ -460,7 +466,7 @@ private void createTable() { VBox.setVgrow(tableView, Priority.ALWAYS); // date - TableColumn dateColumn = new TableColumn(Res.get("shared.dateTime")) { + TableColumn dateColumn = new AutoTooltipTableColumn(Res.get("shared.dateTime")) { { setMinWidth(190); setMaxWidth(190); @@ -489,7 +495,7 @@ public void updateItem(final TradeStatistics2 item, boolean empty) { tableView.getColumns().add(dateColumn); // market - marketColumn = new TableColumn(Res.get("shared.market")) { + marketColumn = new AutoTooltipTableColumn(Res.get("shared.market")) { { setMinWidth(130); setMaxWidth(130); @@ -542,7 +548,7 @@ public void updateItem(final TradeStatistics2 item, boolean empty) { tableView.getColumns().add(priceColumn); // amount - TableColumn amountColumn = new TableColumn<>(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); + TableColumn amountColumn = new AutoTooltipTableColumn<>(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); amountColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue())); amountColumn.setCellFactory( new Callback, TableCell paymentMethodColumn = new TableColumn<>(Res.get("shared.paymentMethod")); + TableColumn paymentMethodColumn = new AutoTooltipTableColumn<>(Res.get("shared.paymentMethod")); paymentMethodColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue())); paymentMethodColumn.setCellFactory( new Callback, TableCell directionColumn = new TableColumn<>(Res.get("shared.offerType")); + TableColumn directionColumn = new AutoTooltipTableColumn<>(Res.get("shared.offerType")); directionColumn.setCellValueFactory((tradeStatistics) -> new ReadOnlyObjectWrapper<>(tradeStatistics.getValue())); directionColumn.setCellFactory( new Callback, TableCell priceStringConverter; - private final Label openValue = new Label(); - private final Label closeValue = new Label(); - private final Label highValue = new Label(); - private final Label lowValue = new Label(); - private final Label averageValue = new Label(); - private final Label dateValue = new Label(); + private final Label openValue = new AutoTooltipLabel(); + private final Label closeValue = new AutoTooltipLabel(); + private final Label highValue = new AutoTooltipLabel(); + private final Label lowValue = new AutoTooltipLabel(); + private final Label averageValue = new AutoTooltipLabel(); + private final Label dateValue = new AutoTooltipLabel(); CandleTooltip(StringConverter priceStringConverter) { this.priceStringConverter = priceStringConverter; @@ -60,12 +61,12 @@ public class CandleTooltip extends GridPane { setVgap(2); - Label open = new Label(Res.get("market.trades.tooltip.candle.open")); - Label close = new Label(Res.get("market.trades.tooltip.candle.close")); - Label high = new Label(Res.get("market.trades.tooltip.candle.high")); - Label low = new Label(Res.get("market.trades.tooltip.candle.low")); - Label average = new Label(Res.get("market.trades.tooltip.candle.average")); - Label date = new Label(Res.get("market.trades.tooltip.candle.date")); + Label open = new AutoTooltipLabel(Res.get("market.trades.tooltip.candle.open")); + Label close = new AutoTooltipLabel(Res.get("market.trades.tooltip.candle.close")); + Label high = new AutoTooltipLabel(Res.get("market.trades.tooltip.candle.high")); + Label low = new AutoTooltipLabel(Res.get("market.trades.tooltip.candle.low")); + Label average = new AutoTooltipLabel(Res.get("market.trades.tooltip.candle.average")); + Label date = new AutoTooltipLabel(Res.get("market.trades.tooltip.candle.date")); setConstraints(open, 0, 0); setConstraints(openValue, 1, 0); setConstraints(close, 0, 1); @@ -97,4 +98,4 @@ public void update(CandleData candleData) { averageValue.setText(priceStringConverter.toString(candleData.average)); dateValue.setText(candleData.date); } -} \ No newline at end of file +} diff --git a/gui/src/main/java/io/bisq/gui/main/offer/createoffer/CreateOfferView.java b/gui/src/main/java/io/bisq/gui/main/offer/createoffer/CreateOfferView.java index aecf4b13f8e..18d96c08d86 100644 --- a/gui/src/main/java/io/bisq/gui/main/offer/createoffer/CreateOfferView.java +++ b/gui/src/main/java/io/bisq/gui/main/offer/createoffer/CreateOfferView.java @@ -810,7 +810,7 @@ private void addAmountPriceGroup() { imageView = new ImageView(); imageView.setPickOnBounds(true); - directionLabel = new Label(); + directionLabel = new AutoTooltipLabel(); directionLabel.setAlignment(Pos.CENTER); directionLabel.setPadding(new Insets(-5, 0, 0, 0)); directionLabel.setId("direction-icon-label"); @@ -908,9 +908,9 @@ private void addFundingGroup() { GridPane.setColumnSpan(payFundsTitledGroupBg, 3); payFundsTitledGroupBg.setVisible(false); - totalToPayLabel = new Label(Res.get("shared.totalsNeeded")); + totalToPayLabel = new AutoTooltipLabel(Res.get("shared.totalsNeeded")); totalToPayLabel.setVisible(false); - totalToPayInfoIconLabel = new Label(); + totalToPayInfoIconLabel = new AutoTooltipLabel(); totalToPayInfoIconLabel.setVisible(false); HBox totalToPayBox = new HBox(); totalToPayBox.setSpacing(4); @@ -960,17 +960,16 @@ private void addFundingGroup() { fundingHBox.setVisible(false); fundingHBox.setManaged(false); fundingHBox.setSpacing(10); - Button fundFromSavingsWalletButton = new Button(Res.get("shared.fundFromSavingsWalletButton")); - fundFromSavingsWalletButton.setDefaultButton(true); + Button fundFromSavingsWalletButton = new AutoTooltipButton(Res.get("shared.fundFromSavingsWalletButton")); fundFromSavingsWalletButton.setDefaultButton(false); fundFromSavingsWalletButton.setOnAction(e -> model.fundFromSavingsWallet()); - Label label = new Label(Res.get("shared.OR")); + Label label = new AutoTooltipLabel(Res.get("shared.OR")); label.setPadding(new Insets(5, 0, 0, 0)); - Button fundFromExternalWalletButton = new Button(Res.get("shared.fundFromExternalWalletButton")); + Button fundFromExternalWalletButton = new AutoTooltipButton(Res.get("shared.fundFromExternalWalletButton")); fundFromExternalWalletButton.setDefaultButton(false); fundFromExternalWalletButton.setOnAction(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet)); waitingForFundsBusyAnimation = new BusyAnimation(); - waitingForFundsLabel = new Label(); + waitingForFundsLabel = new AutoTooltipLabel(); waitingForFundsLabel.setPadding(new Insets(5, 0, 0, 0)); fundingHBox.getChildren().addAll(fundFromSavingsWalletButton, label, fundFromExternalWalletButton, waitingForFundsBusyAnimation, waitingForFundsLabel); @@ -1034,7 +1033,7 @@ private void addAmountPriceFields() { VBox amountBox = amountInputBoxTuple.second; // x - xLabel = new Label(); + xLabel = new AutoTooltipLabel(); xLabel.setFont(Font.font("Helvetica-Bold", 20)); xLabel.setPadding(new Insets(14, 3, 0, 3)); xLabel.setMinWidth(14); @@ -1054,7 +1053,7 @@ private void addAmountPriceFields() { // Fixed/Percentage toggle ToggleGroup toggleGroup = new ToggleGroup(); - fixedPriceButton = new ToggleButton(Res.get("createOffer.fixed")); + fixedPriceButton = new AutoTooltipToggleButton(Res.get("createOffer.fixed")); editOfferElements.add(fixedPriceButton); fixedPriceButton.setId("toggle-price-left"); fixedPriceButton.setToggleGroup(toggleGroup); @@ -1062,7 +1061,7 @@ private void addAmountPriceFields() { updatePriceToggleButtons(newValue); }); - useMarketBasedPriceButton = new ToggleButton(Res.get("createOffer.percentage")); + useMarketBasedPriceButton = new AutoTooltipToggleButton(Res.get("createOffer.percentage")); editOfferElements.add(useMarketBasedPriceButton); useMarketBasedPriceButton.setId("toggle-price-right"); useMarketBasedPriceButton.setToggleGroup(toggleGroup); @@ -1075,7 +1074,7 @@ private void addAmountPriceFields() { toggleButtonsHBox.getChildren().addAll(fixedPriceButton, useMarketBasedPriceButton); // = - Label resultLabel = new Label("="); + Label resultLabel = new AutoTooltipLabel("="); resultLabel.setFont(Font.font("Helvetica-Bold", 20)); resultLabel.setPadding(new Insets(14, 2, 0, 2)); @@ -1176,7 +1175,7 @@ private void addSecondRow() { Tuple2 amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, Res.get("createOffer.amountPriceBox.minAmountDescription")); - Label xLabel = new Label("x"); + Label xLabel = new AutoTooltipLabel("x"); xLabel.setFont(Font.font("Helvetica-Bold", 20)); xLabel.setPadding(new Insets(14, 3, 0, 3)); xLabel.setVisible(false); // we just use it to get the same layout as the upper row @@ -1240,7 +1239,7 @@ private void createInfoPopover() { } private void addPayInfoEntry(GridPane infoGridPane, int row, String labelText, String value) { - Label label = new Label(labelText); + Label label = new AutoTooltipLabel(labelText); TextField textField = new TextField(value); textField.setMinWidth(500); textField.setEditable(false); diff --git a/gui/src/main/java/io/bisq/gui/main/offer/offerbook/OfferBookView.java b/gui/src/main/java/io/bisq/gui/main/offer/offerbook/OfferBookView.java index 348fe04b662..f3e5a293477 100644 --- a/gui/src/main/java/io/bisq/gui/main/offer/offerbook/OfferBookView.java +++ b/gui/src/main/java/io/bisq/gui/main/offer/offerbook/OfferBookView.java @@ -31,8 +31,7 @@ import io.bisq.gui.Navigation; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; -import io.bisq.gui.components.HyperlinkWithIcon; -import io.bisq.gui.components.PeerInfoIcon; +import io.bisq.gui.components.*; import io.bisq.gui.main.MainView; import io.bisq.gui.main.account.AccountView; import io.bisq.gui.main.account.content.arbitratorselection.ArbitratorSelectionView; @@ -170,7 +169,7 @@ public PaymentMethod fromString(String s) { tableView.getSortOrder().add(priceColumn); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - Label placeholder = new Label(Res.get("table.placeholder.noItems", Res.get("shared.offers"))); + Label placeholder = new AutoTooltipLabel(Res.get("table.placeholder.noItems", Res.get("shared.offers"))); placeholder.setWrapText(true); tableView.setPlaceholder(placeholder); @@ -193,7 +192,7 @@ public PaymentMethod fromString(String s) { paymentMethodColumn.setComparator((o1, o2) -> o1.getOffer().getPaymentMethod().compareTo(o2.getOffer().getPaymentMethod())); avatarColumn.setComparator((o1, o2) -> o1.getOffer().getOwnerNodeAddress().getFullAddress().compareTo(o2.getOffer().getOwnerNodeAddress().getFullAddress())); - nrOfOffersLabel = new Label(""); + nrOfOffersLabel = new AutoTooltipLabel(""); nrOfOffersLabel.setId("num-offers"); GridPane.setHalignment(nrOfOffersLabel, HPos.LEFT); GridPane.setVgrow(nrOfOffersLabel, Priority.NEVER); @@ -253,14 +252,14 @@ protected void activate() { (showAll, code) -> { setDirectionTitles(); if (showAll) { - volumeColumn.setText(Res.get("shared.amountMinMax")); - priceColumn.setText(Res.get("shared.price")); + volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amountMinMax"))); + priceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.price"))); if (!tableView.getColumns().contains(marketColumn)) tableView.getColumns().add(0, marketColumn); } else { - volumeColumn.setText(Res.get("offerbook.volume", code)); - priceColumn.setText(formatter.getPriceWithCurrencyCode(code)); + volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("offerbook.volume", code))); + priceColumn.setGraphic(new AutoTooltipLabel(formatter.getPriceWithCurrencyCode(code))); if (tableView.getColumns().contains(marketColumn)) tableView.getColumns().remove(marketColumn); @@ -488,11 +487,8 @@ private void openPopupForMissingAccountSetup(String headLine, String message, Cl /////////////////////////////////////////////////////////////////////////////////////////// private TableColumn getAmountColumn() { - TableColumn column = new TableColumn(Res.get("shared.BTCMinMax")) { - { - setMinWidth(150); - } - }; + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.BTCMinMax")); + column.setMinWidth(150); column.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue())); column.setCellFactory( new Callback, TableCell getMarketColumn() { - TableColumn column = new TableColumn(Res.get("shared.market")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.market")) { { setMinWidth(120); // setMaxWidth(130); @@ -665,7 +661,7 @@ public void updateItem(final OfferBookListItem item, boolean empty) { } private TableColumn getPaymentMethodColumn() { - TableColumn column = new TableColumn(Res.get("shared.paymentMethod")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.paymentMethod")) { { setMinWidth(125); } @@ -701,7 +697,7 @@ public void updateItem(final OfferBookListItem item, boolean empty) { } private TableColumn getActionColumn() { - TableColumn column = new TableColumn(Res.get("offerbook.wantTo")) { + TableColumn column = new AutoTooltipTableColumn(Res.get("offerbook.wantTo")) { { setMinWidth(80); setSortable(false); @@ -716,7 +712,7 @@ private TableColumn getActionColumn() { public TableCell call(TableColumn column) { return new TableCell() { final ImageView iconView = new ImageView(); - final Button button = new Button(); + final Button button = new AutoTooltipButton(); boolean isTradable, isPaymentAccountValidForOffer, hasMatchingArbitrator, hasSameProtocolVersion, isIgnored, isOfferBanned, isCurrencyBanned, isPaymentMethodBanned, isNodeAddressBanned, isInsufficientTradeLimit; @@ -829,7 +825,7 @@ public void updateItem(final OfferBookListItem newItem, boolean empty) { } private TableColumn getAvatarColumn() { - TableColumn column = new TableColumn("") { + TableColumn column = new AutoTooltipTableColumn("") { { setMinWidth(40); setMaxWidth(40); diff --git a/gui/src/main/java/io/bisq/gui/main/offer/takeoffer/TakeOfferView.java b/gui/src/main/java/io/bisq/gui/main/offer/takeoffer/TakeOfferView.java index 12704d85f0c..39e95854598 100644 --- a/gui/src/main/java/io/bisq/gui/main/offer/takeoffer/TakeOfferView.java +++ b/gui/src/main/java/io/bisq/gui/main/offer/takeoffer/TakeOfferView.java @@ -702,7 +702,7 @@ private void addAmountPriceGroup() { imageView = new ImageView(); imageView.setPickOnBounds(true); - directionLabel = new Label(); + directionLabel = new AutoTooltipLabel(); directionLabel.setAlignment(Pos.CENTER); directionLabel.setPadding(new Insets(-5, 0, 0, 0)); directionLabel.setId("direction-icon-label"); @@ -720,7 +720,7 @@ private void addAmountPriceGroup() { } private void addButtons() { - nextButton = new Button(Res.get("shared.nextStep")); + nextButton = new AutoTooltipButton(Res.get("shared.nextStep")); nextButton.setDefaultButton(true); nextButton.setOnAction(e -> { if (DevEnv.DAO_TRADING_ACTIVATED) @@ -729,7 +729,7 @@ private void addButtons() { onShowPayFundsScreen(); }); - cancelButton1 = new Button(Res.get("shared.cancel")); + cancelButton1 = new AutoTooltipButton(Res.get("shared.cancel")); cancelButton1.setDefaultButton(false); cancelButton1.setId("cancel-button"); cancelButton1.setOnAction(e -> { @@ -762,7 +762,7 @@ private void showFeeOption() { private void addOfferAvailabilityLabel() { offerAvailabilityBusyAnimation = new BusyAnimation(); - offerAvailabilityLabel = new Label(Res.get("takeOffer.fundsBox.isOfferAvailable")); + offerAvailabilityLabel = new AutoTooltipLabel(Res.get("takeOffer.fundsBox.isOfferAvailable")); HBox hBox = new HBox(); hBox.setSpacing(10); @@ -781,9 +781,9 @@ private void addFundingGroup() { GridPane.setColumnSpan(payFundsPane, 3); payFundsPane.setVisible(false); - totalToPayLabel = new Label(Res.get("shared.totalsNeeded")); + totalToPayLabel = new AutoTooltipLabel(Res.get("shared.totalsNeeded")); totalToPayLabel.setVisible(false); - totalToPayInfoIconLabel = new Label(); + totalToPayInfoIconLabel = new AutoTooltipLabel(); totalToPayInfoIconLabel.setVisible(false); HBox totalToPayBox = new HBox(); totalToPayBox.setSpacing(4); @@ -832,17 +832,17 @@ private void addFundingGroup() { fundingHBox.setVisible(false); fundingHBox.setManaged(false); fundingHBox.setSpacing(10); - Button fundFromSavingsWalletButton = new Button(Res.get("shared.fundFromSavingsWalletButton")); + Button fundFromSavingsWalletButton = new AutoTooltipButton(Res.get("shared.fundFromSavingsWalletButton")); fundFromSavingsWalletButton.setDefaultButton(true); fundFromSavingsWalletButton.setDefaultButton(false); fundFromSavingsWalletButton.setOnAction(e -> model.fundFromSavingsWallet()); - Label label = new Label(Res.get("shared.OR")); + Label label = new AutoTooltipLabel(Res.get("shared.OR")); label.setPadding(new Insets(5, 0, 0, 0)); - Button fundFromExternalWalletButton = new Button(Res.get("shared.fundFromExternalWalletButton")); + Button fundFromExternalWalletButton = new AutoTooltipButton(Res.get("shared.fundFromExternalWalletButton")); fundFromExternalWalletButton.setDefaultButton(false); fundFromExternalWalletButton.setOnAction(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet)); waitingForFundsBusyAnimation = new BusyAnimation(false); - waitingForFundsLabel = new Label(); + waitingForFundsLabel = new AutoTooltipLabel(); waitingForFundsLabel.setPadding(new Insets(5, 0, 0, 0)); fundingHBox.getChildren().addAll(fundFromSavingsWalletButton, label, @@ -908,7 +908,7 @@ private void addAmountPriceFields() { VBox amountBox = amountInputBoxTuple.second; // x - Label xLabel = new Label("x"); + Label xLabel = new AutoTooltipLabel("x"); xLabel.setFont(Font.font("Helvetica-Bold", 20)); xLabel.setPadding(new Insets(14, 3, 0, 3)); @@ -923,7 +923,7 @@ private void addAmountPriceFields() { VBox priceBox = priceInputBoxTuple.second; // = - Label resultLabel = new Label("="); + Label resultLabel = new AutoTooltipLabel("="); resultLabel.setFont(Font.font("Helvetica-Bold", 20)); resultLabel.setPadding(new Insets(14, 2, 0, 2)); @@ -968,7 +968,7 @@ private void addSecondRow() { Tuple2 amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, Res.get("takeOffer.amountPriceBox.amountRangeDescription")); - Label xLabel = new Label("x"); + Label xLabel = new AutoTooltipLabel("x"); xLabel.setFont(Font.font("Helvetica-Bold", 20)); xLabel.setPadding(new Insets(14, 3, 0, 3)); xLabel.setVisible(false); // we just use it to get the same layout as the upper row @@ -991,7 +991,7 @@ private void addSecondRow() { /////////////////////////////////////////////////////////////////////////////////////////// private Tuple2 getTradeInputBox(HBox amountValueBox, String promptText) { - Label descriptionLabel = new Label(promptText); + Label descriptionLabel = new AutoTooltipLabel(promptText); descriptionLabel.setId("input-description-label"); descriptionLabel.setPrefWidth(190); @@ -1045,7 +1045,7 @@ private void createInfoPopover() { } private void addPayInfoEntry(GridPane infoGridPane, int row, String labelText, String value) { - Label label = new Label(labelText); + Label label = new AutoTooltipLabel(labelText); TextField textField = new TextField(value); textField.setMinWidth(500); textField.setEditable(false); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/Overlay.java b/gui/src/main/java/io/bisq/gui/main/overlays/Overlay.java index f6ee766f55f..8200c32db8f 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/Overlay.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/Overlay.java @@ -25,6 +25,8 @@ import io.bisq.core.app.BisqEnvironment; import io.bisq.core.user.DontShowAgainLookup; import io.bisq.gui.app.BisqApp; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.BusyAnimation; import io.bisq.gui.main.MainView; import io.bisq.gui.util.GUIUtil; @@ -687,7 +689,7 @@ protected void addHeadLine() { if (headLine != null) { ++rowIndex; - headLineLabel = new Label(headLine); + headLineLabel = new AutoTooltipLabel(headLine); headLineLabel.setMouseTransparent(true); if (headlineStyle != null) @@ -716,7 +718,7 @@ protected void addSeparator() { protected void addMessage() { if (message != null) { - messageLabel = new Label(truncatedMessage); + messageLabel = new AutoTooltipLabel(truncatedMessage); messageLabel.setMouseTransparent(true); messageLabel.setWrapText(true); GridPane.setHalignment(messageLabel, HPos.LEFT); @@ -732,7 +734,7 @@ protected void addMessage() { private void addReportErrorButtons() { messageLabel.setText(Res.get("popup.reportError", truncatedMessage)); - Button logButton = new Button(Res.get("popup.reportError.log")); + Button logButton = new AutoTooltipButton(Res.get("popup.reportError.log")); GridPane.setMargin(logButton, new Insets(20, 0, 0, 0)); GridPane.setHalignment(logButton, HPos.RIGHT); GridPane.setRowIndex(logButton, ++rowIndex); @@ -749,7 +751,7 @@ private void addReportErrorButtons() { } }); - Button gitHubButton = new Button(Res.get("popup.reportError.gitHub")); + Button gitHubButton = new AutoTooltipButton(Res.get("popup.reportError.gitHub")); GridPane.setHalignment(gitHubButton, HPos.RIGHT); GridPane.setRowIndex(gitHubButton, ++rowIndex); GridPane.setColumnIndex(gitHubButton, 1); @@ -785,11 +787,11 @@ protected void addDontShowAgainCheckBox() { protected void addCloseButton() { if (!hideCloseButton) { - closeButton = new Button(closeButtonText == null ? Res.get("shared.close") : closeButtonText); + closeButton = new AutoTooltipButton(closeButtonText == null ? Res.get("shared.close") : closeButtonText); closeButton.setOnAction(event -> doClose()); } if (actionHandlerOptional.isPresent() || actionButtonText != null) { - actionButton = new Button(actionButtonText == null ? Res.get("shared.ok") : actionButtonText); + actionButton = new AutoTooltipButton(actionButtonText == null ? Res.get("shared.ok") : actionButtonText); actionButton.setDefaultButton(true); //TODO app wide focus //actionButton.requestFocus(); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/notifications/Notification.java b/gui/src/main/java/io/bisq/gui/main/overlays/notifications/Notification.java index a57bbd13687..ed33b7d4275 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/notifications/Notification.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/notifications/Notification.java @@ -199,7 +199,7 @@ protected void removeEffectFromBackground() { /* @Override protected void addCloseButton() { - closeButton = new Button(Res.get("shared.close")); + closeButton = new AutoTooltipButton(Res.get("shared.close")); closeButton.setOnAction(event -> { hide(); closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run()); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/DisplayAlertMessageWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/DisplayAlertMessageWindow.java index 68e1859593e..956b6901be6 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/DisplayAlertMessageWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/DisplayAlertMessageWindow.java @@ -19,11 +19,11 @@ import io.bisq.common.locale.Res; import io.bisq.core.alert.Alert; +import io.bisq.gui.components.AutoTooltipButton; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.overlays.Overlay; import io.bisq.gui.util.FormBuilder; import javafx.geometry.Insets; -import javafx.scene.control.Button; import javafx.scene.layout.GridPane; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,7 +78,7 @@ private void addContent() { headLine = Res.get("displayAlertMessageWindow.headline"); headLineLabel.getStyleClass().addAll("headline-label", "error-text"); } - closeButton = new Button(Res.get("shared.close")); + closeButton = new AutoTooltipButton(Res.get("shared.close")); closeButton.setOnAction(e -> { hide(); closeHandlerOptional.ifPresent(Runnable::run); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/EmptyWalletWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/EmptyWalletWindow.java index 9dd8fddbca3..3f6621e165e 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/EmptyWalletWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/EmptyWalletWindow.java @@ -23,6 +23,7 @@ import io.bisq.core.btc.Restrictions; import io.bisq.core.btc.wallet.WalletService; import io.bisq.core.offer.OpenOfferManager; +import io.bisq.gui.components.AutoTooltipButton; import io.bisq.gui.components.InputTextField; import io.bisq.gui.main.overlays.Overlay; import io.bisq.gui.main.overlays.popups.Popup; @@ -113,7 +114,7 @@ private void addContent() { Tuple2 tuple = addLabelInputTextField(gridPane, ++rowIndex, Res.get("emptyWalletWindow.address")); addressInputTextField = tuple.second; - emptyWalletButton = new Button(Res.get("emptyWalletWindow.button")); + emptyWalletButton = new AutoTooltipButton(Res.get("emptyWalletWindow.button")); boolean isBalanceSufficient = Restrictions.isAboveDust(totalBalance); emptyWalletButton.setDefaultButton(isBalanceSufficient); emptyWalletButton.setDisable(!isBalanceSufficient && addressInputTextField.getText().length() > 0); @@ -130,7 +131,7 @@ private void addContent() { } }); - closeButton = new Button(Res.get("shared.cancel")); + closeButton = new AutoTooltipButton(Res.get("shared.cancel")); closeButton.setOnAction(e -> { hide(); closeHandlerOptional.ifPresent(Runnable::run); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/FilterWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/FilterWindow.java index 85c4247c22d..be428f123d5 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/FilterWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/FilterWindow.java @@ -22,6 +22,7 @@ import io.bisq.core.filter.Filter; import io.bisq.core.filter.FilterManager; import io.bisq.core.filter.PaymentAccountFilter; +import io.bisq.gui.components.AutoTooltipButton; import io.bisq.gui.components.InputTextField; import io.bisq.gui.main.overlays.Overlay; import io.bisq.gui.main.overlays.popups.Popup; @@ -170,7 +171,7 @@ private void addContent() { preventPublicBtcNetworkCheckBox.setSelected(filter.isPreventPublicBtcNetwork()); } - Button sendButton = new Button(Res.get("filterWindow.add")); + Button sendButton = new AutoTooltipButton(Res.get("filterWindow.add")); sendButton.setOnAction(e -> { List offerIds = new ArrayList<>(); List nodes = new ArrayList<>(); @@ -260,7 +261,7 @@ private void addContent() { new Popup<>().warning(Res.get("shared.invalidKey")).width(300).onClose(this::blurAgain).show(); }); - Button removeFilterMessageButton = new Button(Res.get("filterWindow.remove")); + Button removeFilterMessageButton = new AutoTooltipButton(Res.get("filterWindow.remove")); removeFilterMessageButton.setOnAction(e -> { if (keyInputTextField.getText().length() > 0) { if (removeFilterMessageHandler.handle(keyInputTextField.getText())) @@ -270,7 +271,7 @@ private void addContent() { } }); - closeButton = new Button(Res.get("shared.close")); + closeButton = new AutoTooltipButton(Res.get("shared.close")); closeButton.setOnAction(e -> { hide(); closeHandlerOptional.ifPresent(Runnable::run); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/QRCodeWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/QRCodeWindow.java index bec5af0710f..dca54ccb937 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/QRCodeWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/QRCodeWindow.java @@ -1,6 +1,7 @@ package io.bisq.gui.main.overlays.windows; import io.bisq.common.locale.Res; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.main.overlays.Overlay; import javafx.geometry.HPos; import javafx.geometry.Insets; @@ -51,7 +52,7 @@ public void show() { gridPane.getChildren().add(qrCodeImageView); String request = bitcoinURI.replace("%20", " ").replace("?", "\n?").replace("&", "\n&"); - Label infoLabel = new Label(Res.get("qRCodeWindow.request", request)); + Label infoLabel = new AutoTooltipLabel(Res.get("qRCodeWindow.request", request)); infoLabel.setMouseTransparent(true); infoLabel.setWrapText(true); infoLabel.setId("popup-qr-code-info"); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/SendAlertMessageWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/SendAlertMessageWindow.java index 15f65c6818c..e6dae54253e 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/SendAlertMessageWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/SendAlertMessageWindow.java @@ -21,6 +21,7 @@ import io.bisq.common.locale.Res; import io.bisq.common.util.Tuple2; import io.bisq.core.alert.Alert; +import io.bisq.gui.components.AutoTooltipButton; import io.bisq.gui.components.InputTextField; import io.bisq.gui.main.overlays.Overlay; import io.bisq.gui.main.overlays.popups.Popup; @@ -121,7 +122,7 @@ private void addContent() { Res.get("sendAlertMessageWindow.version")).second; versionInputTextField.disableProperty().bind(isUpdateCheckBox.selectedProperty().not()); - Button sendButton = new Button(Res.get("sendAlertMessageWindow.send")); + Button sendButton = new AutoTooltipButton(Res.get("sendAlertMessageWindow.send")); sendButton.setOnAction(e -> { final String version = versionInputTextField.getText(); boolean versionOK = false; @@ -148,7 +149,7 @@ private void addContent() { } }); - Button removeAlertMessageButton = new Button(Res.get("sendAlertMessageWindow.remove")); + Button removeAlertMessageButton = new AutoTooltipButton(Res.get("sendAlertMessageWindow.remove")); removeAlertMessageButton.setOnAction(e -> { if (keyInputTextField.getText().length() > 0) { if (removeAlertMessageHandler.handle(keyInputTextField.getText())) @@ -158,7 +159,7 @@ private void addContent() { } }); - closeButton = new Button(Res.get("shared.close")); + closeButton = new AutoTooltipButton(Res.get("shared.close")); closeButton.setOnAction(e -> { hide(); closeHandlerOptional.ifPresent(Runnable::run); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/SendPrivateNotificationWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/SendPrivateNotificationWindow.java index 452f6e41282..66ab50c7ab4 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/SendPrivateNotificationWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/SendPrivateNotificationWindow.java @@ -22,6 +22,7 @@ import io.bisq.common.locale.Res; import io.bisq.common.util.Tuple2; import io.bisq.core.alert.PrivateNotificationPayload; +import io.bisq.gui.components.AutoTooltipButton; import io.bisq.gui.components.InputTextField; import io.bisq.gui.main.overlays.Overlay; import io.bisq.gui.main.overlays.popups.Popup; @@ -119,7 +120,7 @@ private void addContent() { Label first = labelTextAreaTuple2.first; first.setMinWidth(200); - Button sendButton = new Button(Res.get("sendPrivateNotificationWindow.send")); + Button sendButton = new AutoTooltipButton(Res.get("sendPrivateNotificationWindow.send")); sendButton.setOnAction(e -> { if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) { if (!sendPrivateNotificationHandler.handle( @@ -153,7 +154,7 @@ public void onFault(String errorMessage) { } }); - closeButton = new Button(Res.get("shared.close")); + closeButton = new AutoTooltipButton(Res.get("shared.close")); closeButton.setOnAction(e -> { hide(); closeHandlerOptional.ifPresent(Runnable::run); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/TorNetworkSettingsWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/TorNetworkSettingsWindow.java index 5b3b4e4da96..5d68191d3de 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/TorNetworkSettingsWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/TorNetworkSettingsWindow.java @@ -40,6 +40,7 @@ import io.bisq.common.util.Tuple2; import io.bisq.common.util.Utilities; import io.bisq.core.user.Preferences; +import io.bisq.gui.components.AutoTooltipButton; import io.bisq.gui.main.overlays.Overlay; import io.bisq.network.p2p.network.DefaultPluggableTransports; import javafx.collections.FXCollections; @@ -115,17 +116,17 @@ public void show() { } protected void addCloseButton() { - closeButton = new Button(closeButtonText == null ? Res.get("shared.close") : closeButtonText); + closeButton = new AutoTooltipButton(closeButtonText == null ? Res.get("shared.close") : closeButtonText); closeButton.setOnAction(event -> doClose()); if (actionHandlerOptional.isPresent()) { - actionButton = new Button(Res.get("shared.shutDown")); + actionButton = new AutoTooltipButton(Res.get("shared.shutDown")); actionButton.setDefaultButton(true); //TODO app wide focus //actionButton.requestFocus(); actionButton.setOnAction(event -> saveAndShutDown()); - Button urlButton = new Button(Res.get("torNetworkSettingWindow.openTorWebPage")); + Button urlButton = new AutoTooltipButton(Res.get("torNetworkSettingWindow.openTorWebPage")); urlButton.setOnAction(event -> { try { Utilities.openURI(URI.create("https://bridges.torproject.org/bridges")); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/UnlockArbitrationRegistrationWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/UnlockArbitrationRegistrationWindow.java index 9de0ec66b35..419a39d2de8 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/UnlockArbitrationRegistrationWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/UnlockArbitrationRegistrationWindow.java @@ -19,6 +19,8 @@ import io.bisq.common.app.DevEnv; import io.bisq.common.locale.Res; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.InputTextField; import io.bisq.gui.main.overlays.Overlay; import io.bisq.gui.main.overlays.popups.Popup; @@ -103,7 +105,7 @@ protected void setupKeyHandler(Scene scene) { } private void addInputFields() { - Label label = new Label(Res.get("shared.enterPrivKey")); + Label label = new AutoTooltipLabel(Res.get("shared.enterPrivKey")); label.setWrapText(true); GridPane.setMargin(label, new Insets(3, 0, 0, 0)); GridPane.setRowIndex(label, ++rowIndex); @@ -120,7 +122,7 @@ private void addInputFields() { } private void addButtons() { - unlockButton = new Button(Res.get("shared.unlock")); + unlockButton = new AutoTooltipButton(Res.get("shared.unlock")); unlockButton.setDefaultButton(true); unlockButton.setDisable(keyInputTextField.getText().length() == 0); unlockButton.setOnAction(e -> { @@ -130,7 +132,7 @@ private void addButtons() { new Popup<>().warning(Res.get("shared.invalidKey")).width(300).onClose(this::blurAgain).show(); }); - Button closeButton = new Button(Res.get("shared.close")); + Button closeButton = new AutoTooltipButton(Res.get("shared.close")); closeButton.setOnAction(event -> { hide(); closeHandlerOptional.ifPresent(Runnable::run); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/WalletPasswordWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/WalletPasswordWindow.java index 45bba51925d..c330f7d1c35 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/WalletPasswordWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/WalletPasswordWindow.java @@ -23,6 +23,8 @@ import io.bisq.common.util.Tuple2; import io.bisq.core.btc.wallet.WalletsManager; import io.bisq.core.crypto.ScryptUtil; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.BusyAnimation; import io.bisq.gui.components.PasswordTextField; import io.bisq.gui.main.overlays.Overlay; @@ -160,7 +162,7 @@ protected void setupKeyHandler(Scene scene) { } private void addInputFields() { - Label label = new Label(Res.get("password.enterPassword")); + Label label = new AutoTooltipLabel(Res.get("password.enterPassword")); label.setWrapText(true); GridPane.setMargin(label, new Insets(3, 0, 0, 0)); GridPane.setRowIndex(label, ++rowIndex); @@ -177,9 +179,9 @@ private void addInputFields() { private void addButtons() { BusyAnimation busyAnimation = new BusyAnimation(false); - Label deriveStatusLabel = new Label(); + Label deriveStatusLabel = new AutoTooltipLabel(); - unlockButton = new Button(Res.get("shared.unlock")); + unlockButton = new AutoTooltipButton(Res.get("shared.unlock")); unlockButton.setDefaultButton(true); unlockButton.setDisable(true); unlockButton.setOnAction(e -> { @@ -209,14 +211,14 @@ private void addButtons() { } }); - forgotPasswordButton = new Button(Res.get("password.forgotPassword")); + forgotPasswordButton = new AutoTooltipButton(Res.get("password.forgotPassword")); forgotPasswordButton.setOnAction(e -> { forgotPasswordButton.setDisable(true); unlockButton.setDefaultButton(false); showRestoreScreen(); }); - Button cancelButton = new Button(Res.get("shared.cancel")); + Button cancelButton = new AutoTooltipButton(Res.get("shared.cancel")); cancelButton.setOnAction(event -> { hide(); closeHandlerOptional.ifPresent(Runnable::run); @@ -244,7 +246,7 @@ private void addButtons() { } private void showRestoreScreen() { - Label headLine2Label = new Label(Res.get("seed.restore.title")); + Label headLine2Label = new AutoTooltipLabel(Res.get("seed.restore.title")); headLine2Label.setId("popup-headline"); headLine2Label.setMouseTransparent(true); GridPane.setHalignment(headLine2Label, HPos.LEFT); diff --git a/gui/src/main/java/io/bisq/gui/main/overlays/windows/downloadupdate/DisplayUpdateDownloadWindow.java b/gui/src/main/java/io/bisq/gui/main/overlays/windows/downloadupdate/DisplayUpdateDownloadWindow.java index 69eb6ea7fe1..adc21c0daf9 100644 --- a/gui/src/main/java/io/bisq/gui/main/overlays/windows/downloadupdate/DisplayUpdateDownloadWindow.java +++ b/gui/src/main/java/io/bisq/gui/main/overlays/windows/downloadupdate/DisplayUpdateDownloadWindow.java @@ -21,6 +21,8 @@ import io.bisq.common.locale.Res; import io.bisq.common.util.Utilities; import io.bisq.core.alert.Alert; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.BusyAnimation; import io.bisq.gui.main.overlays.Overlay; import io.bisq.gui.main.overlays.popups.Popup; @@ -103,12 +105,12 @@ private void addContent() { gridPane.getChildren().add(separator); - Button downloadButton = new Button(Res.get("displayUpdateDownloadWindow.button.label")); + Button downloadButton = new AutoTooltipButton(Res.get("displayUpdateDownloadWindow.button.label")); downloadButton.setDefaultButton(true); busyAnimation = new BusyAnimation(false); - Label statusLabel = new Label(); + Label statusLabel = new AutoTooltipLabel(); statusLabel.managedProperty().bind(statusLabel.visibleProperty()); HBox hBox = new HBox(); @@ -264,9 +266,9 @@ private void addContent() { @Override protected void addCloseButton() { - closeButton = new Button(Res.get("displayUpdateDownloadWindow.button.ignoreDownload")); + closeButton = new AutoTooltipButton(Res.get("displayUpdateDownloadWindow.button.ignoreDownload")); closeButton.setOnAction(event -> doClose()); - actionButton = new Button(Res.get("displayUpdateDownloadWindow.button.downloadLater")); + actionButton = new AutoTooltipButton(Res.get("displayUpdateDownloadWindow.button.downloadLater")); actionButton.setDefaultButton(false); actionButton.setOnAction(event -> { cleanup(); diff --git a/gui/src/main/java/io/bisq/gui/main/portfolio/closedtrades/ClosedTradesView.java b/gui/src/main/java/io/bisq/gui/main/portfolio/closedtrades/ClosedTradesView.java index 1904c5d75d5..d68c3969312 100644 --- a/gui/src/main/java/io/bisq/gui/main/portfolio/closedtrades/ClosedTradesView.java +++ b/gui/src/main/java/io/bisq/gui/main/portfolio/closedtrades/ClosedTradesView.java @@ -29,6 +29,7 @@ import io.bisq.core.user.Preferences; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.components.PeerInfoIcon; import io.bisq.gui.main.overlays.windows.OfferDetailsWindow; @@ -87,18 +88,18 @@ public ClosedTradesView(ClosedTradesViewModel model, @Override public void initialize() { - priceColumn.setText(Res.get("shared.price")); - amountColumn.setText(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); - volumeColumn.setText(Res.get("shared.volume")); - marketColumn.setText(Res.get("shared.market")); - directionColumn.setText(Res.get("shared.offerType")); - dateColumn.setText(Res.get("shared.dateTime")); - tradeIdColumn.setText(Res.get("shared.tradeId")); - stateColumn.setText(Res.get("shared.state")); + priceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.price"))); + amountColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode()))); + volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.volume"))); + marketColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.market"))); + directionColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.offerType"))); + dateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.dateTime"))); + tradeIdColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.tradeId"))); + stateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.state"))); avatarColumn.setText(""); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("table.placeholder.noItems", Res.get("shared.trades")))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noItems", Res.get("shared.trades")))); setTradeIdColumnCellFactory(); setDirectionColumnCellFactory(); diff --git a/gui/src/main/java/io/bisq/gui/main/portfolio/failedtrades/FailedTradesView.java b/gui/src/main/java/io/bisq/gui/main/portfolio/failedtrades/FailedTradesView.java index 68712023b87..36e445840f7 100644 --- a/gui/src/main/java/io/bisq/gui/main/portfolio/failedtrades/FailedTradesView.java +++ b/gui/src/main/java/io/bisq/gui/main/portfolio/failedtrades/FailedTradesView.java @@ -20,12 +20,16 @@ import io.bisq.common.locale.Res; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.overlays.windows.TradeDetailsWindow; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.collections.transformation.SortedList; import javafx.fxml.FXML; -import javafx.scene.control.*; +import javafx.scene.control.TableCell; +import javafx.scene.control.TableColumn; +import javafx.scene.control.TableView; +import javafx.scene.control.Tooltip; import javafx.scene.layout.VBox; import javafx.util.Callback; @@ -50,17 +54,17 @@ public FailedTradesView(FailedTradesViewModel model, TradeDetailsWindow tradeDet @Override public void initialize() { - priceColumn.setText(Res.get("shared.price")); - amountColumn.setText(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); - volumeColumn.setText(Res.get("shared.volume")); - marketColumn.setText(Res.get("shared.market")); - directionColumn.setText(Res.get("shared.offerType")); - dateColumn.setText(Res.get("shared.dateTime")); - tradeIdColumn.setText(Res.get("shared.tradeId")); - stateColumn.setText(Res.get("shared.state")); + priceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.price"))); + amountColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode()))); + volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.volume"))); + marketColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.market"))); + directionColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.offerType"))); + dateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.dateTime"))); + tradeIdColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.tradeId"))); + stateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.state"))); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("table.placeholder.noItems", Res.get("shared.trades")))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noItems", Res.get("shared.trades")))); setTradeIdColumnCellFactory(); setDirectionColumnCellFactory(); diff --git a/gui/src/main/java/io/bisq/gui/main/portfolio/openoffer/OpenOffersView.java b/gui/src/main/java/io/bisq/gui/main/portfolio/openoffer/OpenOffersView.java index 98b63d3967a..82543a3ded9 100644 --- a/gui/src/main/java/io/bisq/gui/main/portfolio/openoffer/OpenOffersView.java +++ b/gui/src/main/java/io/bisq/gui/main/portfolio/openoffer/OpenOffersView.java @@ -25,6 +25,8 @@ import io.bisq.gui.Navigation; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.main.MainView; import io.bisq.gui.main.funds.FundsView; @@ -62,14 +64,14 @@ public OpenOffersView(OpenOffersViewModel model, Navigation navigation, OfferDet @Override public void initialize() { - priceColumn.setText(Res.get("shared.price")); - amountColumn.setText(Res.get("shared.BTCMinMax")); - volumeColumn.setText(Res.get("shared.amountMinMax")); - marketColumn.setText(Res.get("shared.market")); - directionColumn.setText(Res.get("shared.offerType")); - dateColumn.setText(Res.get("shared.dateTime")); - offerIdColumn.setText(Res.get("shared.offerId")); - removeItemColumn.setText(""); + priceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.price"))); + amountColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.BTCMinMax"))); + volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amountMinMax"))); + marketColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.market"))); + directionColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.offerType"))); + dateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.dateTime"))); + offerIdColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.offerId"))); + removeItemColumn.setGraphic(new AutoTooltipLabel("")); setOfferIdColumnCellFactory(); setDirectionColumnCellFactory(); @@ -81,7 +83,7 @@ public void initialize() { setRemoveColumnCellFactory(); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("table.placeholder.noItems", Res.get("shared.openOffers")))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noItems", Res.get("shared.openOffers")))); offerIdColumn.setComparator((o1, o2) -> o1.getOffer().getId().compareTo(o2.getOffer().getId())); directionColumn.setComparator((o1, o2) -> o1.getOffer().getDirection().compareTo(o2.getOffer().getDirection())); @@ -319,7 +321,7 @@ public void updateItem(final OpenOfferListItem item, boolean empty) { if (item != null && !empty) { if (button == null) { iconView.setId("image-remove"); - button = new Button(Res.get("shared.remove")); + button = new AutoTooltipButton(Res.get("shared.remove")); button.setMinWidth(70); button.setGraphic(iconView); setGraphic(button); diff --git a/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/PendingTradesView.java b/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/PendingTradesView.java index 3f7ddf88c41..a6f3d79bd36 100644 --- a/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/PendingTradesView.java +++ b/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/PendingTradesView.java @@ -26,6 +26,7 @@ import io.bisq.core.user.Preferences; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.HyperlinkWithIcon; import io.bisq.gui.components.PeerInfoIcon; import io.bisq.gui.main.overlays.popups.Popup; @@ -39,7 +40,10 @@ import javafx.geometry.Insets; import javafx.scene.Node; import javafx.scene.Scene; -import javafx.scene.control.*; +import javafx.scene.control.TableCell; +import javafx.scene.control.TableColumn; +import javafx.scene.control.TableView; +import javafx.scene.control.Tooltip; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.layout.Priority; @@ -86,14 +90,14 @@ public PendingTradesView(PendingTradesViewModel model, TradeDetailsWindow tradeD @Override public void initialize() { - priceColumn.setText(Res.get("shared.price")); - amountColumn.setText(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); - volumeColumn.setText(Res.get("shared.volume")); - marketColumn.setText(Res.get("shared.market")); - roleColumn.setText(Res.get("portfolio.pending.role")); - dateColumn.setText(Res.get("shared.dateTime")); - tradeIdColumn.setText(Res.get("shared.tradeId")); - paymentMethodColumn.setText(Res.get("shared.paymentMethod")); + priceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.price"))); + amountColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode()))); + volumeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.volume"))); + marketColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.market"))); + roleColumn.setGraphic(new AutoTooltipLabel(Res.get("portfolio.pending.role"))); + dateColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.dateTime"))); + tradeIdColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.tradeId"))); + paymentMethodColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.paymentMethod"))); avatarColumn.setText(""); setTradeIdColumnCellFactory(); @@ -107,7 +111,7 @@ public void initialize() { setAvatarColumnCellFactory(); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("table.placeholder.noItems", Res.get("shared.openTrades")))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noItems", Res.get("shared.openTrades")))); tableView.setMinHeight(100); tradeIdColumn.setComparator((o1, o2) -> o1.getTrade().getId().compareTo(o2.getTrade().getId())); diff --git a/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/steps/TradeWizardItem.java b/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/steps/TradeWizardItem.java index 248fa101b79..19b48c0f202 100644 --- a/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/steps/TradeWizardItem.java +++ b/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/steps/TradeWizardItem.java @@ -19,6 +19,7 @@ import de.jensd.fx.fontawesome.AwesomeDude; import de.jensd.fx.fontawesome.AwesomeIcon; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.util.Colors; import javafx.geometry.Insets; import javafx.geometry.Pos; @@ -45,7 +46,7 @@ public TradeWizardItem(Class viewClass, String title) { public void setDisabled() { setId("trade-wizard-item-background-disabled"); - Label icon = new Label(); + Label icon = new AutoTooltipLabel(); icon.setPadding(new Insets(-3, 6, 0, 0)); icon.setTextFill(Colors.LIGHT_GREY); AwesomeDude.setIcon(icon, AwesomeIcon.SPINNER); @@ -54,7 +55,7 @@ public void setDisabled() { public void setActive() { setId("trade-wizard-item-background-active"); - Label icon = new Label(); + Label icon = new AutoTooltipLabel(); icon.setPadding(new Insets(-3, 6, 0, 0)); icon.setTextFill(Colors.BLUE); AwesomeDude.setIcon(icon, AwesomeIcon.ARROW_RIGHT); @@ -63,7 +64,7 @@ public void setActive() { public void setCompleted() { setId("trade-wizard-item-background-completed"); - Label icon = new Label(); + Label icon = new AutoTooltipLabel(); icon.setPadding(new Insets(-3, 6, 0, 0)); icon.setTextFill(Colors.GREEN); AwesomeDude.setIcon(icon, AwesomeIcon.OK); diff --git a/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java b/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java index 0d61521d645..8330891b098 100644 --- a/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java +++ b/gui/src/main/java/io/bisq/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java @@ -31,6 +31,8 @@ import io.bisq.core.btc.wallet.BtcWalletService; import io.bisq.core.user.DontShowAgainLookup; import io.bisq.core.util.CoinUtil; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.InputTextField; import io.bisq.gui.components.TitledGroupBg; import io.bisq.gui.main.MainView; @@ -140,11 +142,11 @@ protected void addContent() { HBox hBox = new HBox(); hBox.setSpacing(10); - useSavingsWalletButton = new Button(Res.get("portfolio.pending.step5_buyer.moveToBisqWallet")); + useSavingsWalletButton = new AutoTooltipButton(Res.get("portfolio.pending.step5_buyer.moveToBisqWallet")); useSavingsWalletButton.setDefaultButton(false); - Label label = new Label(Res.get("shared.OR")); + Label label = new AutoTooltipLabel(Res.get("shared.OR")); label.setPadding(new Insets(5, 0, 0, 0)); - withdrawToExternalWalletButton = new Button(Res.get("portfolio.pending.step5_buyer.withdrawExternal")); + withdrawToExternalWalletButton = new AutoTooltipButton(Res.get("portfolio.pending.step5_buyer.withdrawExternal")); withdrawToExternalWalletButton.setDefaultButton(false); hBox.getChildren().addAll(useSavingsWalletButton, label, withdrawToExternalWalletButton); GridPane.setRowIndex(hBox, ++gridRow); diff --git a/gui/src/main/java/io/bisq/gui/main/settings/network/NetworkSettingsView.java b/gui/src/main/java/io/bisq/gui/main/settings/network/NetworkSettingsView.java index f93c3542213..b787b283c40 100644 --- a/gui/src/main/java/io/bisq/gui/main/settings/network/NetworkSettingsView.java +++ b/gui/src/main/java/io/bisq/gui/main/settings/network/NetworkSettingsView.java @@ -30,6 +30,7 @@ import io.bisq.gui.common.model.Activatable; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.InputTextField; import io.bisq.gui.components.TitledGroupBg; import io.bisq.gui.main.overlays.popups.Popup; @@ -135,14 +136,14 @@ public void initialize() { reSyncSPVChainLabel.setText(Res.getWithCol("settings.net.reSyncSPVChainLabel")); reSyncSPVChainButton.setText(Res.get("settings.net.reSyncSPVChainButton")); p2PPeersLabel.setText(Res.get("settings.net.p2PPeersLabel")); - onionAddressColumn.setText(Res.get("settings.net.onionAddressColumn")); - creationDateColumn.setText(Res.get("settings.net.creationDateColumn")); - connectionTypeColumn.setText(Res.get("settings.net.connectionTypeColumn")); + onionAddressColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.onionAddressColumn"))); + creationDateColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.creationDateColumn"))); + connectionTypeColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.connectionTypeColumn"))); totalTrafficLabel.setText(Res.get("settings.net.totalTrafficLabel")); - roundTripTimeColumn.setText(Res.get("settings.net.roundTripTimeColumn")); - sentBytesColumn.setText(Res.get("settings.net.sentBytesColumn")); - receivedBytesColumn.setText(Res.get("settings.net.receivedBytesColumn")); - peerTypeColumn.setText(Res.get("settings.net.peerTypeColumn")); + roundTripTimeColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.roundTripTimeColumn"))); + sentBytesColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.sentBytesColumn"))); + receivedBytesColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.receivedBytesColumn"))); + peerTypeColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.peerTypeColumn"))); openTorSettingsButton.setText(Res.get("settings.net.openTorSettingsButton")); GridPane.setMargin(bitcoinPeersLabel, new Insets(4, 0, 0, 0)); @@ -155,7 +156,7 @@ public void initialize() { tableView.setMinHeight(180); tableView.setPrefHeight(180); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Res.get("table.placeholder.noData"))); + tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData"))); tableView.getSortOrder().add(creationDateColumn); creationDateColumn.setSortType(TableColumn.SortType.ASCENDING); diff --git a/gui/src/main/java/io/bisq/gui/main/settings/preferences/PreferencesView.java b/gui/src/main/java/io/bisq/gui/main/settings/preferences/PreferencesView.java index 09f82c8c2b3..f0101c4003e 100644 --- a/gui/src/main/java/io/bisq/gui/main/settings/preferences/PreferencesView.java +++ b/gui/src/main/java/io/bisq/gui/main/settings/preferences/PreferencesView.java @@ -31,6 +31,8 @@ import io.bisq.gui.common.model.Activatable; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.InputTextField; import io.bisq.gui.components.TitledGroupBg; import io.bisq.gui.main.overlays.popups.Popup; @@ -267,7 +269,7 @@ public BaseCurrencyNetwork fromString(String string) { autoSelectArbitratorsCheckBox = addLabelCheckBox(root, ++gridRow, Res.get("setting.preferences.autoSelectArbitrators"), "").second; - // ignoreTraders + // ignoreTraders ignoreTradersListInputTextField = addLabelInputTextField(root, ++gridRow, Res.get("setting.preferences.ignorePeers")).second; ignoreTradersListListener = (observable, oldValue, newValue) -> @@ -303,16 +305,16 @@ public TradeCurrency fromString(String s) { fiatCurrenciesListView = fiatTuple.second; fiatCurrenciesListView.setMinHeight(2 * Layout.LIST_ROW_HEIGHT + 2); fiatCurrenciesListView.setPrefHeight(3 * Layout.LIST_ROW_HEIGHT + 2); - Label placeholder = new Label(Res.get("setting.preferences.noFiat")); + Label placeholder = new AutoTooltipLabel(Res.get("setting.preferences.noFiat")); placeholder.setWrapText(true); fiatCurrenciesListView.setPlaceholder(placeholder); fiatCurrenciesListView.setCellFactory(new Callback, ListCell>() { @Override public ListCell call(ListView list) { return new ListCell() { - final Label label = new Label(); + final Label label = new AutoTooltipLabel(); final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON); - final Button removeButton = new Button("", icon); + final Button removeButton = new AutoTooltipButton("", icon); final AnchorPane pane = new AnchorPane(label, removeButton); { @@ -354,16 +356,16 @@ public void updateItem(final FiatCurrency item, boolean empty) { GridPane.setColumnIndex(cryptoCurrenciesListView, 3); cryptoCurrenciesListView.setMinHeight(2 * Layout.LIST_ROW_HEIGHT + 2); cryptoCurrenciesListView.setPrefHeight(3 * Layout.LIST_ROW_HEIGHT + 2); - placeholder = new Label(Res.get("setting.preferences.noAltcoins")); + placeholder = new AutoTooltipLabel(Res.get("setting.preferences.noAltcoins")); placeholder.setWrapText(true); cryptoCurrenciesListView.setPlaceholder(placeholder); cryptoCurrenciesListView.setCellFactory(new Callback, ListCell>() { @Override public ListCell call(ListView list) { return new ListCell() { - final Label label = new Label(); + final Label label = new AutoTooltipLabel(); final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON); - final Button removeButton = new Button("", icon); + final Button removeButton = new AutoTooltipButton("", icon); final AnchorPane pane = new AnchorPane(label, removeButton); { @@ -449,12 +451,12 @@ private void initializeDisplayOptions() { private void activateGeneralOptions() { List baseCurrencyNetworks = Arrays.asList(BaseCurrencyNetwork.values()); - // We don't support DOGE anymore due lack of interest but leave it in the code in case it will get + // We don't support DOGE anymore due lack of interest but leave it in the code in case it will get // re-activated some day baseCurrencyNetworks = baseCurrencyNetworks.stream() .filter(e -> !e.isDoge()) .collect(Collectors.toList()); - + // show ony mainnet in production version if (!DevEnv.DEV_MODE) baseCurrencyNetworks = baseCurrencyNetworks.stream() diff --git a/gui/src/main/java/io/bisq/gui/util/FormBuilder.java b/gui/src/main/java/io/bisq/gui/util/FormBuilder.java index b65e1b490ac..c83d592b613 100644 --- a/gui/src/main/java/io/bisq/gui/util/FormBuilder.java +++ b/gui/src/main/java/io/bisq/gui/util/FormBuilder.java @@ -96,7 +96,7 @@ public static Label addLabel(GridPane gridPane, int rowIndex, String title) { } public static Label addLabel(GridPane gridPane, int rowIndex, String title, double top) { - Label label = new Label(title); + Label label = new AutoTooltipLabel(title); GridPane.setRowIndex(label, rowIndex); GridPane.setMargin(label, new Insets(top, 0, 0, 0)); gridPane.getChildren().add(label); @@ -121,7 +121,7 @@ public static Label addMultilineLabel(GridPane gridPane, int rowIndex, double to } public static Label addMultilineLabel(GridPane gridPane, int rowIndex, String text, double top) { - Label label = new Label(text); + Label label = new AutoTooltipLabel(text); label.setWrapText(true); GridPane.setHalignment(label, HPos.LEFT); GridPane.setRowIndex(label, rowIndex); @@ -342,7 +342,7 @@ public static Tuple3 addLabelInputTextFieldButton Label label = addLabel(gridPane, rowIndex, title, 0); InputTextField inputTextField = new InputTextField(); - Button button = new Button(buttonTitle); + Button button = new AutoTooltipButton(buttonTitle); button.setDefaultButton(true); HBox hBox = new HBox(); @@ -372,7 +372,7 @@ public static Tuple3 addLabelTextFieldButton(GridPane textField.setEditable(false); textField.setMouseTransparent(true); textField.setFocusTraversable(false); - Button button = new Button(buttonTitle); + Button button = new AutoTooltipButton(buttonTitle); button.setDefaultButton(true); HBox hBox = new HBox(); @@ -396,7 +396,7 @@ public static Tuple4 addLabelInput Label label1 = addLabel(gridPane, rowIndex, title1, 0); InputTextField inputTextField1 = new InputTextField(); - Label label2 = new Label(title2); + Label label2 = new AutoTooltipLabel(title2); HBox.setMargin(label2, new Insets(5, 0, 0, 0)); InputTextField inputTextField2 = new InputTextField(); @@ -422,7 +422,7 @@ public static Tuple4 addLabelTextFieldLabelT textField1.setEditable(false); textField1.setMouseTransparent(true); textField1.setFocusTraversable(false); - Label label2 = new Label(title2); + Label label2 = new AutoTooltipLabel(title2); HBox.setMargin(label2, new Insets(5, 0, 0, 0)); TextField textField2 = new TextField(); textField2.setEditable(false); @@ -449,7 +449,7 @@ public static Tuple2 addButtonCheckBox(GridPane gridPane, int } public static Tuple2 addButtonCheckBox(GridPane gridPane, int rowIndex, String buttonTitle, String checkBoxTitle, double top) { - Button button = new Button(buttonTitle); + Button button = new AutoTooltipButton(buttonTitle); button.setDefaultButton(true); CheckBox checkBox = new CheckBox(checkBoxTitle); HBox.setMargin(checkBox, new Insets(6, 0, 0, 0)); @@ -660,7 +660,7 @@ public static Tuple3 addLabelComboBoxButton(GridPane gr HBox hBox = new HBox(); hBox.setSpacing(10); - Button button = new Button(buttonTitle); + Button button = new AutoTooltipButton(buttonTitle); button.setDefaultButton(true); ComboBox comboBox = new ComboBox(); @@ -825,7 +825,7 @@ public static Tuple2 addLabelButton(GridPane gridPane, int rowInd public static Tuple2 addLabelButton(GridPane gridPane, int rowIndex, String labelText, String buttonTitle, double top) { Label label = addLabel(gridPane, rowIndex, labelText, top); - Button button = new Button(buttonTitle); + Button button = new AutoTooltipButton(buttonTitle); button.setDefaultButton(true); GridPane.setRowIndex(button, rowIndex); GridPane.setColumnIndex(button, 1); @@ -847,7 +847,7 @@ public static Button addButtonAfterGroup(GridPane gridPane, int rowIndex, String } public static Button addButton(GridPane gridPane, int rowIndex, String title, double top) { - Button button = new Button(title); + Button button = new AutoTooltipButton(title); button.setDefaultButton(true); GridPane.setRowIndex(button, rowIndex); GridPane.setColumnIndex(button, 1); @@ -882,9 +882,9 @@ public static Tuple2 add2Buttons(GridPane gridPane, double top) { HBox hBox = new HBox(); hBox.setSpacing(10); - Button button1 = new Button(title1); + Button button1 = new AutoTooltipButton(title1); button1.setDefaultButton(true); - Button button2 = new Button(title2); + Button button2 = new AutoTooltipButton(title2); hBox.getChildren().addAll(button1, button2); GridPane.setRowIndex(hBox, rowIndex); GridPane.setColumnIndex(hBox, 1); @@ -921,10 +921,10 @@ public static Tuple3 add3Buttons(GridPane gridPane, double top) { HBox hBox = new HBox(); hBox.setSpacing(10); - Button button1 = new Button(title1); + Button button1 = new AutoTooltipButton(title1); button1.setDefaultButton(true); - Button button2 = new Button(title2); - Button button3 = new Button(title3); + Button button2 = new AutoTooltipButton(title2); + Button button3 = new AutoTooltipButton(title3); hBox.getChildren().addAll(button1, button2, button3); GridPane.setRowIndex(hBox, rowIndex); GridPane.setColumnIndex(hBox, 1); @@ -951,12 +951,12 @@ public static Tuple3 addButtonBusyAnimationLabel(G HBox hBox = new HBox(); hBox.setSpacing(10); - Button button = new Button(buttonTitle); + Button button = new AutoTooltipButton(buttonTitle); button.setDefaultButton(true); BusyAnimation busyAnimation = new BusyAnimation(false); - Label label = new Label(); + Label label = new AutoTooltipLabel(); hBox.setAlignment(Pos.CENTER_LEFT); hBox.getChildren().addAll(button, busyAnimation, label); @@ -980,7 +980,7 @@ public static Tuple3 getEditableValueCurrencyBox(St input.setId("text-input-with-currency-text-field"); input.setPromptText(promptText); - Label currency = new Label(Res.getBaseCurrencyCode()); + Label currency = new AutoTooltipLabel(Res.getBaseCurrencyCode()); currency.setId("currency-info-label"); HBox box = new HBox(); @@ -997,7 +997,7 @@ public static Tuple3 getNonEditableValueCurrencyBox() { textField.setEditable(false); textField.setFocusTraversable(false); - Label currency = new Label(Res.getBaseCurrencyCode()); + Label currency = new AutoTooltipLabel(Res.getBaseCurrencyCode()); currency.setId("currency-info-label-disabled"); HBox box = new HBox(); @@ -1012,7 +1012,7 @@ public static Tuple3 getAmountCurrencyBox(String pr input.setId("text-input-with-currency-text-field"); input.setPromptText(promptText); - Label currency = new Label(Res.getBaseCurrencyCode()); + Label currency = new AutoTooltipLabel(Res.getBaseCurrencyCode()); currency.setId("currency-info-label"); HBox box = new HBox(); @@ -1029,7 +1029,7 @@ public static Tuple2 getTradeInputBox(HBox amountValueBox) { } public static Tuple2 getTradeInputBox(HBox amountValueBox, String descriptionText) { - Label descriptionLabel = new Label(descriptionText); + Label descriptionLabel = new AutoTooltipLabel(descriptionText); descriptionLabel.setId("input-description-label"); descriptionLabel.setPrefWidth(170); diff --git a/gui/src/test/java/io/bisq/gui/AwesomeFontDemo.java b/gui/src/test/java/io/bisq/gui/AwesomeFontDemo.java index 492e1ca2029..3f25a0af779 100644 --- a/gui/src/test/java/io/bisq/gui/AwesomeFontDemo.java +++ b/gui/src/test/java/io/bisq/gui/AwesomeFontDemo.java @@ -19,6 +19,8 @@ import de.jensd.fx.fontawesome.AwesomeDude; import de.jensd.fx.fontawesome.AwesomeIcon; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; @@ -46,8 +48,8 @@ public void start(Stage primaryStage) { List values = new ArrayList<>(Arrays.asList(AwesomeIcon.values())); values.sort((o1, o2) -> o1.name().compareTo(o2.name())); for (AwesomeIcon icon : values) { - Label label = new Label(); - Button button = new Button(icon.name(), label); + Label label = new AutoTooltipLabel(); + Button button = new AutoTooltipButton(icon.name(), label); AwesomeDude.setIcon(label, icon); root.getChildren().add(button); } diff --git a/gui/src/test/java/io/bisq/gui/BindingTest.java b/gui/src/test/java/io/bisq/gui/BindingTest.java index 9bbbfd421ef..f1a9d509100 100644 --- a/gui/src/test/java/io/bisq/gui/BindingTest.java +++ b/gui/src/test/java/io/bisq/gui/BindingTest.java @@ -17,6 +17,8 @@ package io.bisq.gui; +import io.bisq.gui.components.AutoTooltipButton; +import io.bisq.gui.components.AutoTooltipLabel; import javafx.application.Application; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; @@ -41,12 +43,12 @@ public void start(Stage primaryStage) { VBox root = new VBox(); root.setSpacing(20); - Label label = new Label(); + Label label = new AutoTooltipLabel(); StringProperty txt = new SimpleStringProperty(); txt.set("-"); label.textProperty().bind(txt); - Button button = new Button("count up"); + Button button = new AutoTooltipButton("count up"); button.setOnAction(e -> txt.set("counter " + counter++)); root.getChildren().addAll(label, button);