Skip to content

Commit

Permalink
Move checkbox to left side of toggle tables
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Feb 28, 2024
1 parent 233aeb0 commit 61de209
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [Unreleased] - ReleaseDate

### Changed

- Move checkbox to left side of toggle tables

## [0.13.0] - 2024-02-21

### Added
Expand Down
5 changes: 3 additions & 2 deletions src/tui/view/common/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,14 @@ where
let theme = &TuiContext::get().theme;
// Include the given cells, then tack on the checkbox for enabled state
Row::new(
self.cells.into_iter().map(Cell::from).chain(iter::once(
iter::once(
Checkbox {
checked: self.enabled,
}
.generate()
.into(),
)),
)
.chain(self.cells.into_iter().map(Cell::from)),
)
.style(if self.enabled {
theme.table.text
Expand Down
6 changes: 3 additions & 3 deletions src/tui/view/component/recipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ impl<'a> Draw<RequestPaneProps<'a>> for RecipePane {
}
}
Tab::Query => frame.render_stateful_widget(
to_table(&recipe_state.query, ["Parameter", "Value", ""])
to_table(&recipe_state.query, ["", "Parameter", "Value"])
.generate(),
content_area,
&mut recipe_state.query.state_mut(),
),
Tab::Headers => frame.render_stateful_widget(
to_table(&recipe_state.headers, ["Header", "Value", ""])
to_table(&recipe_state.headers, ["", "Header", "Value"])
.generate(),
content_area,
&mut recipe_state.headers.state_mut(),
Expand Down Expand Up @@ -414,9 +414,9 @@ fn to_table<'a>(
.collect_vec(),
header: Some(header),
column_widths: &[
Constraint::Min(3),
Constraint::Percentage(50),
Constraint::Percentage(50),
Constraint::Min(3),
],
..Default::default()
}
Expand Down

0 comments on commit 61de209

Please sign in to comment.