diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/RoleTree.java b/designer-base/src/main/java/com/fr/design/roleAuthority/RoleTree.java index 743dc4a754..92aeebe9ab 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/RoleTree.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/RoleTree.java @@ -33,6 +33,8 @@ import java.util.ArrayList; import java.util.Enumeration; import java.util.List; +import static com.fine.theme.utils.FineUIScale.scale; + /** * Author : daisy * Time: 下午3:32 @@ -48,7 +50,7 @@ public class RoleTree extends UserObjectRefreshJTree { this.setCellRenderer(roleTreeRenderer); this.setEnabled(true); this.setEditable(true); - this.setRowHeight(20); + this.setRowHeight(scale(20)); this.setDigIn(true); Handler handler = createHandlerForRoleTree(); this.replaceMouseListener(this, handler, 0); diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java index 0f6631073d..cf63669c0a 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java @@ -78,7 +78,6 @@ public class ColorSelectDetailPane extends BasicPane { // 颜色选择器面板 selectedPanel = new JColorChooser(this.color); - selectedPanel.setPreferredSize(new Dimension(selectedPanel.getWidth(), FineUIScale.scale(SELECT_PANEL_HEIGHT))); selectedPanel.setPreviewPanel(new JPanel()); swatchChooserPanel = new SwatchChooserPanel(); @@ -130,12 +129,11 @@ public class ColorSelectDetailPane extends BasicPane { column( 2, cell(new UILabel(i18nText("Fine-Design_Basic_Preview"))), - cell(previewPanel).with(it -> { + cell(previewPanel).weight(1).with(it -> { it.setBorder(new FineRoundBorder()); - it.setPreferredSize(new Dimension(this.getPreferredSize().width, FineUIScale.scale(120))); it.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); }) - )).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10))) + ).weight(1)).weight(1).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10))) ).getComponent(); } diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java index e9ee892bf0..6e87e6a12c 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java @@ -16,6 +16,8 @@ import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.theme.utils.FineUIScale.scale; @@ -86,8 +88,7 @@ public class ColorSelectDialog extends MiddleChartDialog{ private void initComponent() { this.setLayout(new BorderLayout()); - this.add(pane,BorderLayout.NORTH); - this.setBasicDialogSize(scale(545),scale(500)); + this.setBasicDialogSize(545,500); this.setResizable(false); this.applyClosingAction(); @@ -95,8 +96,6 @@ public class ColorSelectDialog extends MiddleChartDialog{ JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - this.add(buttonPane, BorderLayout.SOUTH); - ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_OK")); cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")); @@ -121,6 +120,7 @@ public class ColorSelectDialog extends MiddleChartDialog{ } }); + this.add(column(10, cell(pane).weight(1), cell(buttonPane)).getComponent()); this.setTitle(pane.title4PopupWindow()); GUICoreUtils.setWindowCenter(getOwner(), this); } diff --git a/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java b/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java index d6b2df3023..26ca6bb61f 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java @@ -599,7 +599,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec protected void buildChooser() { setLayout(new BorderLayout(10, 0)); setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth(), scale(180))); - add(buildRightPanel(), BorderLayout.CENTER); + Container rightPane = buildRightPanel(); JPanel container = new JPanel(); container.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 0)); @@ -628,7 +628,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec slider.setSize(scale(new Dimension(12, 180))); trackPanel.setSize(scale(new Dimension(12, 180))); - add(container, BorderLayout.WEST); + add(row(cell(container).weight(1), cell(rightPane).weight(1)).getComponent()); slider.addChangeListener(new SliderChangeListener()); updateTextFields(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java index c0679a7053..7e1853c09e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.beans.BasicBeanPane; import com.fr.design.file.HistoryTemplateListPane; @@ -37,7 +38,10 @@ import java.awt.event.MouseListener; import java.util.List; import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.flex; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.theme.utils.FineUIScale.scale; /** * Author : daisy @@ -134,14 +138,14 @@ public class AuthorityToolBarPane extends BasicBeanPane extends BasicBeanPane