Browse Source

模板主题tab调整区分控件显示增强&调整dragbar和spinner的占比、textfield的border

fbp/release
renekton 2 months ago
parent
commit
a13cba21c6
  1. 7
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java

7
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<Double> 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<Double> 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()) {

4
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java

@ -361,7 +361,11 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
}
protected void buildTabPane() {
if (WidgetThemeDesignerUtils.enableWidgetEnhance()) {
uiTabbedPane = tabPaneBuilder.withHeadRatio(1.0f).build();
} else {
uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build();
}
uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1));
}
}
Loading…
Cancel
Save