Fix constant repaint in the open overview
Browse files at this commit396097c3ab67a5482a9d7614992c2c603c90e313Parent: ad62c8e2 changed files +8 -3
- src/layout/mod.rs +7 -3
- src/layout/monitor.rs +1 -0
src/layout/mod.rsmodified+7 -3
| @@ -498,6 +498,7 @@ pub enum HitType { | |||
| 498 | enum OverviewProgress { | 498 | enum OverviewProgress { |
| 499 | Animation(Animation), | 499 | Animation(Animation), |
| 500 | Gesture(OverviewGesture), | 500 | Gesture(OverviewGesture), |
| 501 | + Open, | ||
| 501 | } | 502 | } |
| 502 | 503 | ||
| 503 | #[derive(Debug)] | 504 | #[derive(Debug)] |
| @@ -628,6 +629,7 @@ impl OverviewProgress { | |||
| 628 | match self { | 629 | match self { |
| 629 | OverviewProgress::Animation(anim) => anim.value(), | 630 | OverviewProgress::Animation(anim) => anim.value(), |
| 630 | OverviewProgress::Gesture(gesture) => gesture.value, | 631 | OverviewProgress::Gesture(gesture) => gesture.value, |
| 632 | + OverviewProgress::Open => 1., | ||
| 631 | } | 633 | } |
| 632 | } | 634 | } |
| 633 | 635 | ||
| @@ -2648,9 +2650,11 @@ impl<W: LayoutElement> Layout<W> { | |||
| 2648 | } | 2650 | } |
| 2649 | } | 2651 | } |
| 2650 | 2652 | ||
| 2651 | - if !self.overview_open { | 2653 | + if let Some(OverviewProgress::Animation(anim)) = &mut self.overview_progress { |
| 2652 | - if let Some(OverviewProgress::Animation(anim)) = &mut self.overview_progress { | 2654 | + if anim.is_done() { |
| 2653 | - if anim.is_done() { | 2655 | + if self.overview_open { |
| 2656 | + self.overview_progress = Some(OverviewProgress::Open); | ||
| 2657 | + } else { | ||
| 2654 | self.overview_progress = None; | 2658 | self.overview_progress = None; |
| 2655 | } | 2659 | } |
| 2656 | } | 2660 | } |
src/layout/monitor.rsmodified+1 -0
| @@ -282,6 +282,7 @@ impl From<&super::OverviewProgress> for OverviewProgress { | |||
| 282 | match value { | 282 | match value { |
| 283 | super::OverviewProgress::Animation(anim) => Self::Animation(anim.clone()), | 283 | super::OverviewProgress::Animation(anim) => Self::Animation(anim.clone()), |
| 284 | super::OverviewProgress::Gesture(gesture) => Self::Value(gesture.value), | 284 | super::OverviewProgress::Gesture(gesture) => Self::Value(gesture.value), |
| 285 | + super::OverviewProgress::Open => Self::Value(1.), | ||
| 285 | } | 286 | } |
| 286 | } | 287 | } |
| 287 | } | 288 | } |