mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
Update layout settings.
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@9074 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -62,19 +62,19 @@ public class LayoutSettingsManager {
|
||||
String chatFrameWidth = Integer.toString(layoutSettings.getChatFrameWidth());
|
||||
String chatFrameHeight = Integer.toString(layoutSettings.getChatFrameHeight());
|
||||
String splitDividerLocation = Integer.toString(layoutSettings.getSplitPaneDividerLocation());
|
||||
|
||||
|
||||
props.setProperty("mainWindowX", mainWindowX);
|
||||
props.setProperty("mainWindowY", mainWindowY);
|
||||
props.setProperty("mainWindowHeight", mainWindowHeight);
|
||||
props.setProperty("mainWindowWidth", mainWindowWidth);
|
||||
|
||||
props.setProperty("mainWindowWidth", mainWindowWidth);
|
||||
|
||||
props.setProperty("chatFrameX", chatFrameX);
|
||||
props.setProperty("chatFrameY", chatFrameY);
|
||||
props.setProperty("chatFrameWidth", chatFrameWidth);
|
||||
props.setProperty("chatFrameHeight", chatFrameHeight);
|
||||
|
||||
|
||||
props.setProperty("splitDividerLocation", splitDividerLocation);
|
||||
|
||||
|
||||
try {
|
||||
props.store(new FileOutputStream(getSettingsFile()), "Storing Spark Layout Settings");
|
||||
}
|
||||
@ -121,7 +121,7 @@ public class LayoutSettingsManager {
|
||||
String chatFrameWidth = props.getProperty("chatFrameWidth");
|
||||
String chatFrameHeight = props.getProperty("chatFrameHeight");
|
||||
String splitDividerLocation = props.getProperty("splitDividerLocation");
|
||||
|
||||
|
||||
settings = new LayoutSettings();
|
||||
|
||||
final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
@ -133,11 +133,11 @@ public class LayoutSettingsManager {
|
||||
int mainWindowHeightInt = Integer.parseInt(mainWindowHeight);
|
||||
int mainWindowWidthInt = Integer.parseInt(mainWindowWidth);
|
||||
|
||||
if (mainWindowXInt + mainWindowWidthInt > width) {
|
||||
if (mainWindowXInt + mainWindowWidthInt > width || mainWindowXInt < 0) {
|
||||
mainWindowXInt = (width - mainWindowWidthInt) / 2;
|
||||
}
|
||||
|
||||
if (mainWindowYInt + mainWindowHeightInt > height) {
|
||||
if (mainWindowYInt + mainWindowHeightInt > height || mainWindowYInt < 0) {
|
||||
mainWindowYInt = (height - mainWindowHeightInt) / 2;
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ public class LayoutSettingsManager {
|
||||
int chatFrameWidthInt = Integer.parseInt(chatFrameWidth);
|
||||
int chatFrameHeightInt = Integer.parseInt(chatFrameHeight);
|
||||
int splitDividerLocationInt = splitDividerLocation == null ? -1 : Integer.parseInt(splitDividerLocation);
|
||||
|
||||
|
||||
if (chatFrameXInt + chatFrameWidthInt > width) {
|
||||
chatFrameXInt = (width - chatFrameWidthInt) / 2;
|
||||
}
|
||||
@ -156,6 +156,10 @@ public class LayoutSettingsManager {
|
||||
chatFrameYInt = (height - chatFrameHeightInt) / 2;
|
||||
}
|
||||
|
||||
if(chatFrameHeightInt < 100){
|
||||
chatFrameHeightInt = 100;
|
||||
}
|
||||
|
||||
|
||||
settings.setMainWindowX(mainWindowXInt);
|
||||
settings.setMainWindowY(mainWindowYInt);
|
||||
|
||||
Reference in New Issue
Block a user