From 539d6465d05f549f91fdace0baa275c9ade7b335 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 26 Apr 2022 16:57:44 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-70458=20tab=E7=9A=84=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineFrame.java | 14 +++++++++++++ .../alphafine/component/SelectedLabel.java | 20 ------------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index d51684f5e1..58e24409e6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -360,6 +360,7 @@ public class AlphaFineFrame extends JFrame { public void mousePressed(MouseEvent e) { for (SelectedLabel label : selectedLabelList) { label.setSelected(false); + label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8); } selectedLabel.setSelected(true); tabLabel.setText(selectedLabel.getText()); @@ -394,6 +395,19 @@ public class AlphaFineFrame extends JFrame { } } } + + private Color defaultColor; + + @Override + public void mouseEntered(MouseEvent e) { + defaultColor = selectedLabel.getForeground(); + selectedLabel.setForeground(AlphaFineConstants.SUSPENDED_COLOR); + } + + @Override + public void mouseExited(MouseEvent e) { + selectedLabel.setForeground(defaultColor); + } }); tabPane.add(selectedLabel); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SelectedLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SelectedLabel.java index a7b661daea..1e153c237a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SelectedLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SelectedLabel.java @@ -1,22 +1,14 @@ package com.fr.design.mainframe.alphafine.component; -import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.CellType; -import com.fr.design.mainframe.alphafine.model.ProductNews; -import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager; -import com.fr.design.menu.SnapChatUtil; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Rectangle; import java.awt.RenderingHints; -import java.awt.geom.Ellipse2D; -import java.util.List; -import java.util.Set; /** * @author hades @@ -30,7 +22,6 @@ public class SelectedLabel extends UILabel { private static final int GAP = 2; private boolean selected; - private boolean hasRead; private CellType cellType; public SelectedLabel(String text, CellType cellType, boolean selected) { @@ -53,11 +44,8 @@ public class SelectedLabel extends UILabel { g2d.setColor(UIConstants.FLESH_BLUE); setForeground(UIConstants.FLESH_BLUE); g2d.drawLine(0, this.getHeight() - 1, this.getWidth(), this.getHeight() - 1); - } else { - setForeground(AlphaFineConstants.FOREGROUND_COLOR_8); } - if (cellType == CellType.PRODUCT_NEWS && AlphaFineUtil.unread()) { Color oldColor = g.getColor(); g2d.setColor(Color.RED); @@ -77,14 +65,6 @@ public class SelectedLabel extends UILabel { this.selected = selected; } - public boolean isHasRead() { - return hasRead; - } - - public void setHasRead(boolean hasRead) { - this.hasRead = hasRead; - } - public CellType getCellType() { return cellType; }