Skip to content

Commit

Permalink
Fix windows disappearing issue
Browse files Browse the repository at this point in the history
fix issue #68
  • Loading branch information
RoanH committed Apr 30, 2017
1 parent 360f04f commit 8de5360
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions KeysPerSecond/src/me/roan/kps/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
}
});
String version = checkVersion();//XXX the version number
JLabel ver = new JLabel("<html><center><i>Version: v6.0, latest version: " + (version == null ? "unknown :(" : version) + "<br>"
JLabel ver = new JLabel("<html><center><i>Version: v6.1, latest version: " + (version == null ? "unknown :(" : version) + "<br>"
+ "<u><font color=blue>https://osu.ppy.sh/forum/t/552405</font></u></i></center></html>", SwingConstants.CENTER);
ver.addMouseListener(new MouseListener(){

Expand Down Expand Up @@ -1120,13 +1120,12 @@ public void windowDeactivated(WindowEvent e) {
protected static final void reconfigure(){
SwingUtilities.invokeLater(()->{
frame.getContentPane().removeAll();
content = new JPanel(new GridLayout(1, 0, 2, 0));
content = new JPanel(new GridLayout(1, 0, 0, 0));
try {
ColorManager.prepareImages(config.showGraph, config.customColors);
} catch (IOException e) {
e.printStackTrace();
}
content.setBackground(config.getBackgroundColor());
config.keyinfo.sort((KeyInformation left, KeyInformation right) -> (left.index > right.index ? 1 : -1));
Key k;
int panels = 0;
Expand Down Expand Up @@ -1173,9 +1172,10 @@ protected static final void reconfigure(){
allcontent.add(graph);
GraphPanel.frames = panels > 0 ? panels : 5;
}
frame.setSize((panels == 0 && config.showGraph) ? SizeManager.defaultGraphWidth : (panels * SizeManager.keyPanelWidth + (panels - 1) * 2), (panels > 0 ? SizeManager.subComponentHeight : 0) + (config.showGraph ? SizeManager.subComponentHeight : 0));
frame.setOpacity(config.getBackgroundOpacity());
frame.setBackground(config.getBackgroundColor());
frame.setSize((panels == 0 && config.showGraph) ? SizeManager.defaultGraphWidth : (panels * SizeManager.keyPanelWidth), (panels > 0 ? SizeManager.subComponentHeight : 0) + (config.showGraph ? SizeManager.subComponentHeight : 0));
if(ColorManager.transparency){
frame.setBackground(ColorManager.transparent);
}
frame.add(allcontent);
frame.setVisible(true);
});
Expand Down

0 comments on commit 8de5360

Please sign in to comment.