summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer/widget/container.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-29 02:00:28 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-29 02:00:28 +0200
commit0cde20b3550ede81bc7ddef628b91eec225aa8af (patch)
tree56920437979012cceb49718f2dd4ce27d5ba5d40 /wgpu/src/renderer/widget/container.rs
parent67b6f044e870df41be92cdc79f571682b97a5d0d (diff)
parente11b5c614f5bf73c137b8b4f24f56047617527eb (diff)
downloadiced-0cde20b3550ede81bc7ddef628b91eec225aa8af.tar.gz
iced-0cde20b3550ede81bc7ddef628b91eec225aa8af.tar.bz2
iced-0cde20b3550ede81bc7ddef628b91eec225aa8af.zip
Merge branch 'master' into improvement/update-wgpu_glyph
Diffstat (limited to 'wgpu/src/renderer/widget/container.rs')
-rw-r--r--wgpu/src/renderer/widget/container.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/wgpu/src/renderer/widget/container.rs b/wgpu/src/renderer/widget/container.rs
deleted file mode 100644
index 30cc3f07..00000000
--- a/wgpu/src/renderer/widget/container.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-use crate::{container, defaults, Defaults, Primitive, Renderer};
-use iced_native::{Background, Color, Element, Layout, Point, Rectangle};
-
-impl iced_native::container::Renderer for Renderer {
- 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)
- }
- }
-}