Browse Source

预览按钮回退 & 下拉框回退

master
hzzz 7 years ago
parent
commit
f3cf93b106
  1. 14
      designer/src/com/fr/start/Designer.java
  2. 13
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java

14
designer/src/com/fr/start/Designer.java

@ -135,26 +135,24 @@ public class Designer extends BaseDesigner {
public UILargeToolbar createLargeToolbar() {
UILargeToolbar largeToolbar = super.createLargeToolbar();
largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4));
JPanel templeJpanel = new JPanel() {
largeToolbar.add(new JPanel() {
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = 1;
return dim;
}
};
templeJpanel.setBackground(Color.WHITE);
largeToolbar.add(templeJpanel);
});
createRunButton(largeToolbar);
largeToolbar.add(run);
templeJpanel = new JPanel() {
run.setBackground(UIConstants.TREE_BACKGROUND);
largeToolbar.add(new JPanel() {
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = GAP;
return dim;
}
};
templeJpanel.setBackground(Color.WHITE);
largeToolbar.add(templeJpanel);
});
largeToolbar.addSeparator(new Dimension(2, 42));
largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR));
return largeToolbar;
}

13
designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java

@ -26,9 +26,16 @@ public class UIComboBoxRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
cellHasFocus = cellHasFocus && !this.isEnabled();
JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
renderer.setForeground(Color.black);
list.setSelectionBackground(UIConstants.COMBOBOX_BTN_PRESS);
list.setSelectionForeground(Color.black);
renderer.setOpaque(true);
list.setSelectionBackground(UIConstants.NORMAL_BLUE);
list.setSelectionForeground(Color.WHITE);
if (isSelected) {
renderer.setForeground(list.getSelectionForeground());
renderer.setBackground(list.getSelectionBackground());
} else {
renderer.setForeground(list.getForeground());
renderer.setBackground(list.getBackground());
}
renderer.setText(" " + renderer.getText());
return renderer;
}

Loading…
Cancel
Save