diff --git a/hammond-gtk/src/app.rs b/hammond-gtk/src/app.rs index 130e2e9..6be9c40 100644 --- a/hammond-gtk/src/app.rs +++ b/hammond-gtk/src/app.rs @@ -182,12 +182,16 @@ impl App { Ok(Action::ShowWidgetAnimated) => { let shows = content.get_shows(); let mut pop = shows.borrow().populated(); - pop.borrow_mut().switch_visible(PopulatedState::Widget); + pop.borrow_mut().switch_visible( + PopulatedState::Widget, + gtk::StackTransitionType::SlideLeft, + ); } Ok(Action::ShowShowsAnimated) => { let shows = content.get_shows(); let mut pop = shows.borrow().populated(); - pop.borrow_mut().switch_visible(PopulatedState::View); + pop.borrow_mut() + .switch_visible(PopulatedState::View, gtk::StackTransitionType::SlideRight); } Ok(Action::HeaderBarShowTile(title)) => headerbar.switch_to_back(&title), Ok(Action::HeaderBarNormal) => headerbar.switch_to_normal(), diff --git a/hammond-gtk/src/stacks/populated.rs b/hammond-gtk/src/stacks/populated.rs index f03c585..f9f92fb 100644 --- a/hammond-gtk/src/stacks/populated.rs +++ b/hammond-gtk/src/stacks/populated.rs @@ -72,7 +72,7 @@ impl PopulatedStack { // removal and insertion in the gtk::Stack, so we have // to make sure it will stay the same. let s = self.state; - self.switch_visible(s); + self.switch_visible(s, gtk::StackTransitionType::None); old.destroy(); Ok(()) @@ -95,7 +95,7 @@ impl PopulatedStack { // removal and insertion in the gtk::Stack, so we have // to make sure it will stay the same. let s = self.state; - self.switch_visible(s); + self.switch_visible(s, gtk::StackTransitionType::None); Ok(()) } @@ -114,7 +114,7 @@ impl PopulatedStack { // removal and insertion in the gtk::Stack, so we have // to make sure it will stay the same. let s = self.state; - self.switch_visible(s); + self.switch_visible(s, gtk::StackTransitionType::None); old.destroy(); Ok(()) @@ -135,18 +135,16 @@ impl PopulatedStack { } #[inline] - pub fn switch_visible(&mut self, state: PopulatedState) { + pub fn switch_visible(&mut self, state: PopulatedState, animation: gtk::StackTransitionType) { use self::PopulatedState::*; match state { View => { - self.stack - .set_visible_child_full("shows", gtk::StackTransitionType::SlideRight); + self.stack.set_visible_child_full("shows", animation); self.state = View; } Widget => { - self.stack - .set_visible_child_full("widget", gtk::StackTransitionType::SlideLeft); + self.stack.set_visible_child_full("widget", animation); self.state = Widget; } }