diff --git a/README.md b/README.md index 1a077c8..960e4ec 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Download the compiled Windows release from: - Recent items section for quickly relaunching entries - 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 pin or unpin them from the top - Right-click item duplication in Settings - Right-click items in Settings to pin them to the top of their menu - Per-item icon and display mode diff --git a/TaskbarLauncher.csproj b/TaskbarLauncher.csproj index 1262538..4141908 100644 --- a/TaskbarLauncher.csproj +++ b/TaskbarLauncher.csproj @@ -12,8 +12,8 @@ Ray Berezowski Assets\AppIcon.ico 1.0.1 - 1.0.1.6 - 1.0.1.6 + 1.0.1.7 + 1.0.1.7 1.0.1 diff --git a/Views/LauncherPopup.xaml.cs b/Views/LauncherPopup.xaml.cs index ce5a6b5..6f39856 100644 --- a/Views/LauncherPopup.xaml.cs +++ b/Views/LauncherPopup.xaml.cs @@ -194,6 +194,7 @@ public partial class LauncherPopup : Window System.Windows.Controls.ContextMenu contextMenu = new(); contextMenu.Items.Add(openAllMenuItem); contextMenu.Items.Add(new Separator()); + contextMenu.Items.Add(CreatePinMenuItem(item)); contextMenu.Items.Add(CreateEditMenuItem(item)); return new TextBlock @@ -206,10 +207,29 @@ public partial class LauncherPopup : Window private System.Windows.Controls.ContextMenu CreateItemContextMenu(LauncherItem item) { System.Windows.Controls.ContextMenu contextMenu = new(); + contextMenu.Items.Add(CreatePinMenuItem(item)); contextMenu.Items.Add(CreateEditMenuItem(item)); return contextMenu; } + private System.Windows.Controls.MenuItem CreatePinMenuItem(LauncherItem item) + { + System.Windows.Controls.MenuItem pinMenuItem = new() + { + Header = item.IsFavorite ? "Unpin from Top" : "Pin to Top" + }; + pinMenuItem.Click += (_, e) => + { + item.IsFavorite = !item.IsFavorite; + ConfigService.Save(config); + BuildItems(); + QueueReposition(); + e.Handled = true; + }; + + return pinMenuItem; + } + private System.Windows.Controls.MenuItem CreateEditMenuItem(LauncherItem item) { System.Windows.Controls.MenuItem editMenuItem = new() diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 3eedfd8..34d8925 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -20,6 +20,7 @@ Install the **.NET Desktop Runtime** for **Windows x64**. 3. The app appears in the system tray. 4. Press `Ctrl+Alt+Space` to open the launcher. 5. Right-click a launcher entry and choose **Edit in Settings** to jump to that item. +6. Right-click a launcher entry and choose **Pin to Top** or **Unpin from Top**. Recently launched entries appear in the launcher popup under **Recent**.