Browse Source

REPORT-14057 10.0日文国际化问题处理=>列表面板顶部按钮弹出菜单显示不全

bugfix/10.0
plough 6 years ago
parent
commit
fcc3b02c96
  1. 9
      designer-base/src/main/java/com/fr/design/menu/MenuDef.java

9
designer-base/src/main/java/com/fr/design/menu/MenuDef.java

@ -24,6 +24,7 @@ import java.util.List;
public class MenuDef extends ShortCut { public class MenuDef extends ShortCut {
private static final int MENU_DEFAULTWDITH = 156; private static final int MENU_DEFAULTWDITH = 156;
private static final int BLANK_WIDTH = 30;
protected String name; protected String name;
//右侧属性表弹出框重绘 //右侧属性表弹出框重绘
protected Boolean isEastAttr = false; protected Boolean isEastAttr = false;
@ -410,7 +411,7 @@ public class MenuDef extends ShortCut {
popupMenu = new UIPopupEastAttrMenu(); popupMenu = new UIPopupEastAttrMenu();
popupMenu.setInvoker(button); popupMenu.setInvoker(button);
MenuDef.this.updateEastPopupMenu(popupMenu); MenuDef.this.updateEastPopupMenu(popupMenu);
popupMenu.setPopupSize(new Dimension(MENU_DEFAULTWDITH, popupMenu.getPreferredSize().height)); updatePopupMenuSize();
GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height); GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height);
} else { } else {
popupMenu = new UIPopupMenu(); popupMenu = new UIPopupMenu();
@ -421,6 +422,12 @@ public class MenuDef extends ShortCut {
} }
}; };
private void updatePopupMenuSize() {
int preferredWidth = popupMenu.getPreferredSize().width - BLANK_WIDTH; // 减少行尾的空白部分
int popupMenuWidth = preferredWidth > MENU_DEFAULTWDITH ? preferredWidth : MENU_DEFAULTWDITH;
popupMenu.setPopupSize(new Dimension(popupMenuWidth, popupMenu.getPreferredSize().height));
}
//ben: for ui test //ben: for ui test
public JPopupMenu getPopupMenu() { public JPopupMenu getPopupMenu() {

Loading…
Cancel
Save