update selection bg for new welcome screen

This commit is contained in:
Konstantin Bulenkov
2014-10-22 22:36:43 +02:00
parent 52124eb8a6
commit 1c014fae8d
3 changed files with 19 additions and 7 deletions
@@ -91,6 +91,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame {
} else {
setSize(555, 460);
}
setResizable(false);
//int x = bounds.x + (bounds.width - getWidth()) / 2;
//int y = bounds.y + (bounds.height - getHeight()) / 2;
Point location = DimensionService.getInstance().getLocation(WelcomeFrame.DIMENSION_KEY, null);
@@ -176,8 +177,8 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame {
return new JBColor(Gray._0, Gray.xBB);
}
public static Color getListSelectionColor() {
return new JBColor(0x3875d6, 0x4b6eaf);
public static Color getListSelectionColor(boolean hasFocus) {
return hasFocus ? new JBColor(0x3875d6, 0x4b6eaf) : new JBColor(Gray.xDD, Gray.x45);
}
public static Color getActionLinkSelectionColor() {
@@ -185,7 +186,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame {
}
public static JBColor getSeparatorColor() {
return new JBColor(Gray.xEC, new Color(0x4e5154));
return new JBColor(Gray.xEC, new Color(72, 75, 78));
}
private class FlatWelcomeScreen extends JPanel implements WelcomeScreen {
@@ -220,6 +221,17 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame {
removeIfNeeded();
}
});
projectsList.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
projectsList.repaint();
}
@Override
public void focusLost(FocusEvent e) {
projectsList.repaint();
}
});
}
}
add(createBody(), BorderLayout.CENTER);
@@ -87,12 +87,12 @@ public class NewRecentProjectPanel extends RecentProjectPanel {
}
@Override
protected Color getListBackground(boolean isSelected, boolean hasFocus) {
return isSelected ? FlatWelcomeFrame.getListSelectionColor() : FlatWelcomeFrame.getProjectsBackground();
return isSelected ? FlatWelcomeFrame.getListSelectionColor(hasFocus) : FlatWelcomeFrame.getProjectsBackground();
}
@Override
protected Color getListForeground(boolean isSelected, boolean hasFocus) {
return UIUtil.getListForeground(isSelected);
return UIUtil.getListForeground(isSelected && hasFocus);
}
};
}
@@ -257,8 +257,8 @@ public class RecentProjectPanel extends JPanel {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
ReopenProjectAction item = (ReopenProjectAction)value;
Color fore = getListForeground(isSelected, cellHasFocus);
Color back = getListBackground(isSelected, cellHasFocus);
Color fore = getListForeground(isSelected, list.hasFocus());
Color back = getListBackground(isSelected, list.hasFocus());
myName.setForeground(fore);
myPath.setForeground(isSelected ? fore : UIUtil.getInactiveTextColor());