Reputation: 81
I am new to GTK development. I started using GTK4 and it is really grea. As far as I understand libadwaita is used for reflecting dynamic system changes of colors (light/dark/contrast, etc) in a GTK4 application. This is system solution and if so, I think it's great. Instead of having custom based stylesheets the application will behave according to the system settings. At least on Linux.
My question is: is Libadwaita available for windows systems (my app should react on system changes on windows 10 & 11, as well) and if awailable how to use it? Github for libadwaita constains an example how to create application (HelloWorld) but it is disabled for MS Visaul Studio. Is libadwaita only for Linux? If so, how to keep code portable?
Upvotes: 3
Views: 4147
Reputation: 1
Yes it is, for Visual Studio 2015 or later on the libadwaita-1-1
and later branches. Be sure to pass in -Dc_std=c99
if using VS2017 or 2015, and use -Dvapi=false
unless you have Vala installed when you run Meson to configure the build (the dependencies should be aligned with GTK-4.6+) Run Ninja, and you should be good to go.
The sample program was (purposely) not updated to build with Visual Studio, but there is still adwaita-1-demo.exe
that is being built.
The “system settings” would, by the way, depend on how you set up things via GSettings, which would in turn be done in the system registry. You need to install the gsettings-desktop-schemas
package (it is also built with Meson and works with Windows), and run gsettings set org.gnome.desktop.interface color-scheme prefer-dark
, and you would get the dark theme that you were asking for.
Hope this helps.
Upvotes: 0