forge
Explore
Log in

Don't you dare go Hollow

layout/floating: Move a function higher up

Browse files at this commit

9c205f77a2c224e336f3e5222c4d5865d7674cf0Ivan MolodetskikhParent: c2e4cfd
Let's group action functions together. Activate is an action and set
width/height too.
src/layout/floating.rsmodified+20 -20
@@ -482,6 +482,26 @@ impl<W: LayoutElement> FloatingSpace<W> {
482 }482 }
483 }483 }
484 484
485+ pub fn start_close_animation_for_window(
486+ &mut self,
487+ renderer: &mut GlesRenderer,
488+ id: &W::Id,
489+ blocker: TransactionBlocker,
490+ ) {
491+ let (tile, tile_pos) = self
492+ .tiles_with_render_positions_mut(false)
493+ .find(|(tile, _)| tile.window().id() == id)
494+ .unwrap();
495+
496+ let Some(snapshot) = tile.take_unmap_snapshot() else {
497+ return;
498+ };
499+
500+ let tile_size = tile.tile_size();
501+
502+ self.start_close_animation_for_tile(renderer, snapshot, tile_size, tile_pos, blocker);
503+ }
504+
485 pub fn activate_window_without_raising(&mut self, id: &W::Id) -> bool {505 pub fn activate_window_without_raising(&mut self, id: &W::Id) -> bool {
486 if !self.contains(id) {506 if !self.contains(id) {
487 return false;507 return false;
@@ -512,26 +532,6 @@ impl<W: LayoutElement> FloatingSpace<W> {
512 self.data.insert(to_idx, data);532 self.data.insert(to_idx, data);
513 }533 }
514 534
515- pub fn start_close_animation_for_window(
516- &mut self,
517- renderer: &mut GlesRenderer,
518- id: &W::Id,
519- blocker: TransactionBlocker,
520- ) {
521- let (tile, tile_pos) = self
522- .tiles_with_render_positions_mut(false)
523- .find(|(tile, _)| tile.window().id() == id)
524- .unwrap();
525-
526- let Some(snapshot) = tile.take_unmap_snapshot() else {
527- return;
528- };
529-
530- let tile_size = tile.tile_size();
531-
532- self.start_close_animation_for_tile(renderer, snapshot, tile_size, tile_pos, blocker);
533- }
534-
535 pub fn start_close_animation_for_tile(535 pub fn start_close_animation_for_tile(
536 &mut self,536 &mut self,
537 renderer: &mut GlesRenderer,537 renderer: &mut GlesRenderer,