[Feature] Adjust width when items deleted (#431), version 1.3.0.17

This commit is contained in:
Markus Hofknecht 2022-08-07 17:49:42 +02:00
parent 2662b7540d
commit 123bece791
3 changed files with 6 additions and 10 deletions

View file

@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.16")] [assembly: AssemblyVersion("1.3.0.17")]
[assembly: AssemblyFileVersion("1.3.0.16")] [assembly: AssemblyFileVersion("1.3.0.17")]

View file

@ -386,10 +386,9 @@ namespace SystemTrayMenu.UserInterface
if (!Config.ShowSearchBar) if (!Config.ShowSearchBar)
{ {
tableLayoutPanelSearch.AutoSize = false;
tableLayoutPanelSearch.Height = 0;
textBoxSearch.AutoSize = false; textBoxSearch.AutoSize = false;
textBoxSearch.Height = 0; textBoxSearch.Size = new Size(0, 0);
textBoxSearch.Margin = new Padding(0);
pictureBoxSearch.Visible = false; pictureBoxSearch.Visible = false;
panelLine.Visible = false; panelLine.Visible = false;
} }

View file

@ -4,6 +4,7 @@
namespace SystemTrayMenu.Utilities namespace SystemTrayMenu.Utilities
{ {
using System;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
@ -36,11 +37,7 @@ namespace SystemTrayMenu.Utilities
int widthMaxInPixel = (int)(Scaling.Factor * Scaling.FactorByDpi * int widthMaxInPixel = (int)(Scaling.Factor * Scaling.FactorByDpi *
400f * (Properties.Settings.Default.WidthMaxInPercent / 100f)); 400f * (Properties.Settings.Default.WidthMaxInPercent / 100f));
if (widthMax > widthMaxInPixel) widthMax = Math.Min(widthMax, widthMaxInPixel);
{
widthMax = widthMaxInPixel;
}
dgv.Columns[1].Width = (int)(widthMax + 0.5); dgv.Columns[1].Width = (int)(widthMax + 0.5);
double factorIconSizeInPercent = Properties.Settings.Default.IconSizeInPercent / 100f; double factorIconSizeInPercent = Properties.Settings.Default.IconSizeInPercent / 100f;