diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index ccfed418d1..d7fcf9e631 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -6,7 +6,6 @@ import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.FlatDarkLaf; -import com.formdev.flatlaf.ui.FlatLineBorder; import com.fr.base.FRContext; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; @@ -413,7 +412,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } leftPane.add(item.getButton()); } - leftPane.setBorder(new FlatLineBorder(new Insets(0,1,0,1), UIManager.getColor("East.border"))); + leftPane.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 1, UIManager.getColor("East.border"))); replaceLeftPane(leftPane); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java index 78da7a6e63..cef7222edf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fine.theme.icon.LazyIcon; -import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils; @@ -12,7 +11,6 @@ import com.fr.design.gui.itextfield.UINumberField; import javax.swing.BorderFactory; import javax.swing.JPanel; -import javax.swing.UIManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -69,7 +67,7 @@ public class JFormSliderPane extends JPanel { initSlider(); initDownUpButton(); initShowValField(); - JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); + JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 2)); panel.add(downButton); panel.add(slider); panel.add(upButton); @@ -123,10 +121,15 @@ public class JFormSliderPane extends JPanel { } private void initShowValField() { - showValField = new UINumberField(); + showValField = new UINumberField() { + @Override + public Dimension getPreferredSize() { + int width = FineUIUtils.getAndScaleInt("FormSliderPane.showValueWidth", 40); + int height = FineUIUtils.getAndScaleInt("FormSliderPane.showValueHeight", 20); + return new Dimension(width, height); + } + }; showValField.setValue(showValue); - Dimension dimension = new Dimension(UIManager.getInt("FormSliderPane.showValueWidth"), UIManager.getInt("FormSliderPane.showValueHeight")); - showValField.setPreferredSize(FineUIScale.scale(dimension)); showValField.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { @@ -293,5 +296,11 @@ public class JFormSliderPane extends JPanel { public void addValueChangeListener(ChangeListener changeListener){ this.slider.addChangeListener(changeListener); } + + @Override + public Dimension getPreferredSize() { + Dimension size = super.getPreferredSize(); + return new Dimension(size.width, FineUIUtils.getAndScaleInt("Component.defaultHeight", 24)); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index ae24c9ca1a..039ddbd782 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -115,8 +115,6 @@ import javax.swing.JOptionPane; import javax.swing.SwingConstants; import javax.swing.undo.UndoManager; import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FontMetrics; import java.io.ByteArrayOutputStream; import java.nio.file.Paths; import java.util.Arrays; @@ -1610,14 +1608,7 @@ public abstract class JTemplate> } protected UIButton createTemplateThemeButton() { - UIButton button = new UIButton(new LazyIcon("template_theme")) { - @Override - public Dimension getPreferredSize() { - FontMetrics metrics = getFontMetrics(getFont()); - int width = Math.min(metrics.stringWidth(getText()) + PREDEFINED_ICON_WIDTH, 100); - return new Dimension(width, 20); - } - }; + UIButton button = new UIButton(new LazyIcon("template_theme")); button.setToolTipText(getTemplateTheme().getName()); button.setText(getTemplateTheme().getName()); button.setName(getTemplateTheme().getName());