From 2c44bf5efa1fa0894057eb4ed87dc88c9484c2e7 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Wed, 5 Jun 2024 10:53:49 -0400 Subject: Moved widget rendering back into display system --- src/widgets/systems.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/widgets/systems.rs') diff --git a/src/widgets/systems.rs b/src/widgets/systems.rs index 69a84e3..2626ec6 100644 --- a/src/widgets/systems.rs +++ b/src/widgets/systems.rs @@ -1,26 +1,9 @@ use bevy::prelude::*; -use crate::{display::resources::Terminal, input::events::TerminalInputEvent}; +use crate::input::events::TerminalInputEvent; use super::components::Widget; -/// Invokes every enabled widget's `render` method -pub fn draw_widgets(mut terminal: ResMut, mut widgets: Query<&mut Widget>) { - terminal - .0 - .draw(|frame| { - let mut active_widgets = widgets - .iter_mut() - .filter(|widget| widget.enabled) - .collect::>(); - active_widgets.sort_by(|a, b| a.depth.cmp(&b.depth)); - for mut widget in active_widgets { - widget.widget.render(frame, frame.size()); - } - }) - .unwrap(); -} - /// Invokes every enabled widget's `handle_events` methods for each incoming input event pub fn widget_input_handling( mut widgets: Query<&mut Widget>, -- cgit v1.2.3