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
+3 -2
View File
@@ -9,9 +9,10 @@ homepage = "https://osui.netlify.app"
documentation = "https://osui.netlify.app/docs/" documentation = "https://osui.netlify.app/docs/"
[features] [features]
rsx = [] no_rsx = []
frontend = ["rsx"]
portable = [] portable = []
engine = []
no_elem = []
[lib] [lib]
name = "osui" name = "osui"
+6 -1
View File
@@ -28,6 +28,7 @@ impl Console {
ui(&mut self.0, event) ui(&mut self.0, event)
} }
#[cfg(not(feature = "engine"))]
pub fn run(&mut self, ui: Element) -> crate::Result<()> { pub fn run(&mut self, ui: Element) -> crate::Result<()> {
self.draw(ui.clone(), None)?; self.draw(ui.clone(), None)?;
loop { loop {
@@ -42,12 +43,16 @@ impl Console {
pub fn end(&self) -> crate::Result<()> { pub fn end(&self) -> crate::Result<()> {
if self.1 { if self.1 {
crossterm::execute!(std::io::stdout(), crossterm::event::EnableMouseCapture)?; crossterm::execute!(std::io::stdout(), crossterm::event::DisableMouseCapture)?;
} }
crossterm::terminal::disable_raw_mode()?; crossterm::terminal::disable_raw_mode()?;
crate::utils::clear()?; crate::utils::clear()?;
crate::utils::show_cursor() crate::utils::show_cursor()
} }
pub fn size(&self) -> (u16, u16) {
(self.0.width, self.0.height)
}
} }
pub fn read() -> crate::Result<Event> { pub fn read() -> crate::Result<Event> {
View File
+3 -1
View File
@@ -1,8 +1,10 @@
pub mod console; pub mod console;
#[cfg(not(feature = "no_elem"))]
pub mod elements;
#[cfg(not(feature = "no_rsx"))]
pub mod rsx; pub mod rsx;
pub mod state; pub mod state;
pub mod utils; pub mod utils;
pub mod widgets;
pub mod prelude { pub mod prelude {
pub use crate::*; pub use crate::*;