Skip to content

Commit

Permalink
Move initialization of controls into constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
dontpanic92 committed Jan 10, 2020
1 parent f7b1e95 commit 436f625
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Dotnvim/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ public Form1()
}
}
}

this.InitializeControls();
this.BlurBehind(Color.FromArgb(255, 255, 255, 255), Properties.Settings.Default.BackgroundOpacity, Properties.Settings.Default.BlurType);

var dwmBorderSize = Helpers.GetPixelSize(new Size2F(DwmBorderSize, DwmBorderSize), this.renderer.Dpi);
NativeInterop.Methods.ExtendFrame(this.Handle, dwmBorderSize.Width, dwmBorderSize.Height);

Properties.Settings.Default.PropertyChanged += this.Default_PropertyChanged;
}

/// <inheritdoc />
Expand Down Expand Up @@ -187,16 +195,6 @@ protected override void OnLoad(EventArgs e)
// Load window size and state
this.Size = Properties.WindowState.Default.WindowSize;
this.WindowState = Properties.WindowState.Default.IsMaximized ? FormWindowState.Maximized : FormWindowState.Normal;

this.InitializeControls();

this.BlurBehind(Color.FromArgb(255, 255, 255, 255), Properties.Settings.Default.BackgroundOpacity, Properties.Settings.Default.BlurType);

var dwmBorderSize = Helpers.GetPixelSize(new Size2F(DwmBorderSize, DwmBorderSize), this.renderer.Dpi);
NativeInterop.Methods.ExtendFrame(this.Handle, dwmBorderSize.Width, dwmBorderSize.Height);

Properties.Settings.Default.PropertyChanged += this.Default_PropertyChanged;

this.OnResize();
}

Expand Down

0 comments on commit 436f625

Please sign in to comment.