properties_view: Move expressions to UI files

Currently Loupe leaks expressions created in-code. This
is because expressions need to be unwatched in order to be
dropped. Since we'd need to hold a reference to the watch
ourselves and unwatch them in dispose, our code would
become more cumbersome if we were to try to handle this properly.

This commit moves the expressions on LpPropertiesView to the
UI file, as GTK handles cleaning up the expressions it creates,
without any extra consideration on the app side.
This commit is contained in:
Christopher Davis 2023-03-02 21:30:57 -05:00 • committed by Sophie Herold
parent 34b3fb12de
commit ae41a77521
2 changed files with 19 additions and 31 deletions

View file

@ -2,6 +2,16 @@
<interface>
<template class="LpPropertiesView" parent="AdwBin">
<property name="width-request">255</property>
<binding name="metadata">
<lookup type="LpImage" name="metadata">
<lookup type="LpPropertiesView" name="image"/>
</lookup>
</binding>
<binding name="file">
<lookup type="LpImage" name="file">
<lookup type="LpPropertiesView" name="image"/>
</lookup>
</binding>
<property name="child">
<object class="GtkScrolledWindow">
<property name="child">