From f3cf93b106f0ae3a04f90765be001a51a94f714e Mon Sep 17 00:00:00 2001 From: hzzz Date: Fri, 22 Sep 2017 10:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=8C=89=E9=92=AE=E5=9B=9E?= =?UTF-8?q?=E9=80=80=20&=20=E4=B8=8B=E6=8B=89=E6=A1=86=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/start/Designer.java | 14 ++++++-------- .../design/gui/icombobox/UIComboBoxRenderer.java | 13 ++++++++++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/designer/src/com/fr/start/Designer.java b/designer/src/com/fr/start/Designer.java index bd4c455e71..9d93644a28 100644 --- a/designer/src/com/fr/start/Designer.java +++ b/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; } diff --git a/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java b/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java index 4be4fdcf09..9e5a0c3b9f 100644 --- a/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java +++ b/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; }