diff --git a/CHANGELOG.md b/CHANGELOG.md index 54127339a..b95bdc0fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. ### Added - title property to the Window element + - color property to the Window element ## [0.0.4] - 2020-12-04 diff --git a/examples/gallery/gallery.60 b/examples/gallery/gallery.60 index fdc3f29e8..1f5401008 100644 --- a/examples/gallery/gallery.60 +++ b/examples/gallery/gallery.60 @@ -13,11 +13,7 @@ App := Window { width: 500px; height: 550px; title: "SixtyFPS Gallery"; - Rectangle { - color: #ecedeb; - width: parent.width; - height: parent.height; - } + color: #ecedeb; VerticalLayout { padding: 20px; diff --git a/sixtyfps_runtime/corelib/graphics.rs b/sixtyfps_runtime/corelib/graphics.rs index 134136e65..af0c35ed3 100644 --- a/sixtyfps_runtime/corelib/graphics.rs +++ b/sixtyfps_runtime/corelib/graphics.rs @@ -722,11 +722,14 @@ impl crate::eventloop::GenericWindow for GraphicsWindo let window = map_state.as_mapped(); let mut backend = window.backend.borrow_mut(); let size = backend.window().inner_size(); - let mut frame = backend.new_frame( - size.width, - size.height, - &RgbaColor { red: 255 as u8, green: 255, blue: 255, alpha: 255 }.into(), - ); + let root_item = component.as_ref().get_item_ref(0); + let background_color = if let Some(window_item) = ItemRef::downcast_pin(root_item) { + crate::items::Window::FIELD_OFFSETS.color.apply_pin(window_item).get() + } else { + RgbaColor { red: 255 as u8, green: 255, blue: 255, alpha: 255 }.into() + }; + + let mut frame = backend.new_frame(size.width, size.height, &background_color); crate::item_rendering::render_component_items( &component_rc, &mut frame,