Skip to content
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

[Bug] Blank app has no background/View Theme #325

Closed
1 task done
LeviGNMBS opened this issue Nov 7, 2024 · 8 comments
Closed
1 task done

[Bug] Blank app has no background/View Theme #325

LeviGNMBS opened this issue Nov 7, 2024 · 8 comments

Comments

@LeviGNMBS
Copy link

Check the following items

  • I have looked up relevant Issue

Description of the issue

Today i stated a blank avalonia app with the 6.0.0-rc release of suki. I noticed when starting a browser app (where sukiwindow is not used) There is no background, controls still seem to have their styling so i believe this difference to be the usage of singleviewlifetime. Is it possible to fix the theme for Browser apps? Maybe with a SukiView as main view? Maybe also support hosts for Browser purposes?

Package Version

6.0.0-rc

Environment

Browser

Expected Behavior

Is it possible to fix the theme for Browser apps? Maybe with a SukiView as main view? Maybe if possible also support hosts for Browser purposes in said view since i feel the difference in experience is very large atm.

Other than that love it!

Reproduction

Create a new xplat app
Update Avalonia to 11.2
Add SukiUI 6.0.0-rc
Start Browser app

Additional Information

No response

@sirdoombox
Copy link
Collaborator

sirdoombox commented Nov 7, 2024

Currently there is no plan to support any platform other than desktop. A lot of our animations are quite heavy and the visual tree is quite a bit more complex than is really reasonable for other platforms, as well as the controls being designed with the desktop in mind.

Aside from this, web and mobile support in Avalonia are still quite early and not in a particularly good place.

Perhaps in a future release when support for those platforms are much more stable, but that's not likely any time soon.

@sirdoombox sirdoombox closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
@kikipoulet
Copy link
Owner

As @sirdoombox said, browser support is not our priority. Honestly I don't even see a real use-case for Avalonia Browser in the current state, but I'm happy that you actually ran it as there are some issues with WASM (#180). Personnally I never succeeded in running WASM, even a blank project. Didn't spend a lot of time on it too.

About Hosts and background you should be able to use it with a little tweaking. Just look at the style of the SukiWIndow (https://github.com/kikipoulet/SukiUI/blob/main/SukiUI/Controls/SukiWindow.axaml). You can definitely use the "SukiBackground" control and declare your Hosts yourself in an usercontrol.

However, creating an alternative "SukiView" for SingleViewLifeTime is not planned at all.

@LeviGNMBS
Copy link
Author

I beg to differ

Currently there is no plan to support any platform other than desktop. A lot of our animations are quite heavy and the visual tree is quite a bit more complex than is really reasonable for other platforms, as well as the controls being designed with the desktop in mind.

That is sad in my opinion but ok, could you at least add a note on your readme that you do not support all platforms? Claiming that Suki is a and i quote "Complete UI Toolkit" that "is a theme for AvaloniaUI" implies all Avalonia platforms are supported in my opinion, otherwise it would be a "theme for AvaloniaUI Desktop"

Aside from this, web and mobile support in Avalonia are still quite early and not in a particularly good place.

Perhaps in a future release when support for those platforms are much more stable, but that's not likely any time soon.

I beg to differ, I have years of experience with WPF, XAML, UNO, Avalonia, and the current state is seen its history remarkably good, i have had 0 issues until i started using suki in my current project... Ever since the new backend (Avalonia 11+) its remarkably stable if you accept its limitations.

As @sirdoombox said, browser support is not our priority. Honestly I don't even see a real use-case for Avalonia Browser in the current state, but I'm happy that you actually ran it as there are some issues with WASM (#180). Personnally I never succeeded in running WASM, even a blank project. Didn't spend a lot of time on it too.

I agree it can sometimes be a pain to set up all the needed workloads (you need multiple extras that are not installed by default). But once set up its just a matter of pressing run like any other project. You should really give it a try!

About Hosts and background you should be able to use it with a little tweaking. Just look at the style of the SukiWIndow (https://github.com/kikipoulet/SukiUI/blob/main/SukiUI/Controls/SukiWindow.axaml). You can definitely use the "SukiBackground" control and declare your Hosts yourself in an usercontrol.
However, creating an alternative "SukiView" for SingleViewLifeTime is not planned at all.

Ok, i will try that, the toasts i already got working like that, i just think im doing something wrong with the background, since desktop isn't working either anymore. I'll try to get it to work like that. I doubt ill get it to work if you believe so strongly it would not work, but if i do that means there is in fact a real-use case to support it...

@kikipoulet
Copy link
Owner

Ok, i will try that, the toasts i already got working like that, i just think im doing something wrong with the background, since desktop isn't working either anymore. I'll try to get it to work like that. I doubt ill get it to work if you believe so strongly it would not work, but if i do that means there is in fact a real-use case to support it...

I'm glad to hear that toasts works well on the browser. Does it have the right font ? I saw that Avalonia wasm loose the custom font, I hope it has been fixed.

To add the background, just add <SukiBackground /> control, it will work directly really.

The "use-case" quote was about wasm in general for web, in its current state. But otherwise, I would be seriously happy to see your result on it 👍

@LeviGNMBS
Copy link
Author

I'm glad to hear that toasts works well on the browser. Does it have the right font ? I saw that Avalonia wasm loose the custom font, I hope it has been fixed.

I don't know, im bad at recognizing fonts, also keep in mind im not using the SukiWindow, so the font might not even be set but using the manual background i get the same result on desktop and Browser:
image

To add the background, just add <SukiBackground /> control, it will work directly really.

I did, and its gorgeous 😄

The "use-case" quote was about wasm in general for web, in its current state. But otherwise, I would be seriously happy to see your result on it 👍

Well, my company for instance is trying to move away/find alternatives from the traditional javascript frontends for a while, since our expertise and codebase is all .NET. And migrating .NET Desktop to .NET WASM is surprisingly easy compared to migrating to JS. 😉

@kikipoulet
Copy link
Owner

I'm glad to hear that toasts works well on the browser. Does it have the right font ? I saw that Avalonia wasm loose the custom font, I hope it has been fixed.

I don't know, im bad at recognizing fonts, also keep in mind im not using the SukiWindow, so the font might not even be set but using the manual background i get the same result on desktop and Browser: image

To add the background, just add <SukiBackground /> control, it will work directly really.

I did, and its gorgeous 😄

Oh indeed, and it is the correct font ! It seems to render well, that's great 👍

Well, my company for instance is trying to move away/find alternatives from the traditional javascript frontends for a while, since our expertise and codebase is all .NET. And migrating .NET Desktop to .NET WASM is surprisingly easy compared to migrating to JS. 😉

Well, finally it's just that we don't want to disperse by explicitely supporting wasm as we're focused on desktop and window behavior, but there was no reason it wouldn't work on wasm so. Do not hesitate to show us your project in the future are projects on wasm are quite rare.

@LeviGNMBS
Copy link
Author

Oh indeed, and it is the correct font ! It seems to render well, that's great 👍

Yes eventually all i needed was a base View that wrapped my main view containing nothing more than:

<Panel Background="White"
       IsVisible="{DynamicResource IsLight}"
       Opacity="0.1" />
<suki:SukiBackground />
<v:MainView/>

To get everything working. To be honest, i'm surprised that it works this well for never being tested 😄

Well, finally it's just that we don't want to disperse by explicitely supporting wasm as we're focused on desktop and window behavior, but there was no reason it wouldn't work on wasm so. Do not hesitate to show us your project in the future are projects on wasm are quite rare.

I understand, no worries, as long as this workaround keeps working im happy 😄
Sadly my project is an internal (and very specific) tool that could not be used outside our company, so it won't get released. But if i ever make another one ill make sure to show it ;)

Thank you for the help!!

@kinosang
Copy link

kinosang commented Nov 8, 2024

As I'm working on some projects with AvaloniaUI and SukiUI on WASM, I've confirmed that SukiUI can run on WASM with a few modifications. However, there are some compile-time issues when the dependencies aren’t aligned with Avalonia.

SukiUI 6.0.0-beta.4 works well with Avalonia 11.1.0-beta1.
SukiUI 6.0.0-beta7 works well with Avalonia 11.1.0-rc2.

SukiUI 6.0.0-rc is not tested yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants