From 83fa6c39bc87e7b0804044bd92f91383234115ac Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 8 Feb 2021 14:21:52 -0500 Subject: [PATCH] Site toolbar buttons should toggle on site, not result. --- .../masterpassword/gui/view/UserContentPanel.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/view/UserContentPanel.java b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/view/UserContentPanel.java index 72700244..fb9bdb67 100644 --- a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/view/UserContentPanel.java +++ b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/view/UserContentPanel.java @@ -901,6 +901,12 @@ public class UserContentPanel extends JPanel implements State.Listener, MPUser.L private void showSiteItem(@Nullable final MPQuery.Result> item) { MPSite site = (item != null)? item.getValue(): null; Res.ui( getSiteResult( site, showLogin ), result -> { + settingsButton.setEnabled( site != null ); + questionsButton.setEnabled( site != null ); + editButton.setEnabled( site != null ); + keyButton.setEnabled( site != null ); + deleteButton.setEnabled( site != null ); + if (!showLogin && (site != null)) resultLabel.setText( (result != null)? strf( "Your password for %s:", site.getSiteName() ): " " ); else if (showLogin && (site != null)) @@ -912,11 +918,6 @@ public class UserContentPanel extends JPanel implements State.Listener, MPUser.L resultField.setText( EACH_CHARACTER.matcher( result ).replaceAll( "•" ) ); else resultField.setText( result ); - settingsButton.setEnabled( result != null ); - questionsButton.setEnabled( result != null ); - editButton.setEnabled( result != null ); - keyButton.setEnabled( result != null ); - deleteButton.setEnabled( result != null ); } ); }