few changes
This commit is contained in:
+3
-2
@@ -9,9 +9,10 @@ homepage = "https://osui.netlify.app"
|
||||
documentation = "https://osui.netlify.app/docs/"
|
||||
|
||||
[features]
|
||||
rsx = []
|
||||
frontend = ["rsx"]
|
||||
no_rsx = []
|
||||
portable = []
|
||||
engine = []
|
||||
no_elem = []
|
||||
|
||||
[lib]
|
||||
name = "osui"
|
||||
|
||||
+6
-1
@@ -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> {
|
||||
|
||||
+3
-1
@@ -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::*;
|
||||
|
||||
Reference in New Issue
Block a user