Draft first working version of iced_glow 🎉
This commit is contained in:
parent
33448508a5
commit
d4743183d4
51 changed files with 3212 additions and 42 deletions
34
glow/src/renderer/widget/column.rs
Normal file
34
glow/src/renderer/widget/column.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
use crate::{Primitive, Renderer};
|
||||
use iced_native::{column, mouse, Element, Layout, Point};
|
||||
|
||||
impl column::Renderer for Renderer {
|
||||
fn draw<Message>(
|
||||
&mut self,
|
||||
defaults: &Self::Defaults,
|
||||
content: &[Element<'_, Message, Self>],
|
||||
layout: Layout<'_>,
|
||||
cursor_position: Point,
|
||||
) -> Self::Output {
|
||||
let mut mouse_interaction = mouse::Interaction::default();
|
||||
|
||||
(
|
||||
Primitive::Group {
|
||||
primitives: content
|
||||
.iter()
|
||||
.zip(layout.children())
|
||||
.map(|(child, layout)| {
|
||||
let (primitive, new_mouse_interaction) =
|
||||
child.draw(self, defaults, layout, cursor_position);
|
||||
|
||||
if new_mouse_interaction > mouse_interaction {
|
||||
mouse_interaction = new_mouse_interaction;
|
||||
}
|
||||
|
||||
primitive
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
mouse_interaction,
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue