diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavButton.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavButton.java index 217b35dfbf..4632bf1312 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavButton.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavButton.java @@ -58,7 +58,8 @@ class LeftNavButton extends Pane implements Toggle { protected final ObjectProperty toggleGroupProperty = new SimpleObjectProperty<>(); protected final BooleanProperty selectedProperty = new SimpleBooleanProperty(); protected final BooleanProperty highlightedProperty = new SimpleBooleanProperty(); - protected final Label label; + @Getter + protected final Label buttonLabel; protected final Tooltip tooltip; @Nullable @@ -108,12 +109,12 @@ class LeftNavButton extends Pane implements Toggle { getChildren().add(icon); } - label = new Label(title); - label.setLayoutX(LABEL_X_POS_EXPANDED); - label.setLayoutY((calculateHeight() - 21) * 0.5); - label.setMouseTransparent(true); + buttonLabel = new Label(title); + buttonLabel.setLayoutX(LABEL_X_POS_EXPANDED); + buttonLabel.setLayoutY((calculateHeight() - 21) * 0.5); + buttonLabel.setMouseTransparent(true); - getChildren().add(label); + getChildren().add(buttonLabel); if (hasSubmenu) { verticalExpandIcon = BisqIconButton.createIconButton("nav-arrow-right"); @@ -150,7 +151,7 @@ class LeftNavButton extends Pane implements Toggle { hoverProperty().addListener((ov, wasHovered, isHovered) -> { if (isSelected() || isHighlighted()) return; - Layout.chooseStyleClass(label, "bisq-text-white", "bisq-text-grey-9", isHovered); + Layout.chooseStyleClass(buttonLabel, "bisq-text-white", "bisq-text-grey-9", isHovered); if (icon != null) { getChildren().set(0, isHovered ? iconHover : icon); } @@ -174,9 +175,9 @@ void setVerticalExpanded(boolean subMenuExpanded) { protected void applyStyle() { boolean isHighlighted = isSelected() || isHighlighted(); Layout.addStyleClass(this, "bisq-dark-bg"); - Layout.toggleStyleClass(label, "bisq-text-green", isSelected()); - Layout.toggleStyleClass(label, "bisq-text-white", isHighlighted()); - Layout.toggleStyleClass(label, "bisq-text-grey-9", !isHighlighted); + Layout.toggleStyleClass(buttonLabel, "bisq-text-green", isSelected()); + Layout.toggleStyleClass(buttonLabel, "bisq-text-white", isHighlighted()); + Layout.toggleStyleClass(buttonLabel, "bisq-text-grey-9", !isHighlighted); if (icon != null) { getChildren().set(0, isSelected() ? iconActive : isHighlighted ? iconHover : icon); @@ -190,9 +191,9 @@ public final void setOnAction(Runnable handler) { public void setHorizontalExpanded(boolean menuExpanded, int duration) { if (menuExpanded) { Tooltip.uninstall(this, tooltip); - label.setVisible(true); - label.setManaged(true); - Transitions.fadeIn(label, duration); + buttonLabel.setVisible(true); + buttonLabel.setManaged(true); + Transitions.fadeIn(buttonLabel, duration); if (hasSubmenu) { Objects.requireNonNull(verticalExpandCollapseIcon).setVisible(true); Transitions.fadeIn(verticalExpandCollapseIcon, 3 * duration, 0.4, null); @@ -202,9 +203,9 @@ public void setHorizontalExpanded(boolean menuExpanded, int duration) { if (hasSubmenu) { Transitions.fadeOut(verticalExpandCollapseIcon, duration / 2, () -> Objects.requireNonNull(verticalExpandCollapseIcon).setVisible(false)); } - Transitions.fadeOut(label, duration, () -> { - label.setVisible(false); - label.setManaged(false); + Transitions.fadeOut(buttonLabel, duration, () -> { + buttonLabel.setVisible(false); + buttonLabel.setManaged(false); }); } } diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavSubButton.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavSubButton.java index 3bd9866c34..f204adaba0 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavSubButton.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavSubButton.java @@ -47,19 +47,19 @@ class LeftNavSubButton extends LeftNavButton { @Override protected void applyStyle() { - Layout.chooseStyleClass(label, "bisq-text-green", "bisq-text-grey-9", isSelected()); + Layout.chooseStyleClass(buttonLabel, "bisq-text-green", "bisq-text-grey-9", isSelected()); } @Override public void setHorizontalExpanded(boolean menuExpanded, int duration) { if (menuExpanded) { Tooltip.uninstall(this, tooltip); - Transitions.animateLeftSubNavigation(label, LABEL_X_POS_EXPANDED, duration); - label.setText(fullTitle); + Transitions.animateLeftSubNavigation(buttonLabel, LABEL_X_POS_EXPANDED, duration); + buttonLabel.setText(fullTitle); } else { Tooltip.install(this, tooltip); - Transitions.animateLeftSubNavigation(label, LABEL_X_POS_COLLAPSED, duration); - label.setText(fullTitle.substring(0, 1)); + Transitions.animateLeftSubNavigation(buttonLabel, LABEL_X_POS_COLLAPSED, duration); + buttonLabel.setText(fullTitle.substring(0, 1)); } } diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavView.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavView.java index 2eb326142d..33316e3e66 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavView.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/left/LeftNavView.java @@ -33,6 +33,7 @@ import javafx.scene.Cursor; import javafx.scene.Node; import javafx.scene.control.Button; +import javafx.scene.control.ContentDisplay; import javafx.scene.control.Label; import javafx.scene.control.ToggleGroup; import javafx.scene.image.ImageView; @@ -85,6 +86,10 @@ public LeftNavView(LeftNavModel model, LeftNavController controller, VBox networ LeftNavButton reputation = createNavigationButton(Res.get("navigation.reputation"), "nav-reputation", NavigationTarget.REPUTATION, false); + // TODO: Remove in 2.1.2 + Label reputationLabel = reputation.getButtonLabel(); + reputationLabel.setGraphic(ImageUtil.getImageViewById("new-badge")); + reputationLabel.setContentDisplay(ContentDisplay.RIGHT); LeftNavButton protocols = createNavigationButton(Res.get("navigation.tradeApps"), "nav-trade", diff --git a/apps/desktop/desktop/src/main/resources/css/application.css b/apps/desktop/desktop/src/main/resources/css/application.css index 3b8be096ce..ef31ee51c7 100644 --- a/apps/desktop/desktop/src/main/resources/css/application.css +++ b/apps/desktop/desktop/src/main/resources/css/application.css @@ -362,6 +362,7 @@ } .reputation .label { + -fx-font-size: 1.15em; -fx-line-spacing: 5px; -fx-wrap-text: true; } diff --git a/apps/desktop/desktop/src/main/resources/css/images.css b/apps/desktop/desktop/src/main/resources/css/images.css index cd990fa6e9..cc55c0bee9 100644 --- a/apps/desktop/desktop/src/main/resources/css/images.css +++ b/apps/desktop/desktop/src/main/resources/css/images.css @@ -278,6 +278,11 @@ -fx-image: url("/images/icons/open-link-green.png"); } +#new-badge { + -fx-image: url("/images/new.png"); +} + + /* ------------------------------------------------------------------------------------ */ /* Navigation */ /* ------------------------------------------------------------------------------------ */ diff --git a/apps/desktop/desktop/src/main/resources/images/new.png b/apps/desktop/desktop/src/main/resources/images/new.png new file mode 100644 index 0000000000..a2d40b51e3 Binary files /dev/null and b/apps/desktop/desktop/src/main/resources/images/new.png differ diff --git a/apps/desktop/desktop/src/main/resources/images/new@2x.png b/apps/desktop/desktop/src/main/resources/images/new@2x.png new file mode 100644 index 0000000000..3a342b6ce2 Binary files /dev/null and b/apps/desktop/desktop/src/main/resources/images/new@2x.png differ