Files
galaxy/crates/galaxyui/examples/blur/root_view.rs
T

26 lines
633 B
Rust

use pathfinder_color::ColorU;
use galaxyui::{elements::Rect, AppContext, Element, Entity, TypedActionView, View};
pub struct BlurredView {}
impl Entity for BlurredView {
type Event = ();
}
impl View for BlurredView {
fn ui_name() -> &'static str {
"RootView"
}
/// Renders a transparent red rectangle. The blur effect is applied on the window (see
/// `open_new()`.
fn render(&self, _: &AppContext) -> Box<dyn Element> {
Rect::new()
.with_background_color(ColorU::new(255, 0, 0, 50))
.finish()
}
}
impl TypedActionView for BlurredView {
type Action = ();
}