Allow clipboard access in Widget::on_event

This commit is contained in:
Héctor Ramón Jiménez 2019-12-18 07:45:49 +01:00
parent 0f2e20f5e5
commit a14b39555e
20 changed files with 89 additions and 26 deletions

View file

@ -2,8 +2,8 @@
use crate::{
column,
input::{mouse, ButtonState},
layout, Align, Column, Element, Event, Hasher, Layout, Length, Point,
Rectangle, Size, Widget,
layout, Align, Clipboard, Column, Element, Event, Hasher, Layout, Length,
Point, Rectangle, Size, Widget,
};
use std::{f32, hash::Hash, u32};
@ -143,6 +143,7 @@ where
cursor_position: Point,
messages: &mut Vec<Message>,
renderer: &Renderer,
clipboard: Option<&dyn Clipboard>,
) {
let bounds = layout.bounds();
let is_mouse_over = bounds.contains(cursor_position);
@ -247,6 +248,7 @@ where
cursor_position,
messages,
renderer,
clipboard,
)
}