Browse Source

REPORT-107973 修改 东区按钮边框、滑块高度、主题配置按钮宽度

newui
Leo.Qin 11 months ago
parent
commit
9311b2eeec
  1. 3
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  2. 21
      designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java
  3. 11
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

3
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -5,7 +5,6 @@ import com.fine.theme.light.ui.RectangleButtonUI;
import com.fine.theme.utils.FineUIScale;
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;
@ -425,7 +424,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);
}

21
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));
}
}

11
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<T extends BaseBook, U extends BaseUndoState<?>>
}
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());

Loading…
Cancel
Save