pub struct ScreencopyView { /* private fields */ }Expand description
Shows what an output or a window shows, captured by the compositor,
in the box its style’s width and height give it, as an
Image shows a picture. It draws nothing until the
first frame arrives.
It captures one frame, unless it is live: then each change to the
source brings a new frame, and a source that doesn’t change sends
none, so it wakes nothing. A source that isn’t there yet, such as an
output not plugged in, is waited for. When it goes, the last frame
stays.
use crabshell_ui::{CaptureSource, ScreencopyView, Style};
let thumbnail = ScreencopyView::new(CaptureSource::Output(String::from("DP-1")))
.live(true)
.style(Style::new().width(192.0).height(108.0));Implementations§
Source§impl ScreencopyView
impl ScreencopyView
Sourcepub fn new(source: impl IntoProp<CaptureSource>) -> ScreencopyView
pub fn new(source: impl IntoProp<CaptureSource>) -> ScreencopyView
A view of source: a CaptureSource, or a closure that returns
one.
Sourcepub fn live(self, live: impl IntoProp<bool>) -> ScreencopyView
pub fn live(self, live: impl IntoProp<bool>) -> ScreencopyView
Whether each change to the source shows, rather than only the first frame. Off by default.
Sourcepub fn paint_cursors(self, paint: impl IntoProp<bool>) -> ScreencopyView
pub fn paint_cursors(self, paint: impl IntoProp<bool>) -> ScreencopyView
Whether the pointer is drawn into the frames. Off by default.
Sourcepub fn fit(self, fit: impl IntoProp<Fit>) -> ScreencopyView
pub fn fit(self, fit: impl IntoProp<Fit>) -> ScreencopyView
Sets how the frame fills the view’s box when their shapes differ.
Sourcepub fn style(self, style: impl IntoProp<Style>) -> ScreencopyView
pub fn style(self, style: impl IntoProp<Style>) -> ScreencopyView
Sets the style, whose width and height give the view its size.
Sourcepub fn visible(self, visible: impl IntoProp<bool>) -> Self
pub fn visible(self, visible: impl IntoProp<bool>) -> Self
Shows or hides the widget. Hidden, it is taken out of the layout, so its space goes to the others, and it isn’t drawn, hit or reached by Tab; it drops the keyboard focus and the pointer. Its bindings and state stay, so it shows again as it was. Shown by default.
Sourcepub fn geometry(self, geometry: Signal<Rect>) -> Self
pub fn geometry(self, geometry: Signal<Rect>) -> Self
Shares where the widget is: after each layout that moves or
resizes it, its laid-out rectangle in the window’s logical
pixels, scrolled with any scroll view around it but not moved by
a style’s translate, scale or rotate, is written to geometry. A
hidden widget writes nothing. An effect that reads it may change
the layout: the window is laid out again at once, until nothing
moves.
Sourcepub fn mapped_geometry(self, geometry: Signal<Rect>) -> Self
pub fn mapped_geometry(self, geometry: Signal<Rect>) -> Self
Shares where the widget is drawn: the box around it once its own and its ancestors’ translate, scale and rotate have moved it, in the window’s logical pixels, scrolled with any scroll view around it. It is written after each layout that moves it and after each change of a transform or an offset that does, every frame of an animated one. A hidden widget writes nothing. Where the window itself is on its output is unknown: Wayland doesn’t tell a client.