From fb0f07c19a3e79627faa70ce0642ae39d234b228 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Tue, 9 Aug 2022 14:28:19 +0200 Subject: [PATCH] [BUG] Fix CheckForUpdatesDialog dpi scaling for button (#439), version 1.2.0.19 --- Helpers/Updater/GitHubUpdate.cs | 48 ++++++++++++++++++--------------- Properties/AssemblyInfo.cs | 4 +-- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Helpers/Updater/GitHubUpdate.cs b/Helpers/Updater/GitHubUpdate.cs index 329a105..520ed42 100644 --- a/Helpers/Updater/GitHubUpdate.cs +++ b/Helpers/Updater/GitHubUpdate.cs @@ -125,33 +125,37 @@ namespace SystemTrayMenu.Helper.Updater label.Text = $"{Translator.GetText("Latest available version:")} {GetLatestVersionName()}"; newVersionForm.Controls.Add(label); - Button okButton = new(); - okButton.DialogResult = DialogResult.OK; - okButton.Name = "okButton"; - okButton.Location = new Point( - newVersionForm.ClientSize.Width - okButton.Size.Width - ClientPad, - newVersionForm.ClientSize.Height - okButton.Size.Height - ClientPad); - okButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; - okButton.Text = Translator.GetText("OK"); - newVersionForm.Controls.Add(okButton); + Button buttonOK = new(); + buttonOK.DialogResult = DialogResult.OK; + buttonOK.Name = "buttonOK"; + buttonOK.Location = new Point( + newVersionForm.ClientSize.Width - buttonOK.Size.Width - ClientPad, + newVersionForm.ClientSize.Height - buttonOK.Size.Height - ClientPad); + buttonOK.MinimumSize = new Size(75, 23); + buttonOK.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonOK.Text = Translator.GetText("OK"); + buttonOK.AutoSizeMode = AutoSizeMode.GrowAndShrink; + buttonOK.AutoSize = true; + newVersionForm.Controls.Add(buttonOK); - Button wwwButton = new(); - wwwButton.DialogResult = DialogResult.Yes; - wwwButton.Name = "wwwButton"; - wwwButton.Location = new Point( - newVersionForm.ClientSize.Width - wwwButton.Size.Width - ClientPad - okButton.Size.Width - ClientPad, - newVersionForm.ClientSize.Height - wwwButton.Size.Height - ClientPad); - wwwButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; - wwwButton.Text = Translator.GetText("Go to download page"); - wwwButton.AutoSizeMode = AutoSizeMode.GrowAndShrink; - wwwButton.AutoSize = true; - newVersionForm.Controls.Add(wwwButton); + Button buttonGoToDownloadPage = new(); + buttonGoToDownloadPage.DialogResult = DialogResult.Yes; + buttonGoToDownloadPage.Name = "buttonGoToDownloadPage"; + buttonGoToDownloadPage.Location = new Point( + newVersionForm.ClientSize.Width - buttonGoToDownloadPage.Size.Width - ClientPad - buttonOK.Size.Width - ClientPad, + newVersionForm.ClientSize.Height - buttonGoToDownloadPage.Size.Height - ClientPad); + buttonGoToDownloadPage.MinimumSize = new Size(75, 23); + buttonGoToDownloadPage.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonGoToDownloadPage.Text = Translator.GetText("Go to download page"); + buttonGoToDownloadPage.AutoSizeMode = AutoSizeMode.GrowAndShrink; + buttonGoToDownloadPage.AutoSize = true; + newVersionForm.Controls.Add(buttonGoToDownloadPage); TextBox textBox = new(); textBox.Location = new Point(ClientPad, label.Location.Y + label.Size.Height + 5); textBox.Size = new Size( newVersionForm.ClientSize.Width - (ClientPad * 2), - okButton.Location.Y - ClientPad - textBox.Location.Y); + buttonOK.Location.Y - ClientPad - textBox.Location.Y); textBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; textBox.Multiline = true; textBox.Text = GetChangelog(); @@ -161,7 +165,7 @@ namespace SystemTrayMenu.Helper.Updater textBox.ForeColor = Color.FromKnownColor(KnownColor.ControlText); newVersionForm.Controls.Add(textBox); - newVersionForm.AcceptButton = okButton; + newVersionForm.AcceptButton = buttonOK; return newVersionForm.ShowDialog(); } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index c23b480..cd6e3d2 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.18")] -[assembly: AssemblyFileVersion("1.3.0.18")] +[assembly: AssemblyVersion("1.2.0.19")] +[assembly: AssemblyFileVersion("1.2.0.19")]