Skip to content

Commit 53a7213

Browse files
authored
Merge pull request #288 from JacobPalecki/1.7bugfixStyle
1.7.0 bugfix follow-up: Style edits and remove dpi awareness
2 parents 75032d9 + 6f360aa commit 53a7213

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

grapher/App.config

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<section name="grapher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
66
</sectionGroup>
77
</configSections>
8-
<System.Windows.Forms.ApplicationConfigurationSection>
8+
<!--<System.Windows.Forms.ApplicationConfigurationSection>
99
<add key="DpiAwareness" value="PerMonitorV2" />
10-
</System.Windows.Forms.ApplicationConfigurationSection>
10+
</System.Windows.Forms.ApplicationConfigurationSection>-->
1111
<startup>
1212
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
1313
</startup>
@@ -19,9 +19,9 @@
1919
<setting name="Size" serializeAs="String">
2020
<value>930, 990</value>
2121
</setting>
22-
<setting name="HasRunBefore" serializeAs="String">
23-
<value>False</value>
24-
</setting>
22+
<setting name="HasRunBefore" serializeAs="String">
23+
<value>False</value>
24+
</setting>
2525
</grapher.Properties.Settings>
2626
</userSettings>
2727
</configuration>

grapher/Form1.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,27 +388,31 @@ private void RawAcceleration_Shown(object sender, EventArgs e)
388388
{
389389
var sizeDirect = chartsPanel.GetPreferredSize(Constants.MaxSize);
390390
Console.WriteLine($"[BeginInvoke] Direct size: {sizeDirect}");
391+
391392
if (Properties.Settings.Default.HasRunBefore)
392393
{
393-
var rect = new Rectangle(Properties.Settings.Default.Location, Properties.Settings.Default.Size);
394-
bool isVisible = Screen.AllScreens.Any(s => s.WorkingArea.IntersectsWith(rect));
395-
if (isVisible)
394+
var savedSettingsRect = new Rectangle(Properties.Settings.Default.Location, Properties.Settings.Default.Size);
395+
bool isSavedSettingsVisible = Screen.AllScreens.Any(s => s.WorkingArea.IntersectsWith(savedSettingsRect));
396+
if (isSavedSettingsVisible)
397+
{
398+
//this.Location = Properties.Settings.Default.Location;
399+
//this.Size = Properties.Settings.Default.Size;
400+
}
401+
else
396402
{
397-
this.Location = Properties.Settings.Default.Location;
398-
this.Size = Properties.Settings.Default.Size;
403+
ResizeAndCenter();
399404
}
400405
}
401-
402406
else
403407
{
404408
Properties.Settings.Default.HasRunBefore = true;
405409
Properties.Settings.Default.Save();
406-
this.BeginInvoke(new MethodInvoker(() =>
410+
IAsyncResult result = this.BeginInvoke(new MethodInvoker(() =>
407411
{
408412
ResizeAndCenter();
409413
}));
414+
this.EndInvoke(result);
410415
}
411-
412416
}
413417
}
414418
}

grapher/Properties/Settings.Designer.cs

Lines changed: 5 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

grapher/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@
88
<Setting Name="Size" Type="System.Drawing.Size" Scope="User">
99
<Value Profile="(Default)">930, 990</Value>
1010
</Setting>
11+
<Setting Name="HasRunBefore" Type="System.Boolean" Scope="User">
12+
<Value Profile="(Default)">False</Value>
13+
</Setting>
1114
</Settings>
1215
</SettingsFile>

0 commit comments

Comments
 (0)