From 71d2c0b96c898ce881c05bcbe36ba55bea20a7ef Mon Sep 17 00:00:00 2001 From: karkarl <7976322+karkarl@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:39:12 -0800 Subject: [PATCH] address more comments --- specs/TitleBar/titleBar-dev-spec.md | 26 ++++++++++++++++++++-- specs/TitleBar/titlebar-functional-spec.md | 3 +-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/specs/TitleBar/titleBar-dev-spec.md b/specs/TitleBar/titleBar-dev-spec.md index f1e475ed42..b2b2742499 100644 --- a/specs/TitleBar/titleBar-dev-spec.md +++ b/specs/TitleBar/titleBar-dev-spec.md @@ -77,6 +77,10 @@ How can we allow such customizations? - Interactive content in TitleBar must also be capable of keyboard navigation. They should be treated as normal elements in the app's visual tree. +- TitleBar should meet [Windows app design guidelines](https://learn.microsoft.com/en-us/windows/apps/design/basics/titlebar-design#icon): + - A single-click/tap on the icon should show system window menu. + - A double-click/tap should close the window. + - CoreApplicationViewTitleBar.LayoutMetricsChanged and IsVisibleChanged events from the UWP world is missing in WinUI3: - LayoutMetricsChanged: Update Left and Right Inset for on DPI changes. @@ -169,14 +173,14 @@ TitleBar must handle mouse, touch, and keyboard scenarios. # Appendix -## Non-considerations +## Out of Scope +### Tabbed TitleBar Scenarios TitleBar is not needed for TabView scenarios - it may be considered as a separate `TabbedTitleBar` control. Below scenarios demonstrate that when Tabview occupies the entire width when extending into title bar. Header icons, buttons, and drag regions can be handled with TabView Header, and FooterArea. - ![Terminal TitleBar](images/1p-terminal-titlebar.png) ![NotePad TitleBar with TabView](images/1p-notepad-titlebar.png) ![Edge TitleBar](images/1p-edge-titlebar.png) @@ -185,3 +189,21 @@ Header icons, buttons, and drag regions can be handled with TabView Header, and - TabView needs a property to make space for icon or other elements - TabView also needs to make space for drag region on right. - FileExplorer currently has their own implement by setting a drag region and CaptionControl placeholder in TabView.FooterArea + +### AppWindow.TitleBar +Improvements to Window class to allow below syntax. This will greatly cut down the amount of code needed to +configure WinUI TitleBar. + +```xml + + + + + +``` +Ideally, this should also expose TitleBar to below properties and methods: +- Window.Title and AppWindow.Title +- AppWindow.SetIcon() + +This is out of scope for WinUI TitleBar hence will not be included in this spec. + diff --git a/specs/TitleBar/titlebar-functional-spec.md b/specs/TitleBar/titlebar-functional-spec.md index 25ee6666ff..fe0a61d393 100644 --- a/specs/TitleBar/titlebar-functional-spec.md +++ b/specs/TitleBar/titlebar-functional-spec.md @@ -93,6 +93,7 @@ public MainWindow() _Note: TitleBar currently needs to be set explicitly in the grid.row and referenced_ _by Window in codebehind as shown above._ _Improvements to Window are being considered to avoid this extra grid layout and codebehind._ +_Please see Appendix of [Functional Spec](titleBar-functional-spec.md)._ ## Scenario: TitleBar with WinUI Controls Integration TitleBar with common WinUI Controls: `AutoSuggestBox`, `PersonPicture`, `AppBarButton`. @@ -490,8 +491,6 @@ is content present in the `Header`, `Content`, and `Footer` content areas. Title elements are present. As the content areas are empty by default, the default height for TitleBar is `TitleBarCompactHeight`. - - # Figma link [Figma link](https://www.figma.com/file/sxPR9uvUNg6XQKSKOmlbK8/Fluent-Windows-Visual-Library?type=design&node-id=30201-110568&mode=design&t=ke7CzN5LvKzNA8LR-4)