few changes

This commit is contained in:
2025-01-19 23:24:55 +01:00
parent 5a21f9f740
commit fda5387ccc
4 changed files with 12 additions and 4 deletions
+6 -1
View File
@@ -28,6 +28,7 @@ impl Console {
ui(&mut self.0, event)
}
#[cfg(not(feature = "engine"))]
pub fn run(&mut self, ui: Element) -> crate::Result<()> {
self.draw(ui.clone(), None)?;
loop {
@@ -42,12 +43,16 @@ impl Console {
pub fn end(&self) -> crate::Result<()> {
if self.1 {
crossterm::execute!(std::io::stdout(), crossterm::event::EnableMouseCapture)?;
crossterm::execute!(std::io::stdout(), crossterm::event::DisableMouseCapture)?;
}
crossterm::terminal::disable_raw_mode()?;
crate::utils::clear()?;
crate::utils::show_cursor()
}
pub fn size(&self) -> (u16, u16) {
(self.0.width, self.0.height)
}
}
pub fn read() -> crate::Result<Event> {
View File
+3 -1
View File
@@ -1,8 +1,10 @@
pub mod console;
#[cfg(not(feature = "no_elem"))]
pub mod elements;
#[cfg(not(feature = "no_rsx"))]
pub mod rsx;
pub mod state;
pub mod utils;
pub mod widgets;
pub mod prelude {
pub use crate::*;