-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TitleBar API feedback #9700
Comments
They probably wanted to avoid |
Agree with the commentary above. To add:
It's also confusing this isn't just part of |
Yeah being able to write <Window>
<Window.TitleBar>
<TitleBar />
</Window.TitleBar>
</Window> would have been way more intuitive, but unfortunately the baseclass of Window is wrong and prevents this. |
That property element syntax is OK on Window; that's a general Xaml language syntax and not specific to DO. E.g. you can do
|
@MikeHillberg Yes but now you can't evaluate binding context. The thing falls apart a soon as you want to bind etc:
Not to mention your example above didn't even work until very recently and had to be set in code-behind ;D |
What would be the best practice to use this TitleBar control, along with a TabView control, where the tabs are not a drag region, but the bar where the tabs are contained, is draggable? Titlebar's Tall mode would fit well with the TabView, but can you collapse the Header, Icon, Title, Subtitle parts, so content takes up more space? |
Leading/Trailing instead of Header/Footer would work for RTL too. That's what Apple does: https://developer.apple.com/documentation/swiftui/toolbaritemplacement/topbarleading |
I agree that the pane button is too opinionated and having a button collection instead would be good, but the back button makes sense as a dedicated option. Uniformity there is good and provides a direct alternative to the old CoreWindow back button from UWP. The back button also has a different style that makes sense only for the back button (goes all the way to the edges, like caption buttons), so it’s good that it’s distinct. |
It being opinionated is a good thing. Windows has been blamed for its inconsistency for a long time and enforcing some kind of consistency is good here. Devs who wish to have custom button collections could always implement their own. I find it wise to leave the official default to represent "what we want devs to do". That's the point of the title bar control - to make apps look the same according to the fluent guideline. (In fact, you can argue navigation view etc also suffer from this "all apps look the same" problem, but again this is a good thing to have uniformity/consistency. The biggest benefit of consistency is users familiarity) |
I'd argue that's just as confusing. I can see the consistency argument to some extent, but we could also break with it before it becomes a pattern. |
I see. It's still in experimental preview. Everything is possible. Then I hope it gets simpler as you suggest in your comment above. |
Yeah hopefully the design isn't settled yet. I assume the experimental previews are here for not just bug testing, but also so we have a chance to give feedback on the overall features, hence this issue. |
I am comfortable with the current design, however renaming the header and footer will be better, but I disagree with simplifying the title bar and removing the pane button, if you want to put more buttons you can use Header property. or if you dont need pane button, just Hide it. (IsPaneToggleButtonVisible). There is nothing wrong with the programs being similar. |
I think opposite, that this is very good when platform get consistency across apps. This the first concern about windows, that every app looks different some from XP era, some from Vista/7, some Win10. When you have a common component that satisfies 95% applications and it looks identical - this is good. It helps with muscle memory and overall experience. |
I disagree about the Pane and Back buttons point as well. I like that they're options in there. |
I have a request for the Title / Subtitle property. The Subtitle property is not required. This will keep the properties clean, and if you want to include Subtitle, just put Title and Subtitle in the StackPanel. |
Isn't that the Header? |
|
Sorry, I meant TitleBar API feedback, but if you mean off-topic, forget it. |
Just realizing that the repo https://github.com/microsoft/microsoft-ui-xaml-specs is still a tiny bit alive. Perhaps the TitleBar API should have been proposed over there first and feedback solicited prior to shipping it in EXP1? There's been several new controls shipped in the past few releases, but none of them went through the spec repo. |
For whatever reason, the Content and Footer regions are both dragging regions rather than interactive regions for my code. Is there anything wrong with this? <TitleBar x:Name="TitleBarControl" IsBackButtonVisible="True" IsPaneToggleButtonVisible="True" Title="Sample App" Subtitle="Sample">
<AutoSuggestBox QueryIcon="Find" PlaceholderText="Find" MinWidth="300" MaxWidth="500" Margin="8"/>
<TitleBar.Footer>
<PersonPicture Height="30" Width="30" Initials="JD" />
</TitleBar.Footer>
</TitleBar> public MainWindow()
{
this.InitializeComponent();
this.ExtendsContentIntoTitleBar = true;
this.AppWindow.TitleBar.PreferredHeightOption = Microsoft.UI.Windowing.TitleBarHeightOption.Tall;
this.SetTitleBar(TitleBarControl);
TitleBarControl.Loaded += TitleBarControl_Loaded;
}
private void TitleBarControl_Loaded(object sender, RoutedEventArgs e)
{
// Parts get delay loaded. If you have the parts, make them visible.
VisualStateManager.GoToState(TitleBarControl, "SubtitleTextVisible", false);
VisualStateManager.GoToState(TitleBarControl, "ContentVisible", false);
VisualStateManager.GoToState(TitleBarControl, "FooterVisible", false);
// Run layout so we re-calculate the drag regions.
TitleBarControl.InvalidateMeasure();
} |
@dongle-the-gadget |
Exciting to see this much enthusiasm for the new control! Let me try to answer questions here... |
I agree with you here, it will be amazing to not need the extra code-behind and Grid for layout here. This will be a change on the Window class so more planning will be needed if feature is approved. |
You are correct. In the initial spec'ing process, we examined the existing design patterns and how we can achieve parity with what the design team has in the Windows Visual Design toolkit. The patterns and scenarios outlined in the toolkit are the most common use-cases for the control. It is important to be aligned with that to be consistent with Windows theming.
And in examining the TabView use case, we realized that TabView in the non-client (title bar) area is a control in itself, and does not need the features spec'd in this iteration of TitleBar. Hence, for now, TabView in TitleBar pattern will be a separate implementation to this control. |
👀 |
Yes this is a bug. This will be fixed in the next experimental release. |
The |
Is the change to the Window class something the team is actively considering?
What is the Windows Visual Design toolkit? Are you referring instead to the WinUI 3-only Windows UI Toolkit? (Aside: Current design guidance is built around WinUI 3, which is not really accessible to anyone not using C# + MSBuild and cannot be adopted by the majority of apps in the ecosystem. We don't have any framework-agnostic design guidance or tokens at this time.)
Is renaming the attributes on the table? If not, it'd be great if you told us upfront so we don't waste our time discussing it further here. |
I would love to be able to use SVGs for the titlebar icon so they scale on high DPI correctly. Actually, SVGs everywhere in WinUI should be standard. Coming from WinForms + DevExpress controls where I have been using SVGs for years and everything scales beautifully, then coming to WinUI where we are still using PNGs feels like a big step backwards. Unless I am missing something, I have only been using WinUI for a few months. Fonts shouldn't be the only answer to scalable icons. Anyway, I love where the new titlebar changes are going, I have been using the WinUICommunity titlebar feature up until now. |
There is now a PR for the TitleBar spec: #10056 |
Here's an insight: A head is not a synonym for the top but for the leading part. Animals that are "built horizontally" have their head at the front, not on top. I understand the thought, but don't agree. |
@Jay-o-Way Surely you will agree that their feet are usually on the ground, at the very bottom, and not trailing behind them? But this isn't about head and feet on animals but rather, but header and footer, so think documents, building construction etc where those words are used. |
Summary
I'm looking at the new TitleBar, and while functionally and visually I LOVE it, I have some concerns about the API itself.
First of all, the naming of
Header
andFooter
is very misleading. Those names typically refer to top/bottom items, and the entire control in-of-itself is a header control. I looked at those properties and couldn't at all guess what they really were for, until I saw this image:Generally I'd prefer naming that allows you do an informed guess what they do, and in the community call several people were confused about this.
So these are left/right, and I'm not actually sure if Header is before or after those buttons (illustration doesn't make that clear).
Header
also clashes with theTitle
here, adding extra confusion.My second (albeit slightly lesser) concern is the use of Pane and Back buttons. It's extremely opinionated, and I worry we're gonna get too many apps looking too identical. I'd rather this was a Button collection of sorts instead, where I could choose to add some buttons, or choose to just put them in the "Headers" content (pending a better name). If I needed a 3rd button there I'm out of luck.
Then there's the
TitlebarTemplateSettings
class:I find this a bit weird. When I think template, I think control templates, but this appears to just be a way to set the app icon - why not just set the icon on the TitleBar directly? But more importantly I think that this should be a Window property (not AppWindow, but Window Window!) that also applies if I don't use the TitleBar.
Another approach is perhaps providing a MUCH simpler titlebar control that just takes care of allowing you to interact with buttons and textboxes etc, while still being able to drag the rest, but you own the entire content as a single content item. Then you add a secondary subclass of that titlebar that adds this more opionated version to cover some common scenarios.
The text was updated successfully, but these errors were encountered: