ui: improve highscore list style
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
package eu.midnightdust.yaytris.ui;
|
package eu.midnightdust.yaytris.ui;
|
||||||
|
|
||||||
import eu.midnightdust.yaytris.HighScores;
|
import eu.midnightdust.yaytris.HighScores;
|
||||||
|
import eu.midnightdust.yaytris.util.CatppuccinColor;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import javax.swing.border.LineBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -25,7 +27,10 @@ public class HighScoreMenu extends JPanel {
|
|||||||
}
|
}
|
||||||
highscores.sort((s1, s2) -> Integer.compare(Integer.parseInt(s2.split("–")[0].replace(" ", "")), Integer.parseInt(s1.split("–")[0].replace(" ", ""))));
|
highscores.sort((s1, s2) -> Integer.compare(Integer.parseInt(s2.split("–")[0].replace(" ", "")), Integer.parseInt(s1.split("–")[0].replace(" ", ""))));
|
||||||
JList<String> highscoreList = new JList<>(highscores.toArray(String[]::new));
|
JList<String> highscoreList = new JList<>(highscores.toArray(String[]::new));
|
||||||
|
highscoreList.setBackground(CatppuccinColor.BASE.getColor());
|
||||||
|
highscoreList.setSelectionForeground(CatppuccinColor.CRUST.getColor());
|
||||||
JScrollPane highscoreScrollPane = new JScrollPane(highscoreList);
|
JScrollPane highscoreScrollPane = new JScrollPane(highscoreList);
|
||||||
|
highscoreScrollPane.setBorder(new LineBorder(CatppuccinColor.SURFACE0.getColor(), 3, true));
|
||||||
this.add(highscoreScrollPane);
|
this.add(highscoreScrollPane);
|
||||||
highscoreScrollPane.setBounds(scale(60), scale(43), scale(100), scale(80));
|
highscoreScrollPane.setBounds(scale(60), scale(43), scale(100), scale(80));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user