Add launcher item tooltips

This commit is contained in:
Ray Berezowski
2026-08-26 22:04:26 -04:00
parent 5421e3dde3
commit 6d9bbbab02
4 changed files with 53 additions and 6 deletions

View File

@@ -14,6 +14,7 @@ Download the compiled Windows release from:
- Global hotkey, default `Ctrl+Alt+Space` - Global hotkey, default `Ctrl+Alt+Space`
- Search/filter in the launcher popup with parent menu context - Search/filter in the launcher popup with parent menu context
- Keyboard navigation in the launcher popup - Keyboard navigation in the launcher popup
- Tooltips for launcher items, menu paths, targets, and arguments
- Recent items section for quickly relaunching entries - Recent items section for quickly relaunching entries
- Nested menus, drag/drop ordering, and drag/drop item creation in Settings - Nested menus, drag/drop ordering, and drag/drop item creation in Settings
- Right-click launcher entries to edit them in Settings - Right-click launcher entries to edit them in Settings

View File

@@ -12,8 +12,8 @@
<Authors>Ray Berezowski</Authors> <Authors>Ray Berezowski</Authors>
<ApplicationIcon>Assets\AppIcon.ico</ApplicationIcon> <ApplicationIcon>Assets\AppIcon.ico</ApplicationIcon>
<Version>1.0.1</Version> <Version>1.0.1</Version>
<AssemblyVersion>1.0.1.16</AssemblyVersion> <AssemblyVersion>1.0.1.17</AssemblyVersion>
<FileVersion>1.0.1.16</FileVersion> <FileVersion>1.0.1.17</FileVersion>
<InformationalVersion>1.0.1</InformationalVersion> <InformationalVersion>1.0.1</InformationalVersion>
</PropertyGroup> </PropertyGroup>

View File

@@ -146,7 +146,8 @@ public partial class LauncherPopup : Window
IsExpanded = expandMenusByDefault, IsExpanded = expandMenusByDefault,
Margin = new Thickness(depth * 12, 4, 0, 4), Margin = new Thickness(depth * 12, 4, 0, 4),
Focusable = true, Focusable = true,
Tag = item Tag = item,
ToolTip = CreateItemToolTip(item)
}; };
expander.KeyDown += NavigationControl_KeyDown; expander.KeyDown += NavigationControl_KeyDown;
expander.Expanded += (_, _) => RebuildNavigationAndReposition(); expander.Expanded += (_, _) => RebuildNavigationAndReposition();
@@ -168,7 +169,8 @@ public partial class LauncherPopup : Window
Margin = new Thickness(depth * 12, 2, 0, 2), Margin = new Thickness(depth * 12, 2, 0, 2),
MinHeight = DisplayModeMetrics.GetRowHeight(GetEffectiveDisplayMode(item)), MinHeight = DisplayModeMetrics.GetRowHeight(GetEffectiveDisplayMode(item)),
HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left, HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left,
Tag = item Tag = item,
ToolTip = CreateItemToolTip(item)
}; };
button.Click += (_, _) => launchItem(item); button.Click += (_, _) => launchItem(item);
@@ -204,7 +206,8 @@ public partial class LauncherPopup : Window
return new TextBlock return new TextBlock
{ {
Text = item.Title, Text = item.Title,
ContextMenu = contextMenu ContextMenu = contextMenu,
ToolTip = CreateItemToolTip(item)
}; };
} }
@@ -354,7 +357,8 @@ public partial class LauncherPopup : Window
MinHeight = Math.Max(DisplayModeMetrics.GetRowHeight(GetEffectiveDisplayMode(match.Item)), 48), MinHeight = Math.Max(DisplayModeMetrics.GetRowHeight(GetEffectiveDisplayMode(match.Item)), 48),
HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left, HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left,
Tag = match.Item, Tag = match.Item,
ContextMenu = CreateItemContextMenu(match.Item) ContextMenu = CreateItemContextMenu(match.Item),
ToolTip = CreateItemToolTip(match.Item, match.ParentPath)
}; };
button.Click += (_, _) => launchItem(match.Item); button.Click += (_, _) => launchItem(match.Item);
@@ -423,6 +427,46 @@ public partial class LauncherPopup : Window
return panel; return panel;
} }
private static System.Windows.Controls.ToolTip CreateItemToolTip(LauncherItem item, string? parentPath = null)
{
StackPanel panel = new() { MaxWidth = 520 };
AddToolTipLine(panel, item.Title, bold: true);
AddToolTipLine(panel, $"Type: {item.Type}");
if (!string.IsNullOrWhiteSpace(parentPath))
{
AddToolTipLine(panel, $"Menu: {parentPath}");
}
if (!string.IsNullOrWhiteSpace(item.Target))
{
AddToolTipLine(panel, $"Target: {item.Target}");
}
if (!string.IsNullOrWhiteSpace(item.Arguments))
{
AddToolTipLine(panel, $"Arguments: {item.Arguments}");
}
if (item.IsFavorite)
{
AddToolTipLine(panel, "Pinned to top");
}
return new System.Windows.Controls.ToolTip { Content = panel };
}
private static void AddToolTipLine(StackPanel panel, string text, bool bold = false)
{
panel.Children.Add(new TextBlock
{
Text = text,
FontWeight = bold ? FontWeights.SemiBold : FontWeights.Normal,
TextWrapping = TextWrapping.Wrap,
Margin = panel.Children.Count == 0 ? new Thickness(0) : new Thickness(0, 3, 0, 0)
});
}
private static void CollectMatches(IEnumerable<LauncherItem> items, string query, List<string> parentNames, List<SearchMatch> matches) private static void CollectMatches(IEnumerable<LauncherItem> items, string query, List<string> parentNames, List<SearchMatch> matches)
{ {
foreach (LauncherItem item in GetDisplayItems(items)) foreach (LauncherItem item in GetDisplayItems(items))

View File

@@ -30,6 +30,8 @@ Search results include the parent menu path when an item is inside a menu.
Use arrow keys, Home, End, Enter, and Escape to navigate the launcher popup from the keyboard. Use arrow keys, Home, End, Enter, and Escape to navigate the launcher popup from the keyboard.
Hover over launcher items to see details such as type, menu path, target, and arguments.
## Configure ## Configure
Open the tray menu and choose **Settings**. Open the tray menu and choose **Settings**.