image_view: Expose file as a property instead of filename

The GFile is more useful for other data. The window can
use expressions to calculate an appropriate title, so
we no longer need to call `set_title()` or connect to
a signal manually.

This commit also adjusts the `uri()` and `print()`
functions to use `active_file()`
This commit is contained in:
Christopher Davis 2022-07-26 12:07:08 -04:00
parent fa513596b2
commit 1e95dd4cbb
3 changed files with 46 additions and 36 deletions

View file

@ -4,7 +4,12 @@
<property name="default-width">600</property>
<property name="default-height">498</property>
<property name="width-request">360</property>
<property name="title">Image Viewer</property>
<property name="title" translatable="yes">Image Viewer</property>
<binding name="title">
<closure type="gchararray" function="window_title">
<lookup type="LpImageView" name="active-file">image_view</lookup>
</closure>
</binding>
<property name="content">
<object class="AdwFlap" id="flap">
<property name="orientation">vertical</property>