mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
CmdPal: Add a dock (#45824)
Add support for a "dock" window in CmdPal. The dock is a toolbar powered by the `APPBAR` APIs. This gives you a persistent region to display commands for quick shortcuts or glanceable widgets. The dock can be pinned to any side of the screen. The dock can be independently styled with any of the theming controls cmdpal already has The dock has three "regions" to pin to - the "start", the "center", and the "end". Elements on the dock are grouped as "bands", which contains a set of "items". Each "band" is one atomic unit. For example, the Media Player extension produces 4 items, but one _band_. The dock has only one size (for now) The dock will only appear on your primary display (for now) This PR includes support for pinning arbitrary top-level commands to the dock - however, we're planning on replacing that with a more universal ability to pin any command to the dock or top level. (see #45191). This is at least usable for now. This is definitely still _even more preview_ than usual PowerToys features, but it's more than usable. I'd love to get it out there and start collecting feedback on where to improve next. I'll probably add a follow-up issue for tracking the remaining bugs & nits. closes #45201 --------- Co-authored-by: Niels Laute <niels.laute@live.nl>
This commit is contained in:
@@ -26,8 +26,25 @@ public partial class PageViewModel : ExtensionObjectViewModel, IPageContext
|
||||
[ObservableProperty]
|
||||
public partial string ErrorMessage { get; protected set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Explicitly: is this page, the VM for the root page. This is used
|
||||
/// slightly differently than being "nested". When we open CmdPal as a
|
||||
/// transient window, we want that page to not have a back button, but that
|
||||
/// page is _not_ the root page.
|
||||
///
|
||||
/// Later in ListViewModel, we will have logic that checks if it is the root
|
||||
/// page, and modify how selection is handled when the list changes.
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
public partial bool IsNested { get; set; } = true;
|
||||
public partial bool IsRootPage { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// This is used to determine whether to show the back button on this page.
|
||||
/// When a nested page is opened for the transient "dock flyout" window,
|
||||
/// then we don't want to show the back button.
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
public partial bool HasBackButton { get; set; } = true;
|
||||
|
||||
// This is set from the SearchBar
|
||||
[ObservableProperty]
|
||||
|
||||
Reference in New Issue
Block a user