Refactored table filtering and searching so that they are now relative to the table being filtered/searched on. Also created two new widgets for error messages and popups to make life easier moving forward. Going to refactor table sorting into StatefulTable's as well so all tables can be searched, filtered, and sorted moving forwards.
This commit is contained in:
@@ -40,7 +40,7 @@ impl<'a> Button<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
fn render_button_with_icon(&self, area: Rect, buf: &mut Buffer) {
|
||||
fn render_button_with_icon(self, area: Rect, buf: &mut Buffer) {
|
||||
let [title_area, icon_area] = Layout::horizontal([
|
||||
Constraint::Length(self.title.len() as u16),
|
||||
Constraint::Percentage(25),
|
||||
@@ -63,7 +63,7 @@ impl<'a> Button<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn render_labeled_button(&self, area: Rect, buf: &mut Buffer) {
|
||||
fn render_labeled_button(self, area: Rect, buf: &mut Buffer) {
|
||||
let [label_area, button_area] =
|
||||
Layout::horizontal([Constraint::Percentage(48), Constraint::Percentage(48)]).areas(area);
|
||||
let label_paragraph = Paragraph::new(Text::from(format!("\n{}: ", self.label.unwrap())))
|
||||
@@ -79,7 +79,7 @@ impl<'a> Button<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn render_button(&self, area: Rect, buf: &mut Buffer) {
|
||||
fn render_button(self, area: Rect, buf: &mut Buffer) {
|
||||
Paragraph::new(Text::from(self.title))
|
||||
.block(layout_block())
|
||||
.alignment(Alignment::Center)
|
||||
|
||||
Reference in New Issue
Block a user