6 ms·
libadwaita and Kirigami are huge improvements for the desktop app ecosystem from what I've seen as a user. When I started to delve into desktop applications I q
by kodah 5y ago
libadwaita and Kirigami are huge improvements for the desktop app ecosystem from what I've seen as a user. When I started to delve into desktop applications I quickly realized there's a couple hurdles I face:
1. QT was an ecosystem shock to me. I barely knew what to do to get started and got lost easily.
2. Do these applications work outside of Linux; more directly, do they have dynamic dependencies? From my experience, the former is difficult and the answer to the latter is yes.
3. The lack of library support for Go and Rust is notable. Sometimes I want to throw a UI on top of what used to be a terminal app written in Go (or Rust).
- Klonoar 5y agoRust and GTK3/4 are fairly well supported, no? I know QT is a bit more of a pain to do from Rust, but I wanna say that's possible too... though nowhere near as evident as gtk-rs.
- nirvdrum 5y agoGTK and Rust works really well on Linux, which I suppose is the pertinent part given the focus of the article. I've yet to work out how to get GTK and Rust to work on macOS or Windows, which makes cross-platform UI difficult.
- gattr 5y agoFWIW, my smallish project [1] (Rust + GTK3) builds and works on Windows out of the box. I use the MSYS2 build environment. [1] https://github.com/GreatAttractor/vidoxide https://github.com/GreatAttractor/vidoxide
- nirvdrum 5y agoThanks. I'll take a look. I've tried Relm 3, Relm 4, and gtk-rs, but they all use Linux only in their CI. I just can't work out what to install and what env vars I need. I didn't the official GTK docs all that helpful on the topic. I'm keen to see how to package the whole thing up, too. Ideally, I could just put the necessary libraries in a directory with the executable.
- floatboth 5y agoGTK4 is supposed to "just" build with meson on Windows – yes, just with MSVC, not requiring any of the GNU toolchain type things: https://www.collabora.com/news-and-blog/blog/2021/04/29/build-your-own-application-with-gtk4-as-a-meson-subproject/ https://www.collabora.com/news-and-blog/blog/2021/04/29/buil... If no one has yet wrapped this into a Rust crate, someone should…
- nirvdrum 5y agoOh, nifty. I tried getting it going with msys2 and didn't have good luck. I think something might be conflicting. I haven't gotten to the point of wiping the machine yet. Maybe I'll have better luck with meson.
- mrpotato 5y agogtk-rs has a book[1] which has setup information for windows. The install was easy on windows following the instructions. I have yet to build an app with GTK4 so I can't comment on the writing and building of apps just yet. [1] https://gtk-rs.org/gtk4-rs/stable/latest/book/ https://gtk-rs.org/gtk4-rs/stable/latest/book/
- nirvdrum 5y agoThanks. I'll try running through that. relm4 links to https://www.gtk.org/docs/installations/windows/ https://www.gtk.org/docs/installations/windows/ and I followed those steps without success.
- mrpotato 5y agoI followed those as well but changed to whats in the gtk-rs book A word of warning: before you start, if you choose to go down the MSVC path, you have to uinstall msys2 and remove msys from your environment paths. If the Meson build find msys2 in your environment path variable, it will try to build using msys2.
- audidude 5y agoI built a new GTK 4 backend specifically for macOS so we have native support for rendering all of the UI with OpenGL like we do on Linux and Windows. I'm fairly quick to fix bugs if I get good reports, and it can be installed with `brew install gtk4`. You can also build GTK for macOS easily with meson as it has subprojects for everything. In fact, our CI does it from scratch on every commit w/ macOS. On Windows you can just open GTK with visual studio and build it by using Meson to generate the project files. A bunch of work is about to land to make the macOS backend more solid/faster too similar to the work Firefox did in the last couple of years to reduce power usage w/ OpenGL/IOSurface/etc.
- Tmpod 5y agoFor Qt (QML/QtQuick; Widgets are no linger the preferred method afaik) you have qmetaobjects-rs, which is reeally nice.
- mappu 5y agoQML is practically electron - it's runtime interpreted declarative UI plus a Javascript engine. QML still has only rudimentary support for AOT compilation. Both the old qmlcompiler and the new qmlsc compiler are commercial-only: https://www.qt.io/blog/the-new-qtquick-compiler-technology https://www.qt.io/blog/the-new-qtquick-compiler-technology . LGPL users only get the interpreter. Widgets is still the 'Real Qt'. Some very modern, responsive-layout desktop apps like Telegram are written entirely with Widgets.
- heavyset_go 5y ago> QML is practically electron - it's runtime interpreted declarative UI plus a Javascript engine. It uses significantly less resources and QML and QtQuick are pretty nice to work with compared to targeting a weird embedded browser with HTML, CSS and JS.
- viraptor 5y agoHaving a declarative UI does not make it comparable to Electron. Same as XAML is not comparable. They don't embed the whole browser.
- ognarb 5y agoqmlcompiler is open source and the new qmlsc is also open source. It's just the extensions that helps making your qml code compatible with the new compiler that isn't open source. This is indeed annoying but not everything is commercial only.
- mappu 5y agoWhere can I find the source code for qmlcompiler and qmlsc? qmltc and qmlcachegen are available in the qtdeclarative.git repo (on either code.qt.io or GitHub) but i can't find qmlcompiler nor qmlsc anywhere. I believe they are commercial only under the "Qt for Device Creation" license.
- jeroenhd 5y agoI've been experimenting with gtk-rs, but the GTK ecosystem is really difficult to get right. The examples are few and far between, and the type exceptions the macro DSL throws are very difficult to parse. All the necessary components are there, but there just aren't enough guides out there to get started. I tried looking into how existing applications use the ecosystem, but experienced GUI developers pull tons of dependencies and use complicated code structures that are hardly documented. I think switching from Python/GTK to Rust/GTK is probably an easy move, but as someone coming from .NET Forms GUI design, it's been tough getting into GTK. GTK Builder is supposed to have native support for Glade and all the other nice tools, but for me that either doesn't compile any code or refuses to even work at all.
- audidude 5y agoAssuming you meant "GNOME" Builder rather than GtkBuilder (the template loader for GTK), I'm the author of it and can help figure out what is going wrong on your system wrt not compiling anything. Just file an issue on gitlab and I'll take a look. Usually when we come across bugs like this it's related to distro packaging as we have no hand in that and the Flatpak packages I maintain generally do-as-advertised.
- jeroenhd 5y agoYou're right, I did mean the GNOME builder. I don't know what's wrong exactly, I think it's Flatpak related. From what I remember, it had something to do with a certain version of the GNOME SDK not being installed (I think it was looking for a version of something that didn't exist?) so it failed a dependency check when I hit the install button from the Builder popup. I think this caused the tool to get into a faulty state where it thought the dependency was installed but simultaneously suggested installing the dependency, so it freaked out. I'm usually working on Ubuntu so combining the outdated Ubuntu stable-ish packages with Flatpak's bleeding edge stuff causes issues from time to time. This could've been a temporary problem and I could've had a streak of bad luck, or maybe my deskop and laptop are somehow just set up plain wrong. I'm no expert in Flatpak internals. I also don't have Builder set up any more so reproducing the problem is kind of hard. Next time I'm giving it a try, I'll try to keep in mind to actually post a bug report.
- rjzzleep 5y agolibAdwaita is an attempt at providing a consistent framework for making GUI applications in Linux. People commenting on MacOS UX often forget that people creating Mac GUI applications aren't magically better at doing UX than Linux users. It's orders of magnitude easier to make ok looking GUI applications on a mac. Besides the fact that cocoa on mac has evolved over a decade(when linux people were busy constantly reinventing gtk themeing engines and display servers), cocoa had more books on building gui applications in ~2010 than the entire history of gtk and gnome together. And while the gnome team is busy constantly tweaking small visual details, glib is still a nightmare to work with. It's also full of ticks in places you'd think should be fixed by now. For over a decade selecting folders in gtk/gnome has been broken by design: - open folder selection dialog - click a folder by mistake without double clicking it - clicking the select folder button now enters the folder instead of selecting the current folder - there no way to unselect the selection. -> you have to enter the folder, then go a level up and then select the folder Kirigami looks promising, but it doesn't look anywhere near production quality polish.
- Morgawr 5y ago> - open folder selection dialog - click a folder by mistake without double clicking it - clicking the select folder button now enters the folder instead of selecting the current folder - there no way to unselect the selection. -> you have to enter the folder, then go a level up and then select the folder Glad I'm not the only one with this problem, it's so frustrating and there's literally nothing you can do about it, you just gotta go up one level and come back down.
- smoldesu 5y ago> Besides the fact that cocoa on mac has evolved over a decade(when linux people were busy constantly reinventing gtk themeing engines and display servers) I'll be the first one to concede that Wayland has been more or less a monumental waste of development effort, but can you point to the constant reinvention of themeing engines? Stylesheet modification has been a thing for decades now, there's very little that needed to be done to accomodate for them, at least from a GTK development standpoint (that I'm aware of).
- throwaway2037 5y agoYou wrote: <<QT was an ecosystem shock to me. I barely knew what to do to get started and got lost easily.>> This is surprising to me. It is the gold standard for cross-platform desktop applications. (Readers: Please note that I used "cross-platform" and "desktop" _together_. Yes, I know there are plenty of other GUI frameworks that cover other categories.) The amount of official and unofficial documentation, code samples, and Q&A for Qt is simply mind boggling. Did you not find these docs helpful? Or maybe you do not like C++? Lots of people also use PyQt (or variants) with Python and get along quite well. Also, if Qt isn't good for you, what else did you try? My experience with GTK+ was awful -- bizarre API and terrible docs. Further, the community was unhelpful and borderline trollish. This was well-documented by the "Subsurface" team (SCUBA diving software) during their transition from GTK+ to Qt.
- GoblinSlayer 5y agoMore like C++ hates everyone except for C++ compilers.
- einpoklum 5y agoFYI: Qt is rather ancient C++ by now.
- GoblinSlayer 5y agoIs Qt C++? AFAIK it has some sort of custom preprocessor, does it work with a naive vanilla C++ compiler?
- throwaway2037 5y agoIt is called the Meta Object Compiler (moc). You can read more about it here: https://doc.qt.io/qt-6/why-moc.html https://doc.qt.io/qt-6/why-moc.html It parses your C++ headers to generate helpful metadata used for runtime reflection and slot-and-signals. All the generated code is C++. The latest versions of CMake support moc out of the box, so developers hardly notice the moc step.