Fix Mainwindow Bounds not restoring - Replace File Transfer Icon in Preference - Attempt fix for null pointer in preference[to be tested]

This commit is contained in:
Amos Chepchieng
2020-12-20 10:48:50 +03:00
parent 8b95d439f6
commit d06bf16eb5
4 changed files with 15 additions and 16 deletions

View File

@ -126,7 +126,7 @@ public final class MainWindow extends ChatFrame implements ActionListener {
if ( mainWindowBounds == null || mainWindowBounds.width <= 0 || mainWindowBounds.height <= 0 )
{
// Use default settings.
setSize(530, 500);
setSize(500, 520);
GraphicUtils.centerWindowOnScreen(this);
}
else

View File

@ -1360,7 +1360,7 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
final Rectangle mainWindowBounds = settings.getMainWindowBounds();
if (mainWindowBounds == null || mainWindowBounds.width <= 0 || mainWindowBounds.height <= 0) {
// Use Default size
mainWindow.setSize(530, 520);
mainWindow.setSize(500, 520);
// Center Window on Screen
GraphicUtils.centerWindowOnScreen(mainWindow);
@ -1370,7 +1370,6 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
if (loginDialog != null) {
if (loginDialog.isVisible()) {
mainWindow.setSize(460, 520);
mainWindow.setVisible(true);
}
loginDialog.dispose();

View File

@ -50,7 +50,7 @@ public class FileTransferPreference implements Preference {
@Override
public Icon getIcon() {
return SparkRes.getImageIcon(SparkRes.SEND_FILE_24x24);
return SparkRes.getImageIcon(SparkRes.SEND_FILE_ICON);
}
@Override

View File

@ -115,14 +115,14 @@ public class ThemePanel extends JPanel {
}
private void setNewLaF() {
// final String selectedName = (String) _lookandfeel.getSelectedItem();
// try {
// final String className = LookAndFeelManager.getClassName(selectedName);
// // UIManager.setLookAndFeel(className);
// // TODO setJTattooBar( _lookandfeelname.get( _lookandfeel.getSelectedIndex() ) );
// } catch (Exception e) {
// Log.error("An unexpected exception occurred while trying to update Look and Feel to '" + selectedName + "'.", e);
// }
final String selectedName = (String) _lookandfeel.getSelectedItem();
try {
final String className = LookAndFeelManager.getClassName(selectedName);
UIManager.setLookAndFeel(className);
// TODO setJTattooBar( _lookandfeelname.get( _lookandfeel.getSelectedIndex() ) );
} catch (Exception e) {
Log.error("An unexpected exception occurred while trying to update Look and Feel to '" + selectedName + "'.", e);
}
}
private void updateAllComponentsLaF(final Window window) {
@ -139,8 +139,8 @@ public class ThemePanel extends JPanel {
// substance is a PITA! If the current laf is substance, and the new laf is not, we need to
// refresh all components, but since substance is very stubborn, we must restart.
final String currentName = UIManager.getLookAndFeel().getName().toLowerCase();
final String selectedName = ((String) _lookandfeel.getSelectedItem());
final String currentName = "SparkLighLaf".toLowerCase();//UIManager.getLookAndFeel().getName().toLowerCase();
final String selectedName = "SparkLighLaf";//((String) _lookandfeel.getSelectedItem());
final String selectedClass = LookAndFeelManager.getClassName(selectedName);
if (currentName.contains("substance") && !selectedName.toLowerCase().contains("substance")) {
final int selectedOption = JOptionPane.showConfirmDialog(SparkManager.getPreferenceManager().getPreferenceDialog(),
@ -240,7 +240,7 @@ public class ThemePanel extends JPanel {
}
public String getSelectedLookAndFeelName() {
return (String) this._lookandfeel.getSelectedItem();
return "SparkLightLaf"; //(String) this._lookandfeel.getSelectedItem();
}
public String getSelectedLookAndFeelClassName() {
@ -314,7 +314,7 @@ public class ThemePanel extends JPanel {
final String className = pref.getLookAndFeel();
final String name = LookAndFeelManager.getName(className);
_lookandfeel.setSelectedItem(name);
_lookandfeel.setSelectedItem("SparkLighLaf");
showVCards.setSelected(pref.areVCardsVisible());