Browse Source

REPORT-55071 【组件背景分离】组件复用-标题填充选择渐变色时,设置面板出现纵向滚动条,遮挡住了渐变色右侧颜色选择按钮

【问题原因】
渐变条的默认宽度超过了右侧栏设置项的宽度,导致渐变条右侧被截断
【改动思路】
提供可继承的方法,使得右侧栏实例化渐变条时能控制其宽度
【review建议】
feature/10.0
Starryi 3 years ago
parent
commit
5cfbe3fec4
  1. 7
      designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java
  2. 2
      designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java
  3. 14
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java
  4. 2
      designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java

7
designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java

@ -39,7 +39,7 @@ public class BackgroundSpecialPane extends BackgroundPane{
fireStateChanged();
}
});
GradientBackgroundQuickPane gradientPane = new GradientBackgroundQuickPane();
GradientBackgroundQuickPane gradientPane = createGradientBackgroundQuickPane();
gradientPane.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
@ -68,4 +68,9 @@ public class BackgroundSpecialPane extends BackgroundPane{
return kinds.toArray(new BackgroundQuickPane[kinds.size()]);
}
protected GradientBackgroundQuickPane createGradientBackgroundQuickPane() {
// 使用默认的150宽度构建渐变条
return new GradientBackgroundQuickPane();
}
}

2
designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java

@ -62,7 +62,7 @@ import java.net.URISyntaxException;
* 可配置图片类型边框的样式设置面板
*/
public class BorderLineAndImagePane extends JPanel implements UIObserver {
private final int SETTING_LABEL_WIDTH = 60;
private final int SETTING_LABEL_WIDTH = LayoutStylePane.SETTING_LABEL_WIDTH;
private final Style DEFAULT_IMAGE_LAYOUT_STYLE = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_DEFAULT);
private final String TWEAK_NINE_POINT_HELP_URL = "";

14
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java

@ -24,6 +24,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.backgroundpane.GradientBackgroundQuickPane;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.WidgetTitle;
import com.fr.general.Background;
@ -51,7 +52,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Shadow")
};
private static final Dimension BUTTON_SIZE = new Dimension(20, 20);
private static final int SETTING_LABEL_WIDTH = 60;
public static final int SETTING_LABEL_WIDTH = 60;
protected LayoutBorderStyle style = new LayoutBorderStyle();
@ -124,7 +125,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
borderStyleCombo = new UIComboBox(BORDER_STYLE);
borderLineAndImagePane = new BorderLineAndImagePane();
cornerSpinner = new UISpinner(0,1000,1,0);
backgroundPane = new BackgroundSpecialPane();
backgroundPane = new LayoutBackgroundSpecialPane();
backgroundOpacityPane = new UIPercentDragPane();
}
@ -229,7 +230,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Right")
});
titleBackgroundPane = new BackgroundSpecialPane();
titleBackgroundPane = new LayoutBackgroundSpecialPane();
titleBackgroundOpacityPane = new UIPercentDragPane();
}
@ -499,4 +500,11 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
g2d.setColor(oldColor);
}
}
protected static class LayoutBackgroundSpecialPane extends BackgroundSpecialPane {
@Override
protected GradientBackgroundQuickPane createGradientBackgroundQuickPane() {
return new GradientBackgroundQuickPane(140);
}
}
}

2
designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java

@ -40,7 +40,7 @@ import java.awt.event.ActionListener;
* Created by Starryi on 2021/7/3
*/
public class TitleInsetImagePane extends JPanel implements UIObserver {
private final int SETTING_LABEL_WIDTH = 60;
private final int SETTING_LABEL_WIDTH = LayoutStylePane.SETTING_LABEL_WIDTH;
private final int DELETE_BUTTON_SIZE = 24;
private final int IMAGE_PREVIEW_SIZE = 145;
private final Style DEFAULT_IMAGE_LAYOUT_STYLE = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_DEFAULT);

Loading…
Cancel
Save