image_view: Bind properties in UI file
This commit is contained in:
parent
f621fedbba
commit
b2a15242be
2 changed files with 1 additions and 6 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
<object class="GtkHeaderBar" id="headerbar">
|
<object class="GtkHeaderBar" id="headerbar">
|
||||||
<property name="valign">start</property>
|
<property name="valign">start</property>
|
||||||
<property name="show-title-buttons">False</property>
|
<property name="show-title-buttons">False</property>
|
||||||
|
<property name="visible" bind-source="IvImageView" bind-property="header-visible" bind-flags="sync-create"/>
|
||||||
<child type="end">
|
<child type="end">
|
||||||
<object class="GtkButton">
|
<object class="GtkButton">
|
||||||
<property name="margin-start">6</property>
|
<property name="margin-start">6</property>
|
||||||
|
|
|
||||||
|
|
@ -130,12 +130,6 @@ mod imp {
|
||||||
fn constructed(&self, obj: &Self::Type) {
|
fn constructed(&self, obj: &Self::Type) {
|
||||||
self.parent_constructed(obj);
|
self.parent_constructed(obj);
|
||||||
|
|
||||||
obj.bind_property("header-visible", &*self.headerbar, "visible")
|
|
||||||
.flags(glib::BindingFlags::BIDIRECTIONAL)
|
|
||||||
.flags(glib::BindingFlags::SYNC_CREATE)
|
|
||||||
.build()
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
self.click_gesture
|
self.click_gesture
|
||||||
.connect_pressed(clone!(@weak obj => move |_, _, x, y| {
|
.connect_pressed(clone!(@weak obj => move |_, _, x, y| {
|
||||||
obj.show_popover_at(x, y);
|
obj.show_popover_at(x, y);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue