7sDream / fontfor

Find fonts which can show a specified character and preview them in terminal or browser.
GNU General Public License v3.0
160 stars 7 forks source link

chore(deps): bump tui from 0.13.0 to 0.14.0 #41

Closed dependabot-preview[bot] closed 3 years ago

dependabot-preview[bot] commented 3 years ago

Bumps tui from 0.13.0 to 0.14.0.

Release notes

Sourced from tui's releases.

v0.14.0

Breaking changes

New API for the Table widget

The Table widget got a lot of improvements that should make it easier to work with:

  • It should not longer panic when rendered on small areas.
  • Rows are now a collection of Cells, themselves wrapping a Text. This means you can style the entire Table, an entire Row, an entire Cell and rely on the styling capabilities of Text to get full control over the look of your Table.
  • Rows can have multiple lines.
  • The header is now optional and is just another Row always visible at the top.
  • Rows can have a bottom margin.
  • The header alignment is no longer off when an item is selected.

Taking the example of the code in examples/demo/ui.rs, this is what you may have to change:

     let failure_style = Style::default()
         .fg(Color::Red)
         .add_modifier(Modifier::RAPID_BLINK | Modifier::CROSSED_OUT);
-    let header = ["Server", "Location", "Status"];
     let rows = app.servers.iter().map(|s| {
         let style = if s.status == "Up" {
             up_style
         } else {
             failure_style
         };
-        Row::StyledData(vec![s.name, s.location, s.status].into_iter(), style)
+        Row::new(vec![s.name, s.location, s.status]).style(style)
     });
-    let table = Table::new(header.iter(), rows)
+    let table = Table::new(rows)
+        .header(
+            Row::new(vec!["Server", "Location", "Status"])
+                .style(Style::default().fg(Color::Yellow))
+                .bottom_margin(1),
+        )
         .block(Block::default().title("Servers").borders(Borders::ALL))
-        .header_style(Style::default().fg(Color::Yellow))
         .widths(&[
             Constraint::Length(15),
             Constraint::Length(15),

Here, we had to:

  • Change the way we construct Row which is no longer an enum but a struct. It accepts anything that can be converted to an iterator of things that can be converted to a Cell
  • The header is no longer a required parameter so we use Table::header to set it. Table::header_style has been removed since the style can be directly set using
Changelog

Sourced from tui's changelog.

v0.14.0 - 2021-01-01

Breaking changes

New API for the Table widget

The Table widget got a lot of improvements that should make it easier to work with:

  • It should not longer panic when rendered on small areas.
  • Rows are now a collection of Cells, themselves wrapping a Text. This means you can style the entire Table, an entire Row, an entire Cell and rely on the styling capabilities of Text to get full control over the look of your Table.
  • Rows can have multiple lines.
  • The header is now optional and is just another Row always visible at the top.
  • Rows can have a bottom margin.
  • The header alignment is no longer off when an item is selected.

Taking the example of the code in examples/demo/ui.rs, this is what you may have to change:

     let failure_style = Style::default()
         .fg(Color::Red)
         .add_modifier(Modifier::RAPID_BLINK | Modifier::CROSSED_OUT);
-    let header = ["Server", "Location", "Status"];
     let rows = app.servers.iter().map(|s| {
         let style = if s.status == "Up" {
             up_style
         } else {
             failure_style
         };
-        Row::StyledData(vec![s.name, s.location, s.status].into_iter(), style)
+        Row::new(vec![s.name, s.location, s.status]).style(style)
     });
-    let table = Table::new(header.iter(), rows)
+    let table = Table::new(rows)
+        .header(
+            Row::new(vec!["Server", "Location", "Status"])
+                .style(Style::default().fg(Color::Yellow))
+                .bottom_margin(1),
+        )
         .block(Block::default().title("Servers").borders(Borders::ALL))
-        .header_style(Style::default().fg(Color::Yellow))
         .widths(&[
             Constraint::Length(15),
             Constraint::Length(15),

Here, we had to:

  • Change the way we construct Row which is no longer an enum but a struct. It accepts anything that can be converted to an iterator of things that can be converted to a Cell
  • The header is no longer a required parameter so we use Table::header to set it.
Commits
  • f09863f Release v0.14.0
  • eb1e3be fix(widgets/block): make Block::inner return more accurate results on small a...
  • 4ec902b chore: make run-examples available on all platforms (#429)
  • 7424339 fix(widgets/table): draw table header and border even if rows are empty (#426)
  • e7f263e chore(ci): fix cargo-make cache on windows runner
  • 0991145 chore(ci): simplify ci workflow (#428)
  • 01d2a85 chore(ci): reduce the number of triggered jobs
  • 45431a2 chore: add first contributing guidelines
  • 0b78fb9 chore: use cargo-make in the CI as well
  • 9cdff27 chore: replace make with cargo-make
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)
dependabot-preview[bot] commented 3 years ago

Superseded by #49.