@@ -1125,55 +1125,62 @@ public void windowIconified(WindowEvent e) {
1125
1125
trayMenuMain .addActionListener (arg0 -> toggleTrayClick ());
1126
1126
MenuItem trayMenuAbout = new MenuItem ("About " + mainFrame .getTitle ());
1127
1127
trayMenuAbout .addActionListener (arg0 -> {
1128
- StringBuilder about = new StringBuilder ();
1129
-
1130
- about .append ("<html><h1>" ).append (mainFrame .getTitle ()).append ("</h1>" );
1131
- about .append ("Download albums from various websites:" );
1132
1128
try {
1133
- List <String > rippers = Utils .getListOfAlbumRippers ();
1134
- about .append ("<ul>" );
1135
- for (String ripper : rippers ) {
1136
- about .append ("<li>" );
1129
+ List <String > albumRippers = Utils .getListOfAlbumRippers ();
1130
+ List <String > videoRippers = Utils .getListOfVideoRippers ();
1131
+
1132
+ JTextArea aboutTextArea = new JTextArea ();
1133
+ aboutTextArea .setEditable (false );
1134
+ aboutTextArea .setLineWrap (true );
1135
+ aboutTextArea .setWrapStyleWord (true );
1136
+
1137
+ JScrollPane scrollPane = new JScrollPane (aboutTextArea );
1138
+ scrollPane .setPreferredSize (new Dimension (400 , 300 ));
1139
+
1140
+ StringBuilder aboutContent = new StringBuilder ();
1141
+ aboutContent .append ("Download albums from various websites:\n " );
1142
+ for (String ripper : albumRippers ) {
1137
1143
ripper = ripper .substring (ripper .lastIndexOf ('.' ) + 1 );
1138
1144
if (ripper .contains ("Ripper" )) {
1139
1145
ripper = ripper .substring (0 , ripper .indexOf ("Ripper" ));
1140
1146
}
1141
- about .append (ripper );
1142
- about .append ("</li>" );
1147
+ aboutContent .append ("- " ).append (ripper ).append ("\n " );
1143
1148
}
1144
- about .append ("</ul>" );
1145
- } catch (Exception e ) {
1146
- LOGGER .warn (e .getMessage ());
1147
- }
1148
1149
1149
- about .append ("<br>And download videos from video sites:" );
1150
- try {
1151
- List <String > rippers = Utils .getListOfVideoRippers ();
1152
- about .append ("<ul>" );
1153
- for (String ripper : rippers ) {
1154
- about .append ("<li>" );
1150
+ aboutContent .append ("\n Download videos from video sites:\n " );
1151
+ for (String ripper : videoRippers ) {
1155
1152
ripper = ripper .substring (ripper .lastIndexOf ('.' ) + 1 );
1156
1153
if (ripper .contains ("Ripper" )) {
1157
1154
ripper = ripper .substring (0 , ripper .indexOf ("Ripper" ));
1158
1155
}
1159
- about .append (ripper );
1160
- about .append ("</li>" );
1156
+ aboutContent .append ("- " ).append (ripper ).append ("\n " );
1161
1157
}
1162
- about .append ("</ul>" );
1163
- } catch (Exception e ) {
1164
- LOGGER .warn (e .getMessage ());
1165
- }
1166
1158
1167
- about .append ("Do you want to visit the project homepage on Github?" );
1168
- about .append ("</html>" );
1169
- int response = JOptionPane .showConfirmDialog (null , about .toString (), mainFrame .getTitle (),
1170
- JOptionPane .YES_NO_OPTION , JOptionPane .PLAIN_MESSAGE , new ImageIcon (mainIcon ));
1171
- if (response == JOptionPane .YES_OPTION ) {
1172
- try {
1173
- Desktop .getDesktop ().browse (URI .create ("http://github.com/ripmeapp/ripme" ));
1174
- } catch (IOException e ) {
1175
- LOGGER .error ("Exception while opening project home page" , e );
1159
+ aboutTextArea .setText (aboutContent .toString ());
1160
+
1161
+ // Ensure the scroll pane starts at the top
1162
+ SwingUtilities .invokeLater (() -> scrollPane .getVerticalScrollBar ().setValue (0 ));
1163
+
1164
+ JPanel aboutPanel = new JPanel (new BorderLayout ());
1165
+ JLabel titleLabel = new JLabel ("Download albums and videos from various websites" , JLabel .CENTER );
1166
+ titleLabel .setFont (titleLabel .getFont ().deriveFont (Font .BOLD , 16 ));
1167
+ aboutPanel .add (titleLabel , BorderLayout .NORTH );
1168
+ aboutPanel .add (scrollPane , BorderLayout .CENTER );
1169
+
1170
+ JLabel footerLabel = new JLabel ("Do you want to visit the project homepage on GitHub?" , JLabel .CENTER );
1171
+ aboutPanel .add (footerLabel , BorderLayout .SOUTH );
1172
+
1173
+ int response = JOptionPane .showConfirmDialog (null , aboutPanel , mainFrame .getTitle (),
1174
+ JOptionPane .YES_NO_OPTION , JOptionPane .PLAIN_MESSAGE , new ImageIcon (mainIcon ));
1175
+ if (response == JOptionPane .YES_OPTION ) {
1176
+ try {
1177
+ Desktop .getDesktop ().browse (URI .create ("http://github.com/ripmeapp/ripme" ));
1178
+ } catch (IOException e ) {
1179
+ LOGGER .error ("Exception while opening project home page" , e );
1180
+ }
1176
1181
}
1182
+ } catch (Exception e ) {
1183
+ LOGGER .warn (e .getMessage ());
1177
1184
}
1178
1185
});
1179
1186
0 commit comments