From 3ba03b8f9ee1d275b8be76faf56d24be20af7431 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Fri, 11 Feb 2022 16:10:35 +0100 Subject: [PATCH] [BUG] "Pixel maximum menu width" not working as expected (#319), version 1.2.6.4 --- Properties/AssemblyInfo.cs | 4 ++-- UserInterface/Menu.Designer.cs | 26 ++++++++++++-------------- UserInterface/SettingsForm.cs | 2 +- Utilities/DataGridViewExtensions.cs | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index fb70628..d827b19 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.2.6.3")] -[assembly: AssemblyFileVersion("1.2.6.3")] +[assembly: AssemblyVersion("1.2.6.4")] +[assembly: AssemblyFileVersion("1.2.6.4")] diff --git a/UserInterface/Menu.Designer.cs b/UserInterface/Menu.Designer.cs index e9e0e2c..dbcfb3a 100644 --- a/UserInterface/Menu.Designer.cs +++ b/UserInterface/Menu.Designer.cs @@ -119,11 +119,7 @@ this.tableLayoutPanelSearch.BackColor = System.Drawing.Color.White; this.tableLayoutPanelSearch.ColumnCount = 2; this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanelSearch.Controls.Add(this.textBoxSearch, 1, 0); this.tableLayoutPanelSearch.Controls.Add(this.pictureBoxSearch, 0, 0); this.tableLayoutPanelSearch.Location = new System.Drawing.Point(3, 0); @@ -131,7 +127,7 @@ this.tableLayoutPanelSearch.Name = "tableLayoutPanelSearch"; this.tableLayoutPanelSearch.RowCount = 1; this.tableLayoutPanelSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelSearch.Size = new System.Drawing.Size(218, 22); + this.tableLayoutPanelSearch.Size = new System.Drawing.Size(153, 22); this.tableLayoutPanelSearch.TabIndex = 5; this.tableLayoutPanelSearch.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.DgvMouseWheel); // @@ -145,7 +141,7 @@ this.textBoxSearch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 2); this.textBoxSearch.MaxLength = 37; this.textBoxSearch.Name = "textBoxSearch"; - this.textBoxSearch.Size = new System.Drawing.Size(190, 15); + this.textBoxSearch.Size = new System.Drawing.Size(100, 15); this.textBoxSearch.TabIndex = 0; this.textBoxSearch.TextChanged += new System.EventHandler(this.TextBoxSearch_TextChanged); // @@ -196,18 +192,20 @@ this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 2F)); this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelMenu.Size = new System.Drawing.Size(224, 89); + this.tableLayoutPanelMenu.Size = new System.Drawing.Size(159, 89); this.tableLayoutPanelMenu.TabIndex = 4; this.tableLayoutPanelMenu.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.DgvMouseWheel); // // panelLine // + this.panelLine.AutoSize = true; + this.panelLine.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.panelLine.BackColor = System.Drawing.Color.Silver; this.panelLine.Dock = System.Windows.Forms.DockStyle.Fill; this.panelLine.Location = new System.Drawing.Point(3, 22); this.panelLine.Margin = new System.Windows.Forms.Padding(0); this.panelLine.Name = "panelLine"; - this.panelLine.Size = new System.Drawing.Size(218, 1); + this.panelLine.Size = new System.Drawing.Size(153, 1); this.panelLine.TabIndex = 6; // // tableLayoutPanelBottom @@ -236,14 +234,14 @@ this.tableLayoutPanelBottom.Name = "tableLayoutPanelBottom"; this.tableLayoutPanelBottom.RowCount = 1; this.tableLayoutPanelBottom.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelBottom.Size = new System.Drawing.Size(218, 22); + this.tableLayoutPanelBottom.Size = new System.Drawing.Size(153, 22); this.tableLayoutPanelBottom.TabIndex = 5; // // pictureBoxRestart // this.pictureBoxRestart.BackColor = System.Drawing.Color.Transparent; this.pictureBoxRestart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBoxRestart.Location = new System.Drawing.Point(187, 1); + this.pictureBoxRestart.Location = new System.Drawing.Point(122, 1); this.pictureBoxRestart.Margin = new System.Windows.Forms.Padding(1); this.pictureBoxRestart.Name = "pictureBoxRestart"; this.pictureBoxRestart.Size = new System.Drawing.Size(20, 20); @@ -259,7 +257,7 @@ // this.pictureBoxSettings.BackColor = System.Drawing.Color.Transparent; this.pictureBoxSettings.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBoxSettings.Location = new System.Drawing.Point(165, 1); + this.pictureBoxSettings.Location = new System.Drawing.Point(100, 1); this.pictureBoxSettings.Margin = new System.Windows.Forms.Padding(1); this.pictureBoxSettings.Name = "pictureBoxSettings"; this.pictureBoxSettings.Size = new System.Drawing.Size(20, 20); @@ -275,7 +273,7 @@ // this.pictureBoxMenuAlwaysOpen.BackColor = System.Drawing.Color.Transparent; this.pictureBoxMenuAlwaysOpen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBoxMenuAlwaysOpen.Location = new System.Drawing.Point(143, 1); + this.pictureBoxMenuAlwaysOpen.Location = new System.Drawing.Point(78, 1); this.pictureBoxMenuAlwaysOpen.Margin = new System.Windows.Forms.Padding(1); this.pictureBoxMenuAlwaysOpen.Name = "pictureBoxMenuAlwaysOpen"; this.pictureBoxMenuAlwaysOpen.Size = new System.Drawing.Size(20, 20); @@ -292,7 +290,7 @@ // this.pictureBoxOpenFolder.BackColor = System.Drawing.Color.Transparent; this.pictureBoxOpenFolder.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pictureBoxOpenFolder.Location = new System.Drawing.Point(121, 1); + this.pictureBoxOpenFolder.Location = new System.Drawing.Point(56, 1); this.pictureBoxOpenFolder.Margin = new System.Windows.Forms.Padding(1); this.pictureBoxOpenFolder.Name = "pictureBoxOpenFolder"; this.pictureBoxOpenFolder.Size = new System.Drawing.Size(20, 20); diff --git a/UserInterface/SettingsForm.cs b/UserInterface/SettingsForm.cs index 6ab3894..2f66357 100644 --- a/UserInterface/SettingsForm.cs +++ b/UserInterface/SettingsForm.cs @@ -353,7 +353,7 @@ namespace SystemTrayMenu.UserInterface } numericUpDownMenuWidth.Minimum = 50; - numericUpDownMenuWidth.Maximum = 1000; + numericUpDownMenuWidth.Maximum = 8000; numericUpDownMenuWidth.Increment = 10; numericUpDownMenuWidth.Value = Settings.Default.MaximumMenuWidth; diff --git a/Utilities/DataGridViewExtensions.cs b/Utilities/DataGridViewExtensions.cs index 13dfd8e..b612e9f 100644 --- a/Utilities/DataGridViewExtensions.cs +++ b/Utilities/DataGridViewExtensions.cs @@ -26,7 +26,7 @@ namespace SystemTrayMenu.Utilities foreach (DataGridViewRow row in rows) { float checkWidth = gfx.MeasureString( - row.Cells[i].Value.ToString() + "__", + row.Cells[i].Value.ToString() + "___", dgv.RowTemplate.DefaultCellStyle.Font) .Width; if (checkWidth > widthMax)