aboutsummaryrefslogtreecommitdiff
path: root/src/widgets
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <[email protected]>2024-06-05 10:53:49 -0400
committerLibravatar Silas Bartha <[email protected]>2024-06-05 10:53:49 -0400
commit10b09a1748a89800f8febec3f7ef1ab773101a05 (patch)
tree12bff04a347f8f2389fd518d62da2643bec8af88 /src/widgets
parent8fe2406277eb11719a03122b82199c06e0f54ed0 (diff)
Moved widget rendering back into display system
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/systems.rs19
1 files changed, 1 insertions, 18 deletions
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<Terminal>, mut widgets: Query<&mut Widget>) {
- terminal
- .0
- .draw(|frame| {
- let mut active_widgets = widgets
- .iter_mut()
- .filter(|widget| widget.enabled)
- .collect::<Vec<_>>();
- 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>,