From a8d943db540712bc41134d721d0050d068ce6a55 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 10 May 2020 19:02:34 +0200 Subject: [PATCH] Optional close button on windows --- emigui/src/containers/window.rs | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/emigui/src/containers/window.rs b/emigui/src/containers/window.rs index d55ec333..3f39fcd1 100644 --- a/emigui/src/containers/window.rs +++ b/emigui/src/containers/window.rs @@ -5,15 +5,16 @@ use crate::{widgets::*, *}; use super::*; /// A wrapper around other containers for things you often want in a window -pub struct Window { +pub struct Window<'open> { pub title_label: Label, + open: Option<&'open mut bool>, pub area: Area, pub frame: Option, pub resize: Resize, pub scroll: Option, } -impl Window { +impl<'open> Window<'open> { // TODO: Into