Skip to content

Commit

Permalink
Properly load and save background grid color when background grid is …
Browse files Browse the repository at this point in the history
…disabled
  • Loading branch information
njcrawford committed Apr 5, 2016
1 parent 2d78fbc commit 9c44d3e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
28 changes: 16 additions & 12 deletions embroideryReader/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public frmMain()
args = Environment.GetCommandLineArgs();
}

private void checkSettings()
private void loadSettings(bool reload)
{
if (settings.backgroundColorEnabled)
{
Expand All @@ -66,16 +66,19 @@ private void checkSettings()
{
panel2.BackColor = Color.FromKnownColor(KnownColor.Control);
}
if (settings.windowMaximized)
if (!reload)
{
// Check maximized first
this.WindowState = FormWindowState.Maximized;
}
else
{
// Not maximized, restore last saved window size
this.Width = settings.windowWidth;
this.Height = settings.windowHeight;
if (settings.windowMaximized)
{
// Check maximized first
this.WindowState = FormWindowState.Maximized;
}
else
{
// Not maximized, restore last saved window size
this.Width = settings.windowWidth;
this.Height = settings.windowHeight;
}
}
setDesignScaleSetting(1.0f, settings.AutoScaleDesign, false);
}
Expand All @@ -86,7 +89,7 @@ private void Form1_Load(object sender, EventArgs e)
this.Text = APP_TITLE;

// Load and check settings
checkSettings();
loadSettings(false);

// Load translation
loadTranslatedStrings(settings.translation);
Expand Down Expand Up @@ -510,7 +513,8 @@ private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
if (tempForm.ShowDialog() == DialogResult.OK)
{
settings = tempForm.settingsToModify;
checkSettings();
loadSettings(true);
updateDesignImage();
}
loadTranslatedStrings(settings.translation);
}
Expand Down
5 changes: 1 addition & 4 deletions embroideryReader/frmSettingsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ public EmbroideryReaderSettings settingsToModify
chkDrawGrid.Checked = settings.transparencyGridEnabled;
gridSize = settings.transparencyGridSize;
txtGridSize.Text = gridSize.ToString();
if(chkDrawGrid.Checked)
{
transparencyGridColor = settings.transparencyGridColor;
}
transparencyGridColor = settings.transparencyGridColor;
updateGridColorControls();
}
}
Expand Down

0 comments on commit 9c44d3e

Please sign in to comment.