Browse Source

REPORT-134248 启动页优化

fbp/merge
vito 4 months ago
parent
commit
7ed3a16969
  1. 31
      designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java

31
designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java

@ -7,7 +7,6 @@ import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.components.tooltip.ModernToolTip;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.FRGraphics2D;
@ -22,7 +21,6 @@ import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JToolTip;
import javax.swing.JViewport;
import javax.swing.ScrollPaneConstants;
import java.awt.BasicStroke;
@ -57,9 +55,9 @@ public class StartupPageWorkspacePanel extends JPanel {
private static final Color PATH_COLOR = new Color(51, 51, 52, (int) Math.round(255 * 0.5));
/* 长度 */
private static final int SCROLL_BAR_WIDTH = 20;
private static final int CONTENT_WIDTH = scale(StartupPageConstants.CONTENT_WIDTH + SCROLL_BAR_WIDTH);
private static final int BORDER_THIN = 2;
@ -140,6 +138,7 @@ public class StartupPageWorkspacePanel extends JPanel {
this.contentPanel.setOpaque(false);
this.add(contentPanel, BorderLayout.NORTH);
}
private JComponent generateUnLimitContentPanel(List<List<StartupWorkspaceBean>> partitions) {
JComponent panel = generateUnLimitContentPanel0(partitions);
@ -228,7 +227,7 @@ public class StartupPageWorkspacePanel extends JPanel {
g.fillRoundRect(0, 0, preferredSize.width, preferredSize.height, 5, 5);
}
}
};
};
showAllPanel.setLayout(new BorderLayout());
UILabel fontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Expand_All"));
@ -287,10 +286,6 @@ public class StartupPageWorkspacePanel extends JPanel {
AtomicReference<Color> borderColorRef = new AtomicReference<>(null);
JPanel selectWorkspacePanel = new JPanel() {
@Override
public JToolTip createToolTip() {
return new ModernToolTip();
}
@Override
protected void paintComponent(Graphics g) {
@ -325,7 +320,7 @@ public class StartupPageWorkspacePanel extends JPanel {
}
};
selectWorkspacePanel.setLayout(new BorderLayout());
selectWorkspacePanel.setToolTipText(Toolkit.i18nText("Fine-Design_Startup_Page_Double_Click_Enter_Workspace"));
selectWorkspacePanel.setToolTipText(workspaceInfo.getPath());
selectWorkspacePanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
{
@ -348,7 +343,7 @@ public class StartupPageWorkspacePanel extends JPanel {
FineUIUtils.setFontSize(nameLabel, NAME_LABEL_SIZE);
nameLabel.setPreferredSize(PATH_DIMENSION);
Color nameForeground = nameLabel.getForeground();
simpleDescPanel.add(nameLabel,BorderLayout.NORTH);
simpleDescPanel.add(nameLabel, BorderLayout.NORTH);
UILabel pathLabel = new UILabel(workspaceInfo.getPath());
pathLabel.setPreferredSize(PATH_DIMENSION);
@ -369,7 +364,7 @@ public class StartupPageWorkspacePanel extends JPanel {
Color hoverColor = FlatUIUtils.getUIColor("brand.normal", HOVER_COLOR);
borderColorRef.set(hoverColor);
nameLabel.setForeground(hoverColor);
pathLabel.setForeground(hoverColor );
pathLabel.setForeground(hoverColor);
repaintAll();
}
@ -394,12 +389,7 @@ public class StartupPageWorkspacePanel extends JPanel {
};
UILabel arrowLabel = new UILabel(new LazyIcon("more_arrow", 20)) {
@Override
public JToolTip createToolTip() {
return new ModernToolTip();
}
};
UILabel arrowLabel = new UILabel(new LazyIcon("more_arrow", 20));
arrowLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Startup_Page_Enter_Workspace"));
arrowLabel.addMouseListener(new MouseAdapter() {
@Override
@ -433,10 +423,6 @@ public class StartupPageWorkspacePanel extends JPanel {
// 选择并新建
AtomicReference<Color> borderColorRef = new AtomicReference<>(null);
JPanel selectAndCreatePanel = new JPanel() {
@Override
public JToolTip createToolTip() {
return new ModernToolTip();
}
@Override
protected void paintComponent(Graphics g) {
@ -481,6 +467,7 @@ public class StartupPageWorkspacePanel extends JPanel {
label.setIcon(new LazyIcon("add", 20));
repaintAll();
}
@Override
public void mousePressed(MouseEvent e) {
pageModel.setSelectWorkspaceInfo(workspaceInfo);

Loading…
Cancel
Save