tjackenpacken / taskbar-groups

Lightweight utility for organizing the taskbar through groups
MIT License
2.42k stars 202 forks source link

Suggestion for adding group name when opening the shortcut #174

Open ghost opened 2 years ago

ghost commented 2 years ago

Just a little suggestion to add the group name when opening the shortcuts. I have amended the local copy of the source code to test and see what it is like.

image

I added the following lines to the frmMain.cs just before the foreach (ProgramShortcut psc in ThisCategory.Shortcutlist) line in the LoadCategory() function:

Label groupLabel = new Label();
groupLabel.Text = Regex.Replace(ThisCategory.Name, @"(_)+", " ");
groupLabel.Font = new Font("Segoe UI", 14.25f, FontStyle.Regular);
groupLabel.ForeColor = Color.Transparent;
groupLabel.Location = new System.Drawing.Point(x + 2, y + 2);
groupLabel.AutoSize = true;
this.Controls.Add(groupLabel);
y += groupLabel.Height + 4;
this.Height += groupLabel.Height + 4;

And to compensate for the label being wider then form body, I added this at the end of the function:

if(this.Width < groupLabel.Width + 4)
{
    this.Width = groupLabel.Width + 4;
}

Might not be the best way to implement it but it's simple. What are thoughts, would you be able to add this? Maybe as an option in the edit group window to display the group name. I am happy to contribute if needed.

Cheers,