-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Porting Fluent Design Styles and Controls #3950
Comments
WinUi is not crossplatform en avalonia is crossplatform so i dont think that wil work What is what you want to use from WinUI? Regards, Remco |
We already have the ItemsRepeater ported to Avalonia. This shows porting controls from Winui is possible. Contributions are welcome. |
Consuming WinUI would be possible via native window embedding. There is no much point in doing that though, since it will only work on Windows. |
@JamRemco an effort to update the official theme / templates to match WinUI is about to start, maybe we can collaborate. |
@danwalmsley Sounds like a plan The template have a lot of hardcoded properties like fonts and such Regards, Remco |
I've updated the issue. |
I think we can get hold of the actual templates for UWP / WinUI using visual studio and at least the UWP ones are public, not sure about winui but im guessing they will be. It seems Avalonia will need theme support before we can start however, will discuss with @kekekeks what needs doing first. |
Just to add here, you can get the full UWP base templates & themes from the themeresources.xaml & generic.xaml files from the Windows SDK: And if you really want to get fancy and get the user's current Accent Color & color setting preferences, you can p/invoke uxtheme.dll to get it (note: not my own discovery, though I can't remember the source where I got this from). These are undocumented APIs, but google is helpful. Also, not sure how far back in Win10 versions these go
Check if dark mode is requested (these I believe are recent Win10 only)
Helper to get ImmersiveColor
Get Accent Color(s)
|
@danwalmsley @amwx @JamRemco That said, do NOT get the latest styles from the generic.xaml that ships with Windows (the huge file). The WinUI library currently has the latest XAML styles including rounded corners for nearly all controls. The current style inheritance for UWP apps is:
You'll want to get the XAML from each control folder (they are already separated out instead of one big XAML file) here: https://github.com/microsoft/microsoft-ui-xaml/tree/master/dev You'll definitely want to finish #2769 before doing this though. |
@amrx what is immersive color? |
@robloo Good catch on that (re WinUI templates). I forgot about that. |
@robloo native themes are a great idea, however something that should be provided by some kind of Avalonia Community Toolkit and built be community. If someone makes good in roads in this area we can probably adopt a community toolkit repo into AvaloniaUI organisation, provided there are people to maintain it. |
There are many different styles in windows because there are a lot of different pieces of technology involved. However, there is no confusion on what the latest/current UI style is. Therefore, I have to disagree with you here. Per the title of this issue, the latest styles are "WinUI 3.0 Fluent Design" which is only available right now in the WinUI library and will be the default styles shipping with WinUI 3.0 which is in preview now. |
@robloo regards, Recmo |
https://stackoverflow.com/questions/37774307/c-get-windows-8-1-10-selected-color-theme |
@robloo which is only available right now in the WinUI library and will be the default styles shipping with WinUI 3.0 which is in preview now. There is a web implementation also and a mac implementation too. @JamRemco thats the great thing fluent ui isn't a framework or a native style, its just a set of design styles and concepts that anyone is allowed to implement. |
@danwalmsley Yeay i know and i agree with most of it. I saw you are bussy with the "acrilic" stuff. from what i saw that looked great. Looking forward to contribute and make this the best crossplatform UI Fingers crossed, Remco |
Acrylic stuff is just experimenting around, to see how far we can get. Seem that we need to implement a compositor to make it work correctly. So it won't be here anytime soon. Except maybe background acrylic. The rest of the controls and styling can be done immediately though. |
@JamRemco @robloo @seanocali @amwx @hez2010 Porting has begun, if any of you are able to lend an hand, please get in touch with me ASAP on gitter. @JamRemco you mentioned earlier about styles for ToggleSwitch, realised Avalonia doesnt have that control, a PR to implement that should be reasonable easy... let me know what you have done. |
What i did is made a style for Togglebutton (as you know the backing control for checkbox and radiobutton) Although i am realy bussy this weekend, i am stil like to help somehow Remco |
@jmacato might be able to solve the color animation issues... please open a PR when your free again and we can take a look even if its just a draft. |
@danwalmsley
I hope I didn't forgot about anything. Controls like Image or TextBlock doesn't have special styles, so we don't need to do anything here. However there are some missed features out of current scope. |
The style updates are looking really good based on the screenshots I've seen 👍 @maxkatz6 https://github.com/robloo/PublicDocs/blob/master/UWPvsWPF.md#Controls |
I wonder if Uno would make it possible to consume WinUI in Avalonia, now that they have a Linux/Skia backend? |
@greatawesome probably some level of interop could be possible, but it's not on the roadmap. |
With 0.10.0 released I believe this issue can be closed. We now have "Fluent" theme which was ported from WinUI. |
@maxkatz6 Should this actually be re-opened with the new Fluent Version 2.0 Style? Or should a new issue be created? I expect WinUI3 is going to actually debut with version 2 of Fluent that is for Windows 11. |
@robloo have they finalized the design yet? i cant seem to find any resources for it yet |
I think most of the design has been finalized, but they're still tinkering with it. But the resources are in the WinUI repo now (basically any file not marked with "_v1.xaml" is the new WinUI styles, v1 is the old styles), and I've been bringing them into my FluentAvalonia repo (most are already there, but not all). It's probably worth waiting until ~Win11/actual release and they stop making little changes. |
Yea, as mentioned this has been released in WinUI 2.6 as Fluent version 2.0. They keep adjusting things and will do so for Windows 11. However, it is ready to bring over into other frameworks like Avalonia now. https://docs.microsoft.com/en-us/windows/apps/winui/winui2/winui-2.6#visual-style-updates
I dont think Avalonia should have Fluent theme versions really. Fluent in Avalonia should always try to be latest. Version 2 supercedes version 1 and should probably be entirely replaced. Otherwise maintaining all versions going forward is going to get real difficult even if its split into separate packages. |
I agree. theme versioning would make things needlessly complicated maintenance-wise. |
Still, we need keep in mind, that developers already build their applications and custom styles on top of Fluent v1. We either need to do theme versioning. Or move Fluent theme to separated NuGet package (another breaking change, but it still makes sense to do anyway), and inform developers, that they can update Avalonia version, but keep Fluent version older in order to avoid breaking their theming. Somehow, I would prefer second option, even though it makes more headache for everybody. |
Actually, it's better to create new issue. This one is already over discussed with unrelated to Fluent v2 topics. |
have you see |
WinUI 3.0 is a major update of WinUI 2.0 that will greatly expand the scope of WinUI to include the full Windows 10 native UI platform, which will now be fully decoupled from the UWP SDK.
Therefore, it will allow WPF, WinForms, MFC, traditional Win32 and many other GUI stacks to consume WinUI 3.0 libraries.
I hope that Avalonia can also add support for consuming WinUI 3.0.I hope that Avalonia can port WinUI 3.0 Fluent Design Styles and Controls.
The text was updated successfully, but these errors were encountered: