flozz / yoga-image-optimizer

A graphical tool to convert and optimize JPEG, PNG and WebP images (based on YOGA)
https://yoga.flozz.org
GNU General Public License v3.0
138 stars 11 forks source link

GTK4 port + FreeDesktop automatic light/dark theme support #45

Open nekohayo opened 7 months ago

nekohayo commented 7 months ago

I suppose you're already aware of all these things, but at least this is a ticket for tracking this, and maybe in case someone wants to help with this...

It would be a good thing to:

flozz commented 7 months ago

Hello,

The last time I looked to port YOGA Image Optimizer to GTK4, the tools were not ready (it was about one or two years ago). Especially Glade that only supports GTK3, and its replacement, Cambalache, that was very very new. Gvsbuild had no GTK4 support neither at thas time.

I have to look again to see how everything evolved now. I will try to do a macOS port of the App soon, so I may work on the GTK4 port right after :)

Thank you for all the links

flozz commented 7 months ago

I had a quick look. It seems there is not too much deprecated properties used:

$ export G_ENABLE_DIAGNOSTIC=1 
$ python -m yoga_image_optimizer
/.../yoga-image-optimizer.git/yoga_image_optimizer/main_window.py:40: Warning: The property GtkWidget:margin-left is deprecated and shouldn't be used anymore. It will be removed in a future version.
  self._builder.add_from_file(data_helpers.find_data_path("ui/main-window.glade"))
/.../yoga-image-optimizer.git/yoga_image_optimizer/main_window.py:40: Warning: The property GtkWidget:margin-right is deprecated and shouldn't be used anymore. It will be removed in a future version.
  self._builder.add_from_file(data_helpers.find_data_path("ui/main-window.glade"))
/.../yoga-image-optimizer.git/yoga_image_optimizer/main_window.py:40: Warning: The property GtkWidget:double-buffered is deprecated and shouldn't be used anymore. It will be removed in a future version.
  self._builder.add_from_file(data_helpers.find_data_path("ui/main-window.glade"))
/.../yoga-image-optimizer.git/yoga_image_optimizer/settings_window.py:31: Warning: The property GtkAlignment:top-padding is deprecated and shouldn't be used anymore. It will be removed in a future version.
  self._builder.add_from_file(

But we use some other deprecated/removed things like Gdk.Screen.

The UI files will require some manual work to convert them (it seems there is no automatic migration tool for them).

It seems Gvsbuild now support GTK 4 (but I not tested), and Cambalache seems more complete than the next time I looked at it :)