aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/WindowBorder.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-14 10:03:28 -0400
committerMichael <[email protected]>2017-04-14 10:03:33 -0400
commit791290857f6feed7da6b583b8f39cb45698d69e8 (patch)
treee7957faabe1ba2319b49ffb9d81f81179dcfc1a5 /ShiftOS.WinForms/WindowBorder.cs
parent71440207cdaecea96f09f71861eb7b3af2c7d44e (diff)
downloadshiftos_thereturn-791290857f6feed7da6b583b8f39cb45698d69e8.tar.gz
shiftos_thereturn-791290857f6feed7da6b583b8f39cb45698d69e8.tar.bz2
shiftos_thereturn-791290857f6feed7da6b583b8f39cb45698d69e8.zip
Huge optimizations.
Windows load A LOT faster, and Shifter has a preview.
Diffstat (limited to 'ShiftOS.WinForms/WindowBorder.cs')
-rw-r--r--ShiftOS.WinForms/WindowBorder.cs75
1 files changed, 33 insertions, 42 deletions
diff --git a/ShiftOS.WinForms/WindowBorder.cs b/ShiftOS.WinForms/WindowBorder.cs
index 4fba470..4babbbd 100644
--- a/ShiftOS.WinForms/WindowBorder.cs
+++ b/ShiftOS.WinForms/WindowBorder.cs
@@ -129,7 +129,6 @@ namespace ShiftOS.WinForms
this.pnlcontents.Controls.Add(this._parentWindow);
this._parentWindow.Dock = DockStyle.Fill;
- this._parentWindow.Show();
ControlManager.SetupControls(this._parentWindow);
ParentWindow.OnSkinLoad();
@@ -139,9 +138,40 @@ namespace ShiftOS.WinForms
Setup();
ParentWindow.OnUpgrade();
};
+ Setup();
+ this._parentWindow.TextChanged += (o, a) =>
+ {
+ Setup();
+ Desktop.ResetPanelButtons();
+
+ };
+
+ this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
+ this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
- Desktop.ShowWindow(this);
+ if (!this.IsDialog)
+ {
+ Engine.AppearanceManager.OpenForms.Add(this);
+ }
+ SaveSystem.GameReady += () =>
+ {
+ if (Shiftorium.UpgradeInstalled("wm_free_placement"))
+ {
+ AppearanceManager.Invoke(new Action(() =>
+ {
+ this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
+ this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
+
+ }));
+ }
+ AppearanceManager.Invoke(new Action(() =>
+ {
+ Setup();
+ }));
+ };
+
+ ParentWindow.OnLoad();
}
/// <summary>
@@ -178,46 +208,7 @@ namespace ShiftOS.WinForms
public void WindowBorder_Load(object sender, EventArgs e)
{
this.DoubleBuffered = true;
-
- this._parentWindow.TextChanged += (o, a) =>
- {
- Setup();
- Desktop.ResetPanelButtons();
-
- };
-
- this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
- this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
-
- if (!this.IsDialog)
- {
- Engine.AppearanceManager.OpenForms.Add(this);
- }
-
- SaveSystem.GameReady += () =>
- {
- if (Shiftorium.UpgradeInstalled("wm_free_placement"))
- {
- AppearanceManager.Invoke(new Action(() =>
- {
- this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
- this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
-
- }));
- }
- AppearanceManager.Invoke(new Action(() =>
- {
- Setup();
- }));
- };
-
- ControlManager.SetupControls(this);
-
- Setup();
-
- var sWin = (IShiftOSWindow)ParentWindow;
-
- sWin.OnLoad();
+ this._parentWindow.Show();
}
/// <summary>