Browse Source

登录面板颜色切换

feature/10.0
Lanlan 3 years ago
parent
commit
505756d314
  1. 18
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java
  2. 11
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java

18
designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -17,13 +17,9 @@ import com.fr.design.login.DesignerLoginSource;
import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.login.utils.DesignerLoginUtils;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.upm.event.CertificateEvent;
import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.BrowseUtils;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
@ -79,12 +75,16 @@ public class UserInfoLabel extends UILabel {
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR)); UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR));
UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK); if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) {
UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK);
}
} }
@Override @Override
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND); if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) {
UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND);
}
} }
@Override @Override
@ -211,12 +211,6 @@ public class UserInfoLabel extends UILabel {
DesignerLoginHelper.showLoginDialog(source); DesignerLoginHelper.showLoginDialog(source);
} }
}); });
EventDispatcher.listen(CertificateEvent.LOGIN, new Listener<String>() {
@Override
public void on(Event event, String text) {
setText(text);
}
});
} }
private void clearLoginInformation() { private void clearLoginInformation() {

11
designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java

@ -9,6 +9,10 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.upm.event.CertificateEvent;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -75,6 +79,13 @@ public class UserInfoPane extends BasicPane {
autoPushLoginDialog(); autoPushLoginDialog();
this.add(userInfoLabel, BorderLayout.CENTER); this.add(userInfoLabel, BorderLayout.CENTER);
EventDispatcher.listen(CertificateEvent.LOGIN, new Listener<String>() {
@Override
public void on(Event event, String text) {
markSignIn(text);
}
});
} }
public UserInfoLabel getUserInfoLabel() { public UserInfoLabel getUserInfoLabel() {

Loading…
Cancel
Save