menus: Add rotate left and right buttons
This commit is contained in:
parent
57f573f98a
commit
c2e3bb2f83
5 changed files with 153 additions and 85 deletions
|
|
@ -102,6 +102,9 @@ mod imp {
|
|||
|
||||
fn dispose(&self) {
|
||||
let obj = self.instance();
|
||||
|
||||
self.rotation_animation.replace(None);
|
||||
|
||||
while let Some(child) = obj.first_child() {
|
||||
child.unparent();
|
||||
}
|
||||
|
|
@ -257,9 +260,9 @@ impl LpImage {
|
|||
gdk::ContentProvider::new_union(contents.as_slice())
|
||||
}
|
||||
|
||||
pub fn rotate(&self) {
|
||||
pub fn rotate(&self, angle: f64) {
|
||||
let target = &self.imp().rotation_target;
|
||||
target.set(target.get() + 90.);
|
||||
target.set(target.get() + angle);
|
||||
|
||||
let borrow = self.imp().rotation_animation.borrow();
|
||||
let animation = borrow.as_ref().unwrap();
|
||||
|
|
|
|||
|
|
@ -385,9 +385,9 @@ impl LpImageView {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn rotate_image(&self) {
|
||||
pub fn rotate_image(&self, angle: f64) {
|
||||
if let Some(current_page) = self.current_page() {
|
||||
current_page.image().rotate();
|
||||
current_page.image().rotate(angle);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue