Fixed MainFormSize save problem

This commit is contained in:
Jaex 2014-06-15 02:38:38 +03:00
parent 16593934bf
commit 5f4f3e4077
3 changed files with 7 additions and 2 deletions

View file

@ -156,6 +156,7 @@ public object Import(string json)
catch (Exception e)
{
DebugHelper.WriteException(e);
MessageBox.Show("Import failed.\n\n" + e.ToString(), "ShareX - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return null;

View file

@ -1763,6 +1763,7 @@ private void InitializeComponent()
this.Controls.Add(this.tsMain);
this.DoubleBuffered = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(400, 250);
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ShareX";

View file

@ -617,12 +617,15 @@ private void MainForm_Shown(object sender, EventArgs e)
private void MainForm_Resize(object sender, EventArgs e)
{
Refresh();
if (WindowState == FormWindowState.Normal)
{
Program.Settings.MainFormSize = Size;
}
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
Program.Settings.MainFormSize = Size;
if (e.CloseReason == CloseReason.UserClosing && Program.Settings.ShowTray && !forceClose)
{
e.Cancel = true;