summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer/widget/radio.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-10 01:55:32 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-10 01:55:32 +0100
commit2303111e09d806ef2a652bddc2b73be6dccf6ae2 (patch)
treeba57c5a2fe67d8a58d4f9b32c2b32fee32932f06 /wgpu/src/renderer/widget/radio.rs
parent839e039dbf2fb89dcb8c141503740777d2af2eb3 (diff)
downloadiced-2303111e09d806ef2a652bddc2b73be6dccf6ae2.tar.gz
iced-2303111e09d806ef2a652bddc2b73be6dccf6ae2.tar.bz2
iced-2303111e09d806ef2a652bddc2b73be6dccf6ae2.zip
Draft new layout API
Diffstat (limited to 'wgpu/src/renderer/widget/radio.rs')
-rw-r--r--wgpu/src/renderer/widget/radio.rs29
1 files changed, 15 insertions, 14 deletions
diff --git a/wgpu/src/renderer/widget/radio.rs b/wgpu/src/renderer/widget/radio.rs
index 61f5ce47..9f3c528f 100644
--- a/wgpu/src/renderer/widget/radio.rs
+++ b/wgpu/src/renderer/widget/radio.rs
@@ -1,30 +1,31 @@
use crate::{Primitive, Renderer};
use iced_native::{
- radio, text, Align, Background, Column, Layout, Length, MouseCursor,
- Node, Point, Radio, Rectangle, Row, Text, Widget,
+ layout, radio, text, Background, Layout, MouseCursor, Point, Radio,
+ Rectangle, Text,
};
const SIZE: f32 = 28.0;
const DOT_SIZE: f32 = SIZE / 2.0;
impl radio::Renderer for Renderer {
- fn node<Message>(&self, radio: &Radio<Message>) -> Node {
- Row::<(), Self>::new()
- .spacing(15)
- .align_items(Align::Center)
- .push(
- Column::new()
- .width(Length::Units(SIZE as u16))
- .height(Length::Units(SIZE as u16)),
- )
- .push(Text::new(&radio.label))
- .node(self)
+ fn layout<Message>(
+ &self,
+ radio: &Radio<Message>,
+ limits: &layout::Limits,
+ ) -> Layout {
+ // TODO
+ Layout::new(Rectangle {
+ x: 0.0,
+ y: 0.0,
+ width: 0.0,
+ height: 0.0,
+ })
}
fn draw<Message>(
&mut self,
radio: &Radio<Message>,
- layout: Layout<'_>,
+ layout: &Layout,
cursor_position: Point,
) -> Self::Output {
let bounds = layout.bounds();