From a13cba21c6ef7cccfeedce1a47218af5cc6fec54 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 24 Sep 2024 18:29:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=BB=E9=A2=98tab?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8C=BA=E5=88=86=E6=8E=A7=E4=BB=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A2=9E=E5=BC=BA&=E8=B0=83=E6=95=B4dragbar=E5=92=8Cs?= =?UTF-8?q?pinner=E7=9A=84=E5=8D=A0=E6=AF=94=E3=80=81textfield=E7=9A=84bor?= =?UTF-8?q?der?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/frpane/UINumberDragPane.java | 7 ++++++- .../fr/design/mainframe/theme/TemplateThemeEditorPane.java | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java index a1eadbe8fa..2f97feeafc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java @@ -1,6 +1,7 @@ package com.fr.design.gui.frpane; import com.fine.swing.ui.layout.Layouts; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameObserver; @@ -12,11 +13,14 @@ import java.awt.BorderLayout; import java.awt.Dimension; import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.swing.ui.layout.Layouts.flex; public class UINumberDragPane extends BasicBeanPane implements GlobalNameObserver { private static final long serialVersionUID = -8681716725163358249L; + private static double DRAG_BAR_WEIGHT = 0.64; + private static double SPINNER_WIGHT = 0.36; private UISlider dragBar; private UISpinner spinner; private boolean isEditing = false; @@ -40,11 +44,12 @@ public class UINumberDragPane extends BasicBeanPane implements GlobalNam dragBar.setPaintLabels(true); dragBar.setMajorTickSpacing(minValue < 0 ? (int) maxValue : (int) maxValue - (int) minValue); spinner = createUISpinner(minValue, maxValue, dierta); + spinner.getTextField().setBorder(new ScaledEmptyBorder(0, 0, 0, 0)); spinner.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")); spinner.setValue(dragBar.getValue()); this.setLayout(new BorderLayout()); this.add(Layouts.row( - cell(dragBar).weight(0.7), flex(0.1), cell(spinner).weight(0.7) + cell(dragBar).weight(DRAG_BAR_WEIGHT), fix(2), cell(spinner).weight(SPINNER_WIGHT) ).getComponent()); dragBar.addChangeListener(e -> { if (globalNameListener != null && shouldResponseNameListener()) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java index 8acebe91cd..3346ab92cd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java @@ -361,7 +361,11 @@ public abstract class TemplateThemeEditorPane extends J } protected void buildTabPane() { - uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build(); + if (WidgetThemeDesignerUtils.enableWidgetEnhance()) { + uiTabbedPane = tabPaneBuilder.withHeadRatio(1.0f).build(); + } else { + uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build(); + } uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1)); } } \ No newline at end of file