by nu11ptr · 3y ago · 0 comments
UPDATE: Things I have my eye on as they mature: Slint, egui, and iced. I'm especially watching iced as Pop_os is using it for their DE and likely will add quite a few widgets.
Bonus if it supports the current "native" OS paradigms. E.g. on Mac: transparent sidebar, integrated titlebar, on Windows: MS office 2022 style simplified toolbar/ribbon, and WinUI styling. Note that even the official modern APIs themselves (SwiftUI and WinUI) don't do everything that first party apps can do.
Gtk doesn't look native anywhere but at least it has a very complete widget set and has been around for a while.
It's being worked on.
So I’m curious whether this sort of patch would be accepted. Assuming reasonable quality of patch, it pretty obviously should be if you want to be a cross-platform toolkit that doesn’t feel massively out of place, but without knowing what position or connections Paul Rouget may have, I’m honestly sceptical that such a patch would be accepted.
GTK4 and Adwaita apps can still be styled however the developer wants. If some app developer wants to make a Windows theme, go for it.
Overlay scrollbars aren't forced. The app developer can disable that and make the scrollbars always show. You might not want to though, because some Windows apps do have overlay scrollbars. For example: VS Code.
Keyboard shortcuts are also up to the app developer. If someone wants to have some compile time setting to change the keybinds when building on Windows, go for it.
I have no idea what you're saying about libadwaita separation. You can very clearly look at the libadwaita code and see what's in there versus what gets upstreamed into GTK. No one has any way to lie here. It's just an extra set of GTK widgets you can optionally use.
The draft MR written by Paul is still open. I doubt it will be merged in the current state it's in, because it has bugs.
What's the state of wxWidgets nowadays? I feel like they've always had the most honest approach to cross-platform support.
(Yes, I know about the rust-dart-bridge or whatever, but gRPC gives my product an API at the same time for "free" and without the complexity of a multi-language project).
I might even prefer it for cross-platform apps since startup time is so slow for GTK on Windows.
For me egui, is totally mature as long as you don't need too much. The fun factor induced by the immediate mode and the GL rendering speeds are definitely a plus !
As for the webview, thats a thing, but if you will have web access, you can target wasm, and make the egui interface embedded in the webpage instead of the other way round. But yeah, I don't see a webview being part of eframe/egui proper anytime soon because it treats wasm as a tier one target. You might see it supported third party the same way the efile crate supports open file dialogs but only for windows or linux builds.
Edit: dropping the demo link here for people to poke around. I'm curious what people use that is missing, and what people find unsuited to commercial use.
UPDATE: True, it is themable, I just wish the default was a little more polished
As I alluded in my other comment, theming is possible but it's really limited if you expect anything close to what you'd typically expect. You can put borders and colors on frames, but it's pretty limited. For example, if you want to have a border with different colors on each edge, or a border on just one edge, you can't do that by default. I had to make a custom frame object that is a frame in a frame to make different sized borders, but it's still a single color.
I created a mockup in PowerPoint (my go to design app... I'm not a designer, but it has everything I need and I know how to use it), and I had a lot of difficulty getting the egui design to match my PP design, because PP actually has a fairly advanced styling engine with a ton of options, and I took advantage of those. So when I go to egui, the default theme didn't support the kinds of design elements I wanted to show.
But, like I said, you can make these things yourself with the egui building blocks without much trouble.
The other thing I found a little frustrating was chromeless windows. There's an example of this, but it didn't seem well supported. The idea is that when you turn off chrome, you can't resize or close your app. So then you have to add all that functionality back. There's a demo that shows this, but it seemed like a pain at the time to integrate into my app. I gave hoping it would be fixed soon, so I will revisit.
More details (including explanation and concrete examples of what’s fundamentally unfixable with egui’s approach to the web, most notably links and scrolling): https://news.ycombinator.com/item?id=33861831
None of the text can be selected in the demo. imo that's a HUGE drawback.
Case in point: Blender has an outstanding GUI toolkit, non-native.
Pity. For a moment I was briefly excited that someone had created a Rust binding for EFL/Enlightenment (aka "E").
GTK is only required if you want the GTK WebView, iirc.
- Vizia https://github.com/vizia/vizia
- Freya https://github.com/marc2332/freya
- Xilem https://github.com/linebender/xilem
- Floem https://github.com/lapce/floem
TLDR; I think of these as low level crates, not high level UI crates. If that changes, they will be added to my watch list.
It’s shockingly difficult to find newer UI frameworks with this, even though it’s one of the most important desktop UI widgets for a lot of use cases. Win32, Cocoa, GTK, and Qt Widgets have it though, and that’s part of why those toolkits continue to get used.
I believe that having a common language but using native widgets is the sweet spot for many cross platform projects and teams.