imagePage: Move popover out of LpImage
It cause 'not measured' errors and we have enough things to handle in LpImage already. Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/146>
This commit is contained in:
parent
f33c4bd470
commit
0e24f347e6
3 changed files with 44 additions and 44 deletions
|
|
@ -57,51 +57,55 @@
|
|||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolled_window">
|
||||
<property name="propagate-natural-height">True</property>
|
||||
<property name="propagate-natural-width">True</property>
|
||||
<property name="child">
|
||||
<object class="LpImage" id="image">
|
||||
<child>
|
||||
<object class="GtkGestureClick" id="right_click_gesture">
|
||||
<property name="button">3</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGestureLongPress" id="press_gesture">
|
||||
<property name="touch-only">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkPopoverMenu" id="popover">
|
||||
<property name="has-arrow">False</property>
|
||||
<property name="menu-model">image_menu</property>
|
||||
<child type="rotate-left">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">object-rotate-left-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Rotate Left</property>
|
||||
<property name="action-name">win.rotate</property>
|
||||
<property name="action-target">-90.0</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
<object class="GtkBox" id="image_stack_page">
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolled_window">
|
||||
<property name="propagate-natural-height">True</property>
|
||||
<property name="propagate-natural-width">True</property>
|
||||
<property name="child">
|
||||
<object class="LpImage" id="image">
|
||||
<child>
|
||||
<object class="GtkGestureClick" id="right_click_gesture">
|
||||
<property name="button">3</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="rotate-right">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">object-rotate-right-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Rotate Right</property>
|
||||
<property name="action-name">win.rotate</property>
|
||||
<property name="action-target">90.0</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkGestureLongPress" id="press_gesture">
|
||||
<property name="touch-only">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkPopoverMenu" id="popover">
|
||||
<property name="has-arrow">False</property>
|
||||
<property name="menu-model">image_menu</property>
|
||||
<child type="rotate-left">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">object-rotate-left-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Rotate Left</property>
|
||||
<property name="action-name">win.rotate</property>
|
||||
<property name="action-target">-90.0</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child type="rotate-right">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">object-rotate-right-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Rotate Right</property>
|
||||
<property name="action-name">win.rotate</property>
|
||||
<property name="action-target">90.0</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
|
|||
|
|
@ -269,10 +269,6 @@ mod imp {
|
|||
.set_target(&adw::CallbackAnimationTarget::new(|_| {}));
|
||||
obj.zoom_animation()
|
||||
.set_target(&adw::CallbackAnimationTarget::new(|_| {}));
|
||||
|
||||
while let Some(child) = obj.first_child() {
|
||||
child.unparent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ mod imp {
|
|||
#[template_child]
|
||||
pub(super) error_page: TemplateChild<adw::StatusPage>,
|
||||
#[template_child]
|
||||
pub(super) scrolled_window: TemplateChild<gtk::ScrolledWindow>,
|
||||
pub(super) image_stack_page: TemplateChild<gtk::Widget>,
|
||||
#[template_child]
|
||||
pub(super) image: TemplateChild<LpImage>,
|
||||
#[template_child]
|
||||
|
|
@ -115,7 +115,7 @@ mod imp {
|
|||
if obj.image().is_loaded() {
|
||||
obj.imp()
|
||||
.stack
|
||||
.set_visible_child(&*obj.imp().scrolled_window);
|
||||
.set_visible_child(&*obj.imp().image_stack_page);
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue