From 1fdcff03bc8bfccdb06912ccf5ea873916e63f08 Mon Sep 17 00:00:00 2001 From: axpoems <145597137+axpoems@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:38:31 +0200 Subject: [PATCH 1/2] Add new badge to reputation section button --- .../bisq/desktop/main/left/LeftNavButton.java | 33 +++++++++--------- .../desktop/main/left/LeftNavSubButton.java | 10 +++--- .../bisq/desktop/main/left/LeftNavView.java | 5 +++ .../desktop/src/main/resources/css/images.css | 5 +++ .../desktop/src/main/resources/images/new.png | Bin 0 -> 1340 bytes .../src/main/resources/images/new@2x.png | Bin 0 -> 1741 bytes 6 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 apps/desktop/desktop/src/main/resources/images/new.png create mode 100644 apps/desktop/desktop/src/main/resources/images/new@2x.png 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/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 0000000000000000000000000000000000000000..a2d40b51e3cbb5498e0fbd55760c6fcb6cba56e6 GIT binary patch literal 1340 zcmbVMZA=?=7{9_+*j5Jd6*R(eRWo(hd+FQVg$~+YJDO2eS+il_1J}EM+Y7zBdUw!5 zaMEFr83`pOX8WMvJ}AaXoQWEPiy#;^S+bdEB*ri7i<(Rwd~hb<%N?}n2eJ>|hr8$h z-0%0iKmYTw&f_%)A36v@P)($r?J~X%rd(|`-o5jm|7t4qP`7?cN$NRH1(07*5&(`! zTncmnP8fRjE6@T#m4jluTkno`FuWo;I1}T@OId>rK`pKMEXVf)9ZrChDEpA#7CuE_ zQSc#W+)+H54T7}TKCFUM!<}({xSyv5r1cowl4lG963{s~FJ)wn$@`FPyNn^5Y7Bw5 zA$q?L*$JvU8iRw13SinnpgfL~u$Oiuoo*LM@?QKXOyZ;yBM1zqQG#S}H{*7~r3Wz_ zszQ?KV#6hO#>t1Ibv?^qST2`yB+;5>I%L5?}bg#lwuC zFmqD=GdX3IF^;CVy9&l(cbR}}Y>;ZK%4ElZ6$rBQMp%D5|9xWX;SGbl6)Lv3r8|oXc25xh=9-gXS z`{S46R%-lh%g@2nQ~O@Ncq7z!RS>dAxpPmw{>kA>D+}Y(Ya2c*e)iAl>9uca!sE~V z*s!F2Ep^y>rtGWf(bo>V)AVlLxP2`4;@^FjoA1o{d)8Z5ks|-YWOJs7`7`?HxA!<} zCO!*3*zokqi4-fFi(a2B7>|<}ymCKu$&30#|aydL%piZ>SA{$N1FAU7R zs;9Op`Qm=K?~SF!_kPFiV{dLfZ}rVyZ_5;G&wt2Xm?ZY3Ss)}p}B6${*fbfn-y1@ n>$KR??WVSo#tHA(wW?|yvZn{%?`7|Mz`V~Qp-y%_(0A@1yr02m literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..3a342b6ce211a4ae81c3841c6fb7963b91491ffa GIT binary patch literal 1741 zcmbVNX;2eq7>+21QWOwDK|5;{1Z8tmH0JAP$Zxot?sl&QLa&FtEQ-NU! zu`!rB;*?yv0tmx!6cEsuppwCW0G@!RW^vf4TFGMs0uTdY(V0v-LjW=%A%i32uz=Br zN*csfYM~4kjhZ7@!Bh=F7=(1X$z-CLSTqceqca5p0i6NSAqXT9pfOobAZAc+oHM2X zqedmJH4s`%57-nD1(rwzQ%Pq>ZlN15m%BaQO_A8li~ZgAsdkNMz|c;l6gVmVN98*L-m9N4yKYPG?i8* zrwaz4rxhT$keV0bi!#g7%j3JpeJMh#{FAP$WK z_^;CHRhY>bV9U|Sm0=XuCZQ@3j_H8mAPco0aDby$tJIJ{4RYB`9>^82IUvGTC_t3} z;w$(Hu9~6XQb+l!{~J6y=@i{oDgUXQu`RM3ZPWLyKrY@l6RIaW2q#_feopKt-Rhl2cFdT7H#U; z)KE}a{%+iYlW$jv9~E!`U1*_Ped;d$h&ZEe62V+?J^knpJAqG@E%fW#HzR*i3!K+7 zu%-5Rz@OD9mHn`+n3+|(=8N9G^1NbCXKnLxOJ#n8S=jvI53jbDQaIl`|7q)$slMGO zTMz7CpThGF%GFo=wD33oN_1?~V-Ok-JL!EZH zUpOo{*g3I0cg{ggXU#Y1llz`oZ=5al;U0N+C<>OYxt@r_pvPZL3e8nlr}!h&d}n26 z)nyA0e#T6?S~9(AetT76`L)VZ%Lc`Esgm+jsXw|sPq^ySn;iS=5$m_%mcL`dOXkHi zbiSyr^3qunw-+XE7zmZ!bfj((&(gc+`d{m5IAnGxn5#-_G{iU#?3{ToUAJ;PcxV6G z9o7mvBrmh+`sv*vYk0EUbrp))nal1xswwiEe4?f9)|o3`-Drf{vQ2428{Vb5I$Wx_ z9k3a8dXTZiQKpRO>3wrp9y8lAkedNF?%4C`xnFuFQ!ne-ngtH$Ea_>`<;ctzgU{UZ zLQ;JTi;$&&>_qk9vV{IjOKI!*CD^f6Swxt!yT9zv!~`({9)IjMF3*lX^;xmk;>S#D zlJDKYPw!pdE19k;eqA~BoaU1C^L0_{Z)Z`!ogNkiCxepqvQaaaH?)|)FqP;)odYKf zg-|W}<2CtcwTle?7oy^>BN&T+QUOsq;X6o6J zeax-?X}o{m_q7*M@#ePs4!J9b?0v1qy!OEbO_V8N^UGi5tZujcU?ky@aLtnS>Hh$% CZl%Bg literal 0 HcmV?d00001 From f876460d5906dd28dbc07bed12e6ce0611ba0987 Mon Sep 17 00:00:00 2001 From: axpoems <145597137+axpoems@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:46:20 +0200 Subject: [PATCH 2/2] Increase font size in reputation section --- apps/desktop/desktop/src/main/resources/css/application.css | 1 + 1 file changed, 1 insertion(+) 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; }