From 117da1ba27802b4cc39d543c5b8e5528b353fabb Mon Sep 17 00:00:00 2001 From: Mark Heinis Date: Wed, 17 Apr 2024 13:57:27 +0200 Subject: [PATCH] Some small fixes --- .../CaptureWolf.Form/CaptureWolf.UI.csproj | 4 +- Windows/CaptureWolf.Form/frmCaptureWolf.cs | 1 + .../CaptureWolf.Form/frmSettings.Designer.cs | 82 ++++++++----------- Windows/CaptureWolf.Form/frmSettings.cs | 2 +- 4 files changed, 36 insertions(+), 53 deletions(-) diff --git a/Windows/CaptureWolf.Form/CaptureWolf.UI.csproj b/Windows/CaptureWolf.Form/CaptureWolf.UI.csproj index 19bb5ae..3f4a662 100644 --- a/Windows/CaptureWolf.Form/CaptureWolf.UI.csproj +++ b/Windows/CaptureWolf.Form/CaptureWolf.UI.csproj @@ -6,9 +6,7 @@ true enable - - SystemAware - true + PerMonitorV2 icon.ico CaptureWolf $(VersionPrefix) diff --git a/Windows/CaptureWolf.Form/frmCaptureWolf.cs b/Windows/CaptureWolf.Form/frmCaptureWolf.cs index 656a25a..90d8d0f 100644 --- a/Windows/CaptureWolf.Form/frmCaptureWolf.cs +++ b/Windows/CaptureWolf.Form/frmCaptureWolf.cs @@ -99,6 +99,7 @@ private void SetupTooltip() private void btnConfig_Click(object sender, EventArgs e) { var settingsForm = new frmSettings(); + settingsForm.StartPosition = FormStartPosition.CenterParent; settingsForm.ShowDialog(); } } diff --git a/Windows/CaptureWolf.Form/frmSettings.Designer.cs b/Windows/CaptureWolf.Form/frmSettings.Designer.cs index e246fd9..b4f7d37 100644 --- a/Windows/CaptureWolf.Form/frmSettings.Designer.cs +++ b/Windows/CaptureWolf.Form/frmSettings.Designer.cs @@ -1,7 +1,4 @@ -using CaptureWolf.UI.Properties; -using System.Windows.Forms; - -namespace CaptureWolf.UI +namespace CaptureWolf.UI { partial class frmSettings { @@ -31,83 +28,71 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - btnStop = new Button(); - btnClose = new Button(); label = new Label(); comboBox = new ComboBox(); lblTitleSettings = new Label(); + btnStop = new Button(); SuspendLayout(); // - // btnStop - // - btnStop.Anchor = AnchorStyles.Top | AnchorStyles.Right; - btnStop.BackColor = Color.FromArgb(0, 0, 23); - btnStop.FlatAppearance.BorderColor = Color.Gray; - btnStop.FlatStyle = FlatStyle.Flat; - btnStop.ForeColor = Color.White; - btnStop.Location = new Point(640, 12); - btnStop.Name = "btnStop"; - btnStop.Size = new Size(31, 27); - btnStop.TabIndex = 4; - btnStop.Text = "X"; - btnStop.UseVisualStyleBackColor = false; - // - // btnClose - // - btnClose.Anchor = AnchorStyles.Top | AnchorStyles.Right; - btnClose.BackColor = Color.FromArgb(0, 0, 23); - btnClose.FlatAppearance.BorderColor = Color.Gray; - btnClose.FlatStyle = FlatStyle.Flat; - btnClose.ForeColor = Color.White; - btnClose.Location = new Point(361, 12); - btnClose.Name = "btnClose"; - btnClose.Size = new Size(31, 27); - btnClose.TabIndex = 6; - btnClose.Text = "X"; - btnClose.UseVisualStyleBackColor = false; - btnClose.Click += btnClose_Click; - // // label // - label.Location = new Point(36, 99); + label.Location = new Point(103, 317); + label.Margin = new Padding(9, 0, 9, 0); label.Name = "label"; - label.Size = new Size(156, 23); + label.Size = new Size(446, 74); label.TabIndex = 0; label.Text = "Select resolution of camera:"; // // comboBox // - comboBox.Location = new Point(36, 125); + comboBox.Location = new Point(103, 400); + comboBox.Margin = new Padding(9, 10, 9, 10); comboBox.Name = "comboBox"; - comboBox.Size = new Size(317, 23); + comboBox.Size = new Size(898, 56); comboBox.TabIndex = 1; comboBox.SelectedIndexChanged += comboBox_SelectedIndexChanged; // // lblTitleSettings // lblTitleSettings.AutoSize = true; - lblTitleSettings.BackColor = Color.FromArgb(0, 0, 23); lblTitleSettings.Font = new Font("Segoe UI Semibold", 15.75F, FontStyle.Bold, GraphicsUnit.Point, 0); lblTitleSettings.ForeColor = Color.White; - lblTitleSettings.Location = new Point(36, 40); + lblTitleSettings.Location = new Point(103, 128); + lblTitleSettings.Margin = new Padding(9, 0, 9, 0); lblTitleSettings.Name = "lblTitleSettings"; - lblTitleSettings.Size = new Size(123, 30); + lblTitleSettings.Size = new Size(366, 85); lblTitleSettings.TabIndex = 5; lblTitleSettings.Text = "Preferences"; // + // btnStop + // + btnStop.Anchor = AnchorStyles.Top | AnchorStyles.Right; + btnStop.BackColor = Color.FromArgb(0, 0, 23); + btnStop.FlatAppearance.BorderColor = Color.Gray; + btnStop.FlatStyle = FlatStyle.Flat; + btnStop.ForeColor = Color.White; + btnStop.Location = new Point(1107, 19); + btnStop.Margin = new Padding(9, 10, 9, 10); + btnStop.Name = "btnStop"; + btnStop.Size = new Size(89, 86); + btnStop.TabIndex = 6; + btnStop.Text = "X"; + btnStop.UseVisualStyleBackColor = false; + btnStop.Click += btnClose_Click; + // // frmSettings // - AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleDimensions = new SizeF(20F, 48F); AutoScaleMode = AutoScaleMode.Font; - BackColor = Color.FromArgb(0, 0, 23); - ClientSize = new Size(404, 194); + BackColor = Color.FromArgb(0, 38, 71); + ClientSize = new Size(1214, 679); + Controls.Add(btnStop); Controls.Add(label); Controls.Add(comboBox); - Controls.Add(btnClose); Controls.Add(lblTitleSettings); - Controls.Add(btnStop); ForeColor = Color.White; FormBorderStyle = FormBorderStyle.None; + Margin = new Padding(9, 10, 9, 10); MaximizeBox = false; Name = "frmSettings"; Text = "Preferences"; @@ -146,10 +131,9 @@ private void Form_MouseUp(object sender, MouseEventArgs e) #endregion - private Button btnStop; - private Button btnClose; private Label label; private ComboBox comboBox; private Label lblTitleSettings; + private Button btnStop; } } \ No newline at end of file diff --git a/Windows/CaptureWolf.Form/frmSettings.cs b/Windows/CaptureWolf.Form/frmSettings.cs index 48e059b..33fe2b3 100644 --- a/Windows/CaptureWolf.Form/frmSettings.cs +++ b/Windows/CaptureWolf.Form/frmSettings.cs @@ -43,7 +43,7 @@ private void frmSettings_Load(object sender, EventArgs e) private void comboBox_SelectedIndexChanged(object sender, EventArgs e) { // Store the selected resolution in the settings - Properties.Settings.Default.Resolution = comboBox.SelectedItem.ToString(); + Properties.Settings.Default.Resolution = comboBox.SelectedItem?.ToString(); Properties.Settings.Default.Save(); } }