Compare commits
1 Commits
711f92b7dd
...
b2eb9aef6e
| Author | SHA1 | Date | |
|---|---|---|---|
| b2eb9aef6e |
@ -1,6 +1,7 @@
|
|||||||
mod app;
|
mod app;
|
||||||
mod component;
|
mod component;
|
||||||
mod editor;
|
mod editor;
|
||||||
|
mod editor_tab;
|
||||||
mod explorer;
|
mod explorer;
|
||||||
mod logger;
|
mod logger;
|
||||||
mod menu_bar;
|
mod menu_bar;
|
||||||
|
|||||||
153
src/tui/app.rs
153
src/tui/app.rs
@ -1,21 +1,21 @@
|
|||||||
use crate::tui::app::AppComponent::{AppEditor, AppExplorer, AppLogger};
|
use crate::tui::app::AppComponent::{AppEditor, AppExplorer, AppLogger};
|
||||||
use crate::tui::component::{Action, Component, Focus, FocusState};
|
use crate::tui::component::{Action, Component, Focus, FocusState};
|
||||||
use crate::tui::editor::Editor;
|
use crate::tui::editor_tab::EditorTab;
|
||||||
use crate::tui::explorer::Explorer;
|
use crate::tui::explorer::Explorer;
|
||||||
use crate::tui::logger::Logger;
|
use crate::tui::logger::Logger;
|
||||||
use crate::tui::menu_bar::MenuBar;
|
use crate::tui::menu_bar::MenuBar;
|
||||||
use AppComponent::AppMenuBar;
|
use AppComponent::AppMenuBar;
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use log::{debug, error, info, trace, warn};
|
use log::error;
|
||||||
|
use ratatui::DefaultTerminal;
|
||||||
use ratatui::buffer::Buffer;
|
use ratatui::buffer::Buffer;
|
||||||
use ratatui::crossterm::event;
|
use ratatui::crossterm::event;
|
||||||
use ratatui::crossterm::event::{
|
use ratatui::crossterm::event::{
|
||||||
Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers, MouseButton, MouseEventKind,
|
Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers, MouseButton, MouseEventKind,
|
||||||
};
|
};
|
||||||
use ratatui::layout::{Constraint, Direction, Layout, Rect};
|
use ratatui::layout::{Constraint, Direction, Layout, Rect};
|
||||||
use ratatui::prelude::{Color, Style, Widget};
|
use ratatui::prelude::{Color, Widget};
|
||||||
use ratatui::widgets::{Block, Borders, Padding, Paragraph, Tabs, Wrap};
|
use ratatui::widgets::{Paragraph, Wrap};
|
||||||
use ratatui::{DefaultTerminal, symbols};
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ pub enum AppComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct App<'a> {
|
pub struct App<'a> {
|
||||||
editor: Editor,
|
editor_tabs: EditorTab,
|
||||||
explorer: Explorer<'a>,
|
explorer: Explorer<'a>,
|
||||||
logger: Logger,
|
logger: Logger,
|
||||||
menu_bar: MenuBar,
|
menu_bar: MenuBar,
|
||||||
@ -45,7 +45,7 @@ impl<'a> App<'a> {
|
|||||||
|
|
||||||
pub fn new(root_path: PathBuf) -> Result<Self> {
|
pub fn new(root_path: PathBuf) -> Result<Self> {
|
||||||
let app = Self {
|
let app = Self {
|
||||||
editor: Editor::new(),
|
editor_tabs: EditorTab::new(&root_path),
|
||||||
explorer: Explorer::new(&root_path)?,
|
explorer: Explorer::new(&root_path)?,
|
||||||
logger: Logger::new(),
|
logger: Logger::new(),
|
||||||
menu_bar: MenuBar::new(),
|
menu_bar: MenuBar::new(),
|
||||||
@ -57,12 +57,16 @@ impl<'a> App<'a> {
|
|||||||
/// Logic that should be executed once on application startup.
|
/// Logic that should be executed once on application startup.
|
||||||
pub fn start(&mut self) -> Result<()> {
|
pub fn start(&mut self) -> Result<()> {
|
||||||
let root_path = self.explorer.root_path.clone();
|
let root_path = self.explorer.root_path.clone();
|
||||||
self.editor
|
let editor = self
|
||||||
|
.editor_tabs
|
||||||
|
.current_editor_mut()
|
||||||
|
.context("Failed to get current editor in App::start")?;
|
||||||
|
editor
|
||||||
.set_contents(&root_path.join("src/tui/app.rs"))
|
.set_contents(&root_path.join("src/tui/app.rs"))
|
||||||
.context(format!(
|
.context(format!(
|
||||||
"Failed to initialize editor contents to path: {root_path:?}"
|
"Failed to initialize editor contents to path: {root_path:?}"
|
||||||
))?;
|
))?;
|
||||||
self.editor.component_state.set_focus(Focus::Active);
|
editor.component_state.set_focus(Focus::Active);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +96,13 @@ impl<'a> App<'a> {
|
|||||||
fn draw_bottom_status(&self, area: Rect, buf: &mut Buffer) {
|
fn draw_bottom_status(&self, area: Rect, buf: &mut Buffer) {
|
||||||
// Determine help text from the most recently focused component.
|
// Determine help text from the most recently focused component.
|
||||||
let help = match self.last_active {
|
let help = match self.last_active {
|
||||||
AppEditor => self.editor.component_state.help_text.clone(),
|
AppEditor => match self.editor_tabs.current_editor() {
|
||||||
|
Some(editor) => editor.component_state.help_text.clone(),
|
||||||
|
None => {
|
||||||
|
error!(target:Self::id(), "Failed to get Editor while drawing bottom status bar");
|
||||||
|
"Failed to get current Editor while getting widget help text".to_string()
|
||||||
|
}
|
||||||
|
},
|
||||||
AppExplorer => self.explorer.component_state.help_text.clone(),
|
AppExplorer => self.explorer.component_state.help_text.clone(),
|
||||||
AppLogger => self.logger.component_state.help_text.clone(),
|
AppLogger => self.logger.component_state.help_text.clone(),
|
||||||
AppMenuBar => self.menu_bar.component_state.help_text.clone(),
|
AppMenuBar => self.menu_bar.component_state.help_text.clone(),
|
||||||
@ -111,32 +121,14 @@ impl<'a> App<'a> {
|
|||||||
.render(area, buf);
|
.render(area, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw_tabs(&self, area: Rect, buf: &mut Buffer) {
|
|
||||||
// Determine the tab title from the current file (or use a fallback).
|
|
||||||
if let Some(title) = self.editor.file_path.clone() {
|
|
||||||
Tabs::new(vec![
|
|
||||||
title
|
|
||||||
.file_name()
|
|
||||||
.map(|f| f.to_str())
|
|
||||||
.unwrap_or(Some("Unknown"))
|
|
||||||
.unwrap(),
|
|
||||||
])
|
|
||||||
.divider(symbols::DOT)
|
|
||||||
.block(
|
|
||||||
Block::default()
|
|
||||||
.borders(Borders::NONE)
|
|
||||||
.padding(Padding::new(0, 0, 0, 0)),
|
|
||||||
)
|
|
||||||
.highlight_style(Style::default().fg(Color::LightRed))
|
|
||||||
.render(area, buf);
|
|
||||||
} else {
|
|
||||||
error!(target:Self::id(), "Failed to get Editor file_path while drawing Tabs widget.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn change_focus(&mut self, focus: AppComponent) {
|
fn change_focus(&mut self, focus: AppComponent) {
|
||||||
match focus {
|
match focus {
|
||||||
AppEditor => self.editor.component_state.set_focus(Focus::Active),
|
AppEditor => match self.editor_tabs.current_editor_mut() {
|
||||||
|
None => {
|
||||||
|
error!(target:Self::id(), "Failed to get current Editor while changing focus")
|
||||||
|
}
|
||||||
|
Some(editor) => editor.component_state.set_focus(Focus::Active),
|
||||||
|
},
|
||||||
AppExplorer => self.explorer.component_state.set_focus(Focus::Active),
|
AppExplorer => self.explorer.component_state.set_focus(Focus::Active),
|
||||||
AppLogger => self.logger.component_state.set_focus(Focus::Active),
|
AppLogger => self.logger.component_state.set_focus(Focus::Active),
|
||||||
AppMenuBar => self.menu_bar.component_state.set_focus(Focus::Active),
|
AppMenuBar => self.menu_bar.component_state.set_focus(Focus::Active),
|
||||||
@ -147,20 +139,26 @@ impl<'a> App<'a> {
|
|||||||
/// Refresh the contents of the editor to match the selected TreeItem in the file Explorer.
|
/// Refresh the contents of the editor to match the selected TreeItem in the file Explorer.
|
||||||
/// If the selected item is not a file, this does nothing.
|
/// If the selected item is not a file, this does nothing.
|
||||||
fn refresh_editor_contents(&mut self) -> Result<()> {
|
fn refresh_editor_contents(&mut self) -> Result<()> {
|
||||||
|
// TODO: This may be useful for a preview mode of the selected file prior to opening a tab.
|
||||||
// Use the currently selected TreeItem or get an absolute path to this source file.
|
// Use the currently selected TreeItem or get an absolute path to this source file.
|
||||||
let selected_pathbuf = match self.explorer.selected() {
|
// let selected_pathbuf = match self.explorer.selected() {
|
||||||
Ok(path) => PathBuf::from(path),
|
// Ok(path) => PathBuf::from(path),
|
||||||
Err(_) => PathBuf::from(std::path::absolute(file!())?.to_string_lossy().to_string()),
|
// Err(_) => PathBuf::from(std::path::absolute(file!())?.to_string_lossy().to_string()),
|
||||||
};
|
// };
|
||||||
let current_file_path = self
|
// match self.editor_tabs.current_editor_mut() {
|
||||||
.editor
|
// None => bail!("Failed to get current Editor while refreshing editor contents"),
|
||||||
.file_path
|
// Some(editor) => {
|
||||||
.clone()
|
// let current_file_path = editor
|
||||||
.context("Failed to get Editor current file_path")?;
|
// .file_path
|
||||||
if selected_pathbuf == current_file_path || !selected_pathbuf.is_file() {
|
// .clone()
|
||||||
return Ok(());
|
// .context("Failed to get Editor current file_path")?;
|
||||||
}
|
// if selected_pathbuf == current_file_path || !selected_pathbuf.is_file() {
|
||||||
self.editor.set_contents(&selected_pathbuf)
|
// return Ok(());
|
||||||
|
// }
|
||||||
|
// editor.set_contents(&selected_pathbuf)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,9 +194,8 @@ impl<'a> Widget for &mut App<'a> {
|
|||||||
.split(horizontal[1]);
|
.split(horizontal[1]);
|
||||||
|
|
||||||
self.draw_bottom_status(vertical[3], buf);
|
self.draw_bottom_status(vertical[3], buf);
|
||||||
self.draw_tabs(editor_layout[0], buf);
|
self.editor_tabs
|
||||||
let id = App::id().to_string();
|
.render(editor_layout[0], editor_layout[1], buf);
|
||||||
self.editor.render(editor_layout[1], buf);
|
|
||||||
self.explorer.render(horizontal[0], buf);
|
self.explorer.render(horizontal[0], buf);
|
||||||
self.logger.render(vertical[2], buf);
|
self.logger.render(vertical[2], buf);
|
||||||
|
|
||||||
@ -220,29 +217,48 @@ impl<'a> Component for App<'a> {
|
|||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Handle events for all components.
|
||||||
|
let action = match self.last_active {
|
||||||
|
AppEditor => self.editor_tabs.handle_event(event.clone())?,
|
||||||
|
AppExplorer => self.explorer.handle_event(event.clone())?,
|
||||||
|
AppLogger => self.logger.handle_event(event.clone())?,
|
||||||
|
AppMenuBar => self.menu_bar.handle_event(event.clone())?,
|
||||||
|
};
|
||||||
|
|
||||||
|
let editor = self
|
||||||
|
.editor_tabs
|
||||||
|
.current_editor_mut()
|
||||||
|
.context("Failed to get current editor while handling App events")?;
|
||||||
// Components should always handle mouse events for click interaction.
|
// Components should always handle mouse events for click interaction.
|
||||||
if let Some(mouse) = event.as_mouse_event() {
|
if let Some(mouse) = event.as_mouse_event() {
|
||||||
if mouse.kind == MouseEventKind::Down(MouseButton::Left) {
|
if mouse.kind == MouseEventKind::Down(MouseButton::Left) {
|
||||||
self.editor.handle_mouse_events(mouse)?;
|
editor.handle_mouse_events(mouse)?;
|
||||||
self.explorer.handle_mouse_events(mouse)?;
|
self.explorer.handle_mouse_events(mouse)?;
|
||||||
self.logger.handle_mouse_events(mouse)?;
|
self.logger.handle_mouse_events(mouse)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle events for all components.
|
|
||||||
let action = match self.last_active {
|
|
||||||
AppEditor => self.editor.handle_event(event)?,
|
|
||||||
AppExplorer => self.explorer.handle_event(event)?,
|
|
||||||
AppLogger => self.logger.handle_event(event)?,
|
|
||||||
AppMenuBar => self.menu_bar.handle_event(event)?,
|
|
||||||
};
|
|
||||||
match action {
|
match action {
|
||||||
Action::Quit | Action::Handled => return Ok(action),
|
Action::Quit | Action::Handled => Ok(action),
|
||||||
Action::Save => self.editor.save()?,
|
Action::Save => match editor.save() {
|
||||||
_ => {}
|
Ok(_) => Ok(Action::Handled),
|
||||||
}
|
Err(_) => {
|
||||||
|
error!(target:Self::id(), "Failed to save editor contents");
|
||||||
Ok(Action::Noop)
|
Ok(Action::Noop)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
Action::OpenTab => {
|
||||||
|
if let Ok(path) = self.explorer.selected() {
|
||||||
|
let path_buf = PathBuf::from(path);
|
||||||
|
self.editor_tabs.open_tab(&path_buf)?;
|
||||||
|
Ok(Action::Handled)
|
||||||
|
} else {
|
||||||
|
Ok(Action::Noop)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => Ok(Action::Noop),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Handles key events for the App Component only.
|
/// Handles key events for the App Component only.
|
||||||
fn handle_key_events(&mut self, key: KeyEvent) -> Result<Action> {
|
fn handle_key_events(&mut self, key: KeyEvent) -> Result<Action> {
|
||||||
@ -283,19 +299,6 @@ impl<'a> Component for App<'a> {
|
|||||||
self.change_focus(AppMenuBar);
|
self.change_focus(AppMenuBar);
|
||||||
Ok(Action::Handled)
|
Ok(Action::Handled)
|
||||||
}
|
}
|
||||||
KeyEvent {
|
|
||||||
code: KeyCode::Char('l'),
|
|
||||||
modifiers: KeyModifiers::ALT,
|
|
||||||
kind: KeyEventKind::Press,
|
|
||||||
state: _state,
|
|
||||||
} => {
|
|
||||||
error!(target:App::id(), "an error");
|
|
||||||
warn!(target:App::id(), "a warning");
|
|
||||||
info!(target:App::id(), "a two line info\nsecond line");
|
|
||||||
debug!(target:App::id(), "a debug");
|
|
||||||
trace!(target:App::id(), "a trace");
|
|
||||||
Ok(Action::Handled)
|
|
||||||
}
|
|
||||||
KeyEvent {
|
KeyEvent {
|
||||||
code: KeyCode::Char('c'),
|
code: KeyCode::Char('c'),
|
||||||
modifiers: KeyModifiers::CONTROL,
|
modifiers: KeyModifiers::CONTROL,
|
||||||
|
|||||||
@ -19,6 +19,7 @@ pub enum Action {
|
|||||||
|
|
||||||
/// The input was handled by a Component and should not be passed to the next component.
|
/// The input was handled by a Component and should not be passed to the next component.
|
||||||
Handled,
|
Handled,
|
||||||
|
OpenTab,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait Component {
|
pub trait Component {
|
||||||
|
|||||||
@ -23,14 +23,17 @@ impl Editor {
|
|||||||
"Editor"
|
"Editor"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: You shouldnt be able to construct the editor without a path?
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Editor {
|
Editor {
|
||||||
state: EditorState::default(),
|
state: EditorState::default(),
|
||||||
event_handler: EditorEventHandler::default(),
|
event_handler: EditorEventHandler::default(),
|
||||||
file_path: None,
|
file_path: None,
|
||||||
syntax_set: SyntaxSet::load_defaults_nonewlines(),
|
syntax_set: SyntaxSet::load_defaults_nonewlines(),
|
||||||
component_state: ComponentState::default()
|
component_state: ComponentState::default().with_help_text(concat!(
|
||||||
.with_help_text("CTRL+S: Save file | Any other input is handled by vim"),
|
"CTRL+S: Save file | ALT+(←/h): Previous tab | ALT+(l/→): Next tab |",
|
||||||
|
" All other input is handled by vim"
|
||||||
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,19 +23,20 @@ impl<'a> Explorer<'a> {
|
|||||||
"Explorer"
|
"Explorer"
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(path: &std::path::PathBuf) -> Result<Self> {
|
pub fn new(path: &PathBuf) -> Result<Self> {
|
||||||
let explorer = Explorer {
|
let explorer = Explorer {
|
||||||
root_path: path.to_owned(),
|
root_path: path.to_owned(),
|
||||||
tree_items: Self::build_tree_from_path(path.to_owned())?,
|
tree_items: Self::build_tree_from_path(path.to_owned())?,
|
||||||
tree_state: TreeState::default(),
|
tree_state: TreeState::default(),
|
||||||
component_state: ComponentState::default().with_help_text(
|
component_state: ComponentState::default().with_help_text(concat!(
|
||||||
"(↑/k)/(↓/j): Select item | ←/h: Close folder | →/l/Enter: Open folder",
|
"(↑/k)/(↓/j): Select item | ←/h: Close folder | →/l: Open folder |",
|
||||||
),
|
" Enter: Open editor tab"
|
||||||
|
)),
|
||||||
};
|
};
|
||||||
Ok(explorer)
|
Ok(explorer)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_tree_from_path(path: std::path::PathBuf) -> Result<TreeItem<'static, String>> {
|
fn build_tree_from_path(path: PathBuf) -> Result<TreeItem<'static, String>> {
|
||||||
let mut children = vec![];
|
let mut children = vec![];
|
||||||
if let Ok(entries) = fs::read_dir(&path) {
|
if let Ok(entries) = fs::read_dir(&path) {
|
||||||
let mut paths = entries
|
let mut paths = entries
|
||||||
@ -126,6 +127,7 @@ impl<'a> Component for Explorer<'a> {
|
|||||||
// Handle events here that should not be passed on to the vim emulation handler.
|
// Handle events here that should not be passed on to the vim emulation handler.
|
||||||
match self.handle_key_events(key_event)? {
|
match self.handle_key_events(key_event)? {
|
||||||
Action::Handled => return Ok(Action::Handled),
|
Action::Handled => return Ok(Action::Handled),
|
||||||
|
Action::OpenTab => return Ok(Action::OpenTab),
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,6 +141,15 @@ impl<'a> Component for Explorer<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handle_key_events(&mut self, key: KeyEvent) -> Result<Action> {
|
fn handle_key_events(&mut self, key: KeyEvent) -> Result<Action> {
|
||||||
|
if key.code == KeyCode::Enter {
|
||||||
|
if let Ok(selected) = self.selected() {
|
||||||
|
if PathBuf::from(&selected).is_file() {
|
||||||
|
return Ok(Action::OpenTab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Ok(Action::Noop);
|
||||||
|
}
|
||||||
|
|
||||||
let changed = match key.code {
|
let changed = match key.code {
|
||||||
KeyCode::Up | KeyCode::Char('k') => self.tree_state.key_up(),
|
KeyCode::Up | KeyCode::Char('k') => self.tree_state.key_up(),
|
||||||
KeyCode::Down | KeyCode::Char('j') => self.tree_state.key_down(),
|
KeyCode::Down | KeyCode::Char('j') => self.tree_state.key_down(),
|
||||||
@ -148,7 +159,6 @@ impl<'a> Component for Explorer<'a> {
|
|||||||
self.tree_state.close(key.as_ref())
|
self.tree_state.close(key.as_ref())
|
||||||
}
|
}
|
||||||
KeyCode::Right | KeyCode::Char('l') => self.tree_state.key_right(),
|
KeyCode::Right | KeyCode::Char('l') => self.tree_state.key_right(),
|
||||||
KeyCode::Enter => self.tree_state.toggle_selected(),
|
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
if changed {
|
if changed {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
use crate::tui::component::Action::Pass;
|
|
||||||
use crate::tui::component::{Action, Component, ComponentState};
|
use crate::tui::component::{Action, Component, ComponentState};
|
||||||
use crate::tui::menu_bar::MenuBarItemOption::{
|
use crate::tui::menu_bar::MenuBarItemOption::{
|
||||||
About, Exit, Reload, Save, ShowHideExplorer, ShowHideLogger,
|
About, Exit, Reload, Save, ShowHideExplorer, ShowHideLogger,
|
||||||
@ -33,12 +32,12 @@ enum MenuBarItemOption {
|
|||||||
impl MenuBarItemOption {
|
impl MenuBarItemOption {
|
||||||
fn id(&self) -> &str {
|
fn id(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
MenuBarItemOption::Save => "Save",
|
Save => "Save",
|
||||||
MenuBarItemOption::Reload => "Reload",
|
Reload => "Reload",
|
||||||
MenuBarItemOption::Exit => "Exit",
|
Exit => "Exit",
|
||||||
MenuBarItemOption::ShowHideExplorer => "Show / hide explorer",
|
ShowHideExplorer => "Show / hide explorer",
|
||||||
MenuBarItemOption::ShowHideLogger => "Show / hide logger",
|
ShowHideLogger => "Show / hide logger",
|
||||||
MenuBarItemOption::About => "About",
|
About => "About",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,7 +115,7 @@ impl MenuBar {
|
|||||||
buf: &mut Buffer,
|
buf: &mut Buffer,
|
||||||
opened: MenuBarItem,
|
opened: MenuBarItem,
|
||||||
) {
|
) {
|
||||||
let popup_area = Self::rect_under_option(title_bar_anchor, area, 40, 10);
|
let popup_area = Self::rect_under_option(title_bar_anchor, area, 27, 10);
|
||||||
Clear::default().render(popup_area, buf);
|
Clear::default().render(popup_area, buf);
|
||||||
let options = opened.options().iter().map(|i| ListItem::new(i.id()));
|
let options = opened.options().iter().map(|i| ListItem::new(i.id()));
|
||||||
StatefulWidget::render(
|
StatefulWidget::render(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user