Loupe/data/gtk/properties_view.ui
Christopher Davis ae41a77521 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.
2023-03-05 02:13:41 +00:00

304 lines
13 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<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">
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Folder</property>
<property name="subtitle-selectable">True</property>
<property name="activatable-widget">folder_button</property>
<binding name="subtitle">
<closure type="gchararray" function="folder_name">
<lookup name="file">LpPropertiesView</lookup>
</closure>
</binding>
<child type="suffix">
<object class="GtkButton" id="folder_button">
<property name="valign">center</property>
<property name="action-name">properties.open-folder</property>
<property name="icon-name">folder-open-symbolic</property>
<property name="tooltip-text" translatable="yes">Open Containing Folder</property>
<style>
<class name="flat"/>
</style>
</object>
</child>
<style>
<class name="property"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Image Size</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<lookup name="dimensions">LpPropertiesView</lookup>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">File Type</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<closure type="gchararray" function="file_type">
<lookup name="file-info">LpPropertiesView</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">File Size</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<closure type="gchararray" function="file_size">
<lookup name="file-info">LpPropertiesView</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">File Created</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<closure type="gchararray" function="created_date">
<lookup name="file-info">LpPropertiesView</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">File Modified</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<closure type="gchararray" function="modified_date">
<lookup name="file-info">LpPropertiesView</lookup>
</closure>
</binding>"
<style>
<class name="property"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<binding name="visible">
<lookup name="has-information">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</binding>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Location</property>
<property name="subtitle-selectable">True</property>
<property name="activatable-widget">location_button</property>
<binding name="subtitle">
<lookup name="location">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</binding>
<binding name="visible">
<closure type="gboolean" function="has_content">
<lookup name="location">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</closure>
</binding>
<child type="suffix">
<object class="GtkButton" id="location_button">
<property name="valign">center</property>
<property name="action-name">properties.open-location</property>
<property name="icon-name">mark-location-symbolic</property>
<property name="tooltip-text" translatable="yes">Open Location</property>
<style>
<class name="flat"/>
</style>
</object>
</child>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Originally Created</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<lookup name="originally-created">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</binding>
<binding name="visible">
<closure type="gboolean" function="has_content">
<lookup name="originally-created">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Aperture</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<lookup name="f-number">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</binding>
<binding name="visible">
<closure type="gboolean" function="has_content">
<lookup name="f-number">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Exposure</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<lookup name="exposure-time">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</binding>
<binding name="visible">
<closure type="gboolean" function="has_content">
<lookup name="exposure-time">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">ISO</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<lookup name="iso">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</binding>
<binding name="visible">
<closure type="gboolean" function="has_content">
<lookup name="iso">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Focal Length</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<lookup name="focal-length">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</binding>
<binding name="visible">
<closure type="gboolean" function="has_content">
<lookup name="focal-length">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Maker, Model</property>
<property name="subtitle-selectable">True</property>
<binding name="subtitle">
<lookup name="maker-model">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</binding>
<binding name="visible">
<closure type="gboolean" function="has_content">
<lookup name="maker-model">
<lookup name="metadata">LpPropertiesView</lookup>
</lookup>
</closure>
</binding>
<style>
<class name="property"/>
</style>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</property>
</template>
</interface>