Browse Source

Pull request #15166: REPORT-138379 fix:模板web属性无法添加插件按钮

Merge in DESIGN/design from ~CORAL.CHEN/design:fbp/master to fbp/master

* commit 'fce46955fc4733ad34bf8e477ec4552c7711f5ec':
  REPORT-138379 fix:模板web属性无法添加插件按钮
fbp/master
Coral.Chen-张晨 1 month ago
parent
commit
e15fb607fb
  1. 4
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java

4
designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java

@ -22,8 +22,6 @@ import javax.swing.ImageIcon;
public class ToolBarButton extends UIButton implements MouseListener { public class ToolBarButton extends UIButton implements MouseListener {
private Widget widget; private Widget widget;
private WidgetOption no; private WidgetOption no;
private final int ICON_WIDTH = FineUIScale.scale(16);
private final int ICON_HEIGHT = FineUIScale.scale(16);
public ToolBarButton(Icon icon, Widget widget) { public ToolBarButton(Icon icon, Widget widget) {
this(null, icon, widget); this(null, icon, widget);
@ -55,7 +53,7 @@ public class ToolBarButton extends UIButton implements MouseListener {
if (icon instanceof ImageIcon) { if (icon instanceof ImageIcon) {
//自定义上传的图标在设计器工具栏显示需要按照16*16进行缩放 //自定义上传的图标在设计器工具栏显示需要按照16*16进行缩放
Image originalImage = ((ImageIcon) icon).getImage(); Image originalImage = ((ImageIcon) icon).getImage();
Image scaledImage = originalImage.getScaledInstance(ICON_WIDTH, ICON_HEIGHT, Image.SCALE_SMOOTH); Image scaledImage = originalImage.getScaledInstance(FineUIScale.scale(16), FineUIScale.scale(16), Image.SCALE_SMOOTH);
icon = new ImageIcon(scaledImage); icon = new ImageIcon(scaledImage);
} }
super.setIcon(icon); super.setIcon(icon);

Loading…
Cancel
Save