Rename Panes widget to PaneGrid
This commit is contained in:
parent
15fad17f37
commit
6151c52824
9 changed files with 24 additions and 24 deletions
34
wgpu/src/renderer/widget/pane_grid.rs
Normal file
34
wgpu/src/renderer/widget/pane_grid.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
use crate::{Primitive, Renderer};
|
||||
use iced_native::{pane_grid, Element, Layout, MouseCursor, Point};
|
||||
|
||||
impl pane_grid::Renderer for Renderer {
|
||||
fn draw<Message>(
|
||||
&mut self,
|
||||
defaults: &Self::Defaults,
|
||||
content: &[(pane_grid::Pane, Element<'_, Message, Self>)],
|
||||
layout: Layout<'_>,
|
||||
cursor_position: Point,
|
||||
) -> Self::Output {
|
||||
let mut mouse_cursor = MouseCursor::OutOfBounds;
|
||||
|
||||
(
|
||||
Primitive::Group {
|
||||
primitives: content
|
||||
.iter()
|
||||
.zip(layout.children())
|
||||
.map(|((_, pane), layout)| {
|
||||
let (primitive, new_mouse_cursor) =
|
||||
pane.draw(self, defaults, layout, cursor_position);
|
||||
|
||||
if new_mouse_cursor > mouse_cursor {
|
||||
mouse_cursor = new_mouse_cursor;
|
||||
}
|
||||
|
||||
primitive
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
mouse_cursor,
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue