fix variable name

pull/88/head
Takayuki Maeda 3 years ago
parent 8d077c5f10
commit 360cc31c8c

@ -93,7 +93,7 @@ impl DrawableComponent for ConnectionsComponent {
.style(Style::default()),
)
}
let tasks = List::new(connections)
let connections = List::new(connections)
.block(Block::default().borders(Borders::ALL).title("Connections"))
.highlight_style(Style::default().bg(Color::Blue))
.style(Style::default());
@ -104,8 +104,9 @@ impl DrawableComponent for ConnectionsComponent {
width.min(f.size().width),
height.min(f.size().height),
);
f.render_widget(Clear, area);
f.render_stateful_widget(tasks, area, &mut self.state);
f.render_stateful_widget(connections, area, &mut self.state);
Ok(())
}
}

@ -1,4 +1,5 @@
pub mod command;
pub mod completion;
pub mod connections;
pub mod databases;
pub mod error;
@ -12,6 +13,7 @@ pub mod table_value;
pub mod utils;
pub use command::{CommandInfo, CommandText};
pub use completion::CompletionComponent;
pub use connections::ConnectionsComponent;
pub use databases::DatabasesComponent;
pub use error::ErrorComponent;
@ -55,6 +57,17 @@ pub trait DrawableComponent {
fn draw<B: Backend>(&mut self, f: &mut Frame<B>, rect: Rect, focused: bool) -> Result<()>;
}
pub trait MovableComponent {
fn draw<B: Backend>(
&mut self,
f: &mut Frame<B>,
rect: Rect,
focused: bool,
x: u16,
y: u16,
) -> Result<()>;
}
/// base component trait
#[async_trait]
pub trait Component {

Loading…
Cancel
Save