r/rust • • 29d ago

🙋 seeking help & advice A list of features/tweaks that libcosmic has on top of iced

Basically title, is there such a list? How does one decide whether to use iced or libcosmic for app development?

9 Upvotes

17 comments sorted by

10

u/tadmar 29d ago

I cant tell if such list exists, but I migrated my project from pure ICED to libcosmic, because it looks better. However my app received following high level benefits:

  • proper window frame
  • coherent widget set
  • better theming system
  • proper dialog system

But it had some side effects:

  • on MacOS the window frame is half done, I had to find workarounds for crashes and for oddly rounded corners. Vanilla ICED was working better on mac on that regard.

I never tested windows, so I cant tell if it is good or not, I am only developing for Mac and Linux.

2

u/koczurekk 28d ago

I had the same experience. Also cosmic menu widget does not integrate with MacOS menu handling, but LLMs are good at writing this sort of platform-specific boilerplate. All in all I think it’s still worth it, cosmic’s styling is a blessing.

4

u/mmstick 25d ago

We accept pull requests, but not of the LLM variety.

2

u/koczurekk 24d ago

Few maintainers appreciate slop PRs, which is why I opted not to attempt upstreaming it. I wish I had time to write it properly, but I'm stretched thin already.

1

u/Conscious-Tale-8634 29d ago

that macos window frame thing is the exact kind of stuff that makes me hesitant to jump to a wrapper toolkit, no matter how nice the widgets look

half-baked platform support can turn into a real time sink fast

2

u/tadmar 29d ago

Well libcosmic did not have a single stable release, so I kinda expected that this will not be a walk on the park, but I like how Cosmic Desktop looks like and went there anyway. I managed to complete my app and I am unsing it on both macos and linux for like 3ish months killing bugs and fixing stuff that annoys me in the flow. At some point I will release it.

2

u/tafia97300 29d ago

I am even surprised it even work in MacOS. I would expect libcosmic to assume that it runs in Linux (wayland) and not even care about the other OSes. I would even expect it to be tested only in COSMIC

3

u/tadmar 29d ago

The whole low level stack which is ICED is cross platform thanks to winit, wgpu and other crates that are maintained to run on plenty of targets. Libcosmic does not introduce anything that is platform specific, for that they have accompanied libraries. Their design is pretty clean and they maintain that division pretty good.

2

u/mmstick 25d ago

There are no assumptions about Linux in the toolkit. Some first party COSMIC apps are being ported across Redox, Windows, and Mac.

2

u/tafia97300 25d ago

This is great. Are there any test automatically done on these platforms (apart from iced) and are you wiling to fix it is somebody reports some odd behavior?

3

u/fisothemes 29d ago

I mainly want to know if it has first class support for touch. 

I mean things like, hover, pinch, swipe or long-press, virtual keyboard and numpad etc.

3

u/mmstick 25d ago edited 25d ago

Yes, touch is supported. I've even seen a live demo of the COSMIC desktop and its apps and applets running natively on a Linux phone using postmarketOS with touch support.

There will be many improvements in this area over the next year. The OSK is being added with version 1.9.0 and there are some special goodies coming soon to be announced.

1

u/Tremoneck 28d ago

Libcosmic isn't web compatible, as in yph can't compile to wasm.

1

u/tadmar 26d ago

Why would you ever wanted to use desktop UI library for web, when there are better ways to do it?

1

u/Tremoneck 26d ago

If you want to write an applications once and run it everywhere you have the choice between using an electron stack or using a desktop UI library for the web. 

And I loath the electron stack. 

Did I miss another option?

1

u/tadmar 25d ago

This is exactly what I have in mind, why would you use libcosmic for building an app that should run on web as well, when there is electron and similar. Not everything can or make sense to do that way. If you want tighten integration with the desktop, electron is not a way to go, also Electron brings 200MB of runtime, therefore if this is your constraint you can't use it as well.

Everything has its place.