Merge pull request #431 from hecrj/feature/pane-grid-splits
Splits iterator for `PaneGrid` and minor improvements
This commit is contained in:
commit
99a50d6b2f
3 changed files with 47 additions and 14 deletions
|
|
@ -273,8 +273,6 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> {
|
|||
self.state.focus(pane);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.state.unfocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +286,7 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> {
|
|||
if let Some((split, _)) = self.state.picked_split() {
|
||||
let bounds = layout.bounds();
|
||||
|
||||
let splits = self.state.splits(
|
||||
let splits = self.state.split_regions(
|
||||
f32::from(self.spacing),
|
||||
Size::new(bounds.width, bounds.height),
|
||||
);
|
||||
|
|
@ -410,7 +408,7 @@ where
|
|||
let limits = limits.width(self.width).height(self.height);
|
||||
let size = limits.resolve(Size::ZERO);
|
||||
|
||||
let regions = self.state.regions(f32::from(self.spacing), size);
|
||||
let regions = self.state.pane_regions(f32::from(self.spacing), size);
|
||||
|
||||
let children = self
|
||||
.elements
|
||||
|
|
@ -453,7 +451,7 @@ where
|
|||
cursor_position.y - bounds.y,
|
||||
);
|
||||
|
||||
let splits = self.state.splits(
|
||||
let splits = self.state.split_regions(
|
||||
f32::from(self.spacing),
|
||||
Size::new(bounds.width, bounds.height),
|
||||
);
|
||||
|
|
@ -482,6 +480,8 @@ where
|
|||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.state.unfocus();
|
||||
}
|
||||
}
|
||||
mouse::Event::ButtonReleased(mouse::Button::Left) => {
|
||||
|
|
@ -588,7 +588,7 @@ where
|
|||
|
||||
let splits = self
|
||||
.state
|
||||
.splits(f32::from(self.spacing), bounds.size());
|
||||
.split_regions(f32::from(self.spacing), bounds.size());
|
||||
|
||||
hovered_split(
|
||||
splits.iter(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue