summaryrefslogtreecommitdiffstats
path: root/graphics/src/renderer/widget/container.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-19 21:00:40 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-19 21:00:40 +0200
commite6180912488db4d59fbffcb46c5930282306cb92 (patch)
treef41c7ee830a8765b3795c8b6d012c7c621927cca /graphics/src/renderer/widget/container.rs
parentc2e0c52ce031ffe1c300b3cfa362b0e445ac5afd (diff)
downloadiced-e6180912488db4d59fbffcb46c5930282306cb92.tar.gz
iced-e6180912488db4d59fbffcb46c5930282306cb92.tar.bz2
iced-e6180912488db4d59fbffcb46c5930282306cb92.zip
Merge unnecessary split widget modules
Diffstat (limited to 'graphics/src/renderer/widget/container.rs')
-rw-r--r--graphics/src/renderer/widget/container.rs53
1 files changed, 0 insertions, 53 deletions
diff --git a/graphics/src/renderer/widget/container.rs b/graphics/src/renderer/widget/container.rs
deleted file mode 100644
index a1f6a211..00000000
--- a/graphics/src/renderer/widget/container.rs
+++ /dev/null
@@ -1,53 +0,0 @@
-use crate::container;
-use crate::defaults::{self, Defaults};
-use crate::{Backend, Primitive, Renderer};
-use iced_native::{Background, Color, Element, Layout, Point, Rectangle};
-
-impl<B> iced_native::container::Renderer for Renderer<B>
-where
- B: Backend,
-{
- type Style = Box<dyn container::StyleSheet>;
-
- fn draw<Message>(
- &mut self,
- defaults: &Defaults,
- bounds: Rectangle,
- cursor_position: Point,
- style_sheet: &Self::Style,
- content: &Element<'_, Message, Self>,
- content_layout: Layout<'_>,
- ) -> Self::Output {
- let style = style_sheet.style();
-
- let defaults = Defaults {
- text: defaults::Text {
- color: style.text_color.unwrap_or(defaults.text.color),
- },
- };
-
- let (content, mouse_interaction) =
- content.draw(self, &defaults, content_layout, cursor_position);
-
- if style.background.is_some() || style.border_width > 0 {
- let quad = Primitive::Quad {
- bounds,
- background: style
- .background
- .unwrap_or(Background::Color(Color::TRANSPARENT)),
- border_radius: style.border_radius,
- border_width: style.border_width,
- border_color: style.border_color,
- };
-
- (
- Primitive::Group {
- primitives: vec![quad, content],
- },
- mouse_interaction,
- )
- } else {
- (content, mouse_interaction)
- }
- }
-}