mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Fixed MainFormSize save problem
This commit is contained in:
parent
16593934bf
commit
5f4f3e4077
3 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
1
ShareX/Forms/MainForm.Designer.cs
generated
1
ShareX/Forms/MainForm.Designer.cs
generated
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue