17 Commits

Author SHA1 Message Date
Josh McKinney
ae4f42f5ae
chore(deps): use less specific versions in manifests (#2041)
The goal of this is to reduce dependabot updates to generally only
Cargo.lock updates

- Use "0.x" or "x" as the version generally.
- Specify versions only in the workspace manifest
- Bump versions to latest semver compatible (and update rstest / lru /
  criterion deps)
2025-08-05 02:25:15 -07:00
dependabot[bot]
bbca3870d5
build(deps): bump rand from 0.9.1 to 0.9.2 (#2010)
Bumps [rand](https://github.com/rust-random/rand) from 0.9.1 to 0.9.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-random/rand/blob/master/CHANGELOG.md">rand's
changelog</a>.</em></p>
<blockquote>
<h2>[0.9.2 — 2025-07-20]</h2>
<h3>Deprecated</h3>
<ul>
<li>Deprecate <code>rand::rngs::mock</code> module and
<code>StepRng</code> generator (<a
href="https://redirect.github.com/rust-random/rand/issues/1634">#1634</a>)</li>
</ul>
<h3>Additions</h3>
<ul>
<li>Enable <code>WeightedIndex&lt;usize&gt;</code> (de)serialization (<a
href="https://redirect.github.com/rust-random/rand/issues/1646">#1646</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d3dd415705"><code>d3dd415</code></a>
Prepare rand_core 0.9.2 (<a
href="https://redirect.github.com/rust-random/rand/issues/1605">#1605</a>)</li>
<li><a
href="99fabd20e9"><code>99fabd2</code></a>
Prepare rand_core 0.9.2</li>
<li><a
href="c7fe1c43b5"><code>c7fe1c4</code></a>
rand: re-export <code>rand_core</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1604">#1604</a>)</li>
<li><a
href="db2b1e0bb4"><code>db2b1e0</code></a>
rand: re-export <code>rand_core</code></li>
<li><a
href="ee1d96f9f5"><code>ee1d96f</code></a>
rand_core: implement reborrow for <code>UnwrapMut</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1595">#1595</a>)</li>
<li><a
href="e0eb2ee0fc"><code>e0eb2ee</code></a>
rand_core: implement reborrow for <code>UnwrapMut</code></li>
<li><a
href="975f602f5d"><code>975f602</code></a>
fixup clippy 1.85 warnings</li>
<li><a
href="775b05be1b"><code>775b05b</code></a>
Relax <code>Sized</code> requirements for blanket impls (<a
href="https://redirect.github.com/rust-random/rand/issues/1593">#1593</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-random/rand/compare/rand_core-0.9.1...rand_core-0.9.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rand&package-manager=cargo&previous-version=0.9.1&new-version=0.9.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-21 22:33:35 +03:00
Josh McKinney
6dcd53bc6b
feat: add ergonomic methods for layouting Rects (#1909)
This commit introduces new methods for the `Rect` struct that simplify
the process of splitting a `Rect` into sub-rects according to a given
`Layout`. By putting these methods on the `Rect` struct, we make it a
bit more natural that a layout is applied to the `Rect` itself, rather
than passing a `Rect` to the `Layout` struct to be split.

Adds:
- `Rect::layout` and `Rect::try_layout` methods that allow splitting a
  `Rect` into an array of sub-rects according to a given `Layout`.
- `Rect::layout_vec` method that returns a `Vec` of sub-rects.
- `Layout::try_areas` method that returns an array of sub-rects, with
  compile-time checks for the number of constraints. This is added
  mainly for consistency with the new `Rect` methods.

```rust
use ratatui_core::layout::{Layout, Constraint, Rect};
let area = Rect::new(0, 0, 10, 10);
let layout = Layout::vertical([Constraint::Fill(1); 2]);

// Rect::layout() infers the number of constraints at compile time:
let [top, main] = area.layout(&layout);

// Rect::try_layout() and Layout::try_areas() do the same, but return a
// Result:
let [top, main] = area.try_layout(&layout)?;
let [top, main] = layout.try_areas(area)?;

// Rect::layout_vec() returns a Vec of sub-rects:
let areas_vec = area.layout_vec(&layout);

// you can also explicitly specify the number of constraints:
let areas = area.layout::<2>(&layout);
let areas = area.try_layout::<2>(&layout)?;
let areas = layout.try_areas::<2>(area)?;
```
2025-06-28 01:23:34 -07:00
dependabot[bot]
ac22d21deb
build(deps): bump color-eyre from 0.6.4 to 0.6.5 (#1889)
Bumps [color-eyre](https://github.com/eyre-rs/eyre) from 0.6.4 to 0.6.5.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f110d78793"><code>f110d78</code></a>
Bump color-eyre to 0.6.5, color-spantrace to 0.3.0</li>
<li><a
href="6534ecdcbb"><code>6534ecd</code></a>
Undo eyre version bump (DO NOT PUBLISH EYRE)</li>
<li><a
href="9f35b8c83f"><code>9f35b8c</code></a>
Exclude images from published crate (<a
href="https://redirect.github.com/eyre-rs/eyre/issues/239">#239</a>)</li>
<li><a
href="6e9ced8865"><code>6e9ced8</code></a>
re-bump eyre version</li>
<li>See full diff in <a
href="https://github.com/eyre-rs/eyre/compare/color-eyre@0.6.4...color-eyre@0.6.5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=color-eyre&package-manager=cargo&previous-version=0.6.4&new-version=0.6.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-02 12:56:08 -07:00
Tyler Breisacher
dbfb2c3399
chore: upgrade to Rust Edition 2024 (#1863)
https://doc.rust-lang.org/edition-guide/rust-2024/index.html

Fixes #1727
2025-05-19 01:17:03 -07:00
Josh McKinney
702fff501c
feat!: implement stylize methods directly on Style (#1572)
This makes it possible to create constants using the shorthand methods.

```rust
const MY_STYLE: Style = Style::new().blue().on_black();
```

Rather than implementing Styled for Style and then adding extension
methods that implement the Stylize shorthands, this implements the
methods as const functions directly on Style.

BREAKING CHANGE: `Style` no longer implements `Styled`. Any calls to
methods implemented by the blanket implementation of Stylize are now
defined directly on Style. Remove the Stylize import if it is no longer
used by your code.

The `reset()` method does not have a direct replacement, as it clashes
with the existing `reset()` method. Use `Style::reset()` rather than
`some_style.reset()`

Fixes: #1158
2025-05-14 15:26:29 -07:00
Josh McKinney
8d60e96b2b
refactor(examples): use crossterm event methods (#1792)
Crossterm 0.29 introduced methods to easily check / extract the event
type. E.g. as_key_press_event() and is_key_press(). This commit
updates the examples to use these methods instead of matching on
the event type. This makes the code cleaner and easier to read.

Also does a general cleanup of the event handling code in the examples.
2025-05-10 10:35:12 -07:00
dependabot[bot]
3745a67ba0
build(deps): bump rand from 0.9.0 to 0.9.1 (#1804)
Bumps [rand](https://github.com/rust-random/rand) from 0.9.0 to 0.9.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-random/rand/blob/master/CHANGELOG.md">rand's
changelog</a>.</em></p>
<blockquote>
<h2>[0.9.1] - 2025-04-17</h2>
<h3>Security and unsafe</h3>
<ul>
<li>Revise &quot;not a crypto library&quot; policy again (<a
href="https://redirect.github.com/rust-random/rand/issues/1565">#1565</a>)</li>
<li>Remove <code>zerocopy</code> dependency from <code>rand</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1579">#1579</a>)</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Fix feature <code>simd_support</code> for recent nightly rust (<a
href="https://redirect.github.com/rust-random/rand/issues/1586">#1586</a>)</li>
</ul>
<h3>Changes</h3>
<ul>
<li>Allow <code>fn rand::seq::index::sample_weighted</code> and <code>fn
IndexedRandom::choose_multiple_weighted</code> to return fewer than
<code>amount</code> results (<a
href="https://redirect.github.com/rust-random/rand/issues/1623">#1623</a>),
reverting an undocumented change (<a
href="https://redirect.github.com/rust-random/rand/issues/1382">#1382</a>)
to the previous release.</li>
</ul>
<h3>Additions</h3>
<ul>
<li>Add <code>rand::distr::Alphabetic</code> distribution. (<a
href="https://redirect.github.com/rust-random/rand/issues/1587">#1587</a>)</li>
<li>Re-export <code>rand_core</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1604">#1604</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ec6d5c06a5"><code>ec6d5c0</code></a>
Prepare rand_core v0.9.1 (<a
href="https://redirect.github.com/rust-random/rand/issues/1591">#1591</a>)</li>
<li><a
href="6a06056e8a"><code>6a06056</code></a>
rand_core: introduce an UnwrapMut wrapper (<a
href="https://redirect.github.com/rust-random/rand/issues/1589">#1589</a>)</li>
<li><a
href="8929123b4d"><code>8929123</code></a>
Add <code>Alphabetic</code> distribution (<a
href="https://redirect.github.com/rust-random/rand/issues/1587">#1587</a>)</li>
<li><a
href="06b16426bd"><code>06b1642</code></a>
Remove unnecessary underscore from `impl&lt;T, const N: usize&gt;
Distribution&lt;[T; ...</li>
<li><a
href="49d76cd7b4"><code>49d76cd</code></a>
rename extract to extract_lane (<a
href="https://redirect.github.com/rust-random/rand/issues/1586">#1586</a>)</li>
<li><a
href="e0a70fd8be"><code>e0a70fd</code></a>
Change to use <code>array::from_fn</code> in <code>Distribution\&lt;[T;
N]&gt; for StandardUniform</code> ...</li>
<li><a
href="0bc3f652c4"><code>0bc3f65</code></a>
Move rand distr (<a
href="https://redirect.github.com/rust-random/rand/issues/1577">#1577</a>)</li>
<li><a
href="2677c49960"><code>2677c49</code></a>
Revise &quot;not a crypto library&quot; policy and SECURITY.md (<a
href="https://redirect.github.com/rust-random/rand/issues/1565">#1565</a>)</li>
<li><a
href="bfd1826c36"><code>bfd1826</code></a>
SeedableRng docs: add note on (lack of) reproducibility (<a
href="https://redirect.github.com/rust-random/rand/issues/1572">#1572</a>)</li>
<li><a
href="c01aee7a13"><code>c01aee7</code></a>
Fix some links (<a
href="https://redirect.github.com/rust-random/rand/issues/1571">#1571</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-random/rand/compare/0.9.0...rand_core-0.9.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rand&package-manager=cargo&previous-version=0.9.0&new-version=0.9.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-21 21:14:44 +03:00
cgzones
0f80c5e87e
chore!: use expect() instead of allow() for lint overrides (#1786)
BREAKING CHANGE: MSRV is now 1.81
2025-04-15 10:20:22 -07:00
Josh McKinney
2739391950
style: use Module imports_granularity (#1728)
I was swayed by the arguments about this made by the compiler team In
<https://github.com/rust-lang/compiler-team/issues/750> and decided to
look at how this organization affects ratatui. I found this reduces the
number of lines across the codebase by about 350 and makes the imports
more readable and definitely more greppable as you usually only have
to read a single line. I've found in the past that maintaining imports
regularly leads to merge conflicts which have to be resolved by hand
and this change should reduce the likelihood of that happening.

Main change is in rustfmt.toml, and the rest is just the result of
running `cargo xtask format`.

While implementing this, cargo machete brings up that the various
backend crates are unused by the example crates.

The re-export of each backend crate under ratatui is to make it possible
for libs that rely on a specific version of ratatui to use the same
version of the backend crate. Apps in general should use the backend
crate directly rather than through ratatui as this is less confusing.

- Removes all usages of `ratatui::{crossterm, termion, termwiz}`` in the
  examples.
- Adds the backend crate to the dependencies of the examples that use
  the backend crate directly.
2025-03-19 16:48:02 -07:00
Orhun Parmaksız
dca331c748
fix(demo): support tab key in demo2 example (#1726)
see #1721

Not sure what caused this - it's been there for a while probably and we
didn't realize it since we used `demo2-destroy` mostly.
2025-03-19 12:14:49 +03:00
dependabot[bot]
83774eecf0
build(deps): bump time from 0.3.37 to 0.3.39 (#1708)
Bumps [time](https://github.com/time-rs/time) from 0.3.37 to 0.3.39.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/releases">time's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.39</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
<h2>v0.3.38</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">time's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.39 [2025-03-06]</h2>
<h3>Fixed</h3>
<ul>
<li>Doc tests run successfully with the default feature set.</li>
<li>wasm builds work again.</li>
</ul>
<p>Both of these were regressions in v0.3.38 and are now checked in
CI.</p>
<h2>0.3.38 [2025-03-05]</h2>
<h3>Added</h3>
<ul>
<li>
<p>The <code>[year]</code> component (in format descriptions) now
supports a <code>range</code> modifier, which can be
either <code>standard</code> or <code>extended</code>. The default is
<code>extended</code> for backwards compatibility. This is
intended as a manner to opt <em>out</em> of the extended range when the
<code>large-dates</code> feature is enabled.
When the <code>large-dates</code> feature is not enabled, the modifier
has no effect.</p>
</li>
<li>
<p><code>UtcDateTime</code>, which is semantically equivalent to an
<code>OffsetDateTime</code> with UTC as its offset. The
advantage is that it is the same size as a
<code>PrimitiveDateTime</code> and has improved operability with
well-known formats.</p>
<p>As part of this, there were some other additions:</p>
<ul>
<li><code>utc_datetime!</code> macro, which is similar to the
<code>datetime!</code> macro but constructs a
<code>UtcDateTime</code>.</li>
<li><code>PrimitiveDateTime::as_utc</code></li>
<li><code>OffsetDateTime::to_utc</code></li>
<li><code>OffsetDateTime::checked_to_utc</code></li>
</ul>
</li>
<li>
<p><code>time::serde::timestamp::milliseconds_i64</code>, which is a
module to serialize/deserialize timestamps
as the Unix timestamp. The pre-existing module does this as an
<code>i128</code> where an <code>i64</code> would
suffice. This new module should be preferred.</p>
</li>
</ul>
<h3>Changed</h3>
<ul>
<li><code>error::Format</code> has had its <code>source()</code>
implementation changed to no longer return a boxed value
from the <code>ComponentRange</code> variant. If you were explicitly
expecting this, you will need to update
your code. The method API remains unchanged.</li>
<li><code>[year repr:century]</code> supports single-digit values.</li>
<li>All <code>format_into</code> methods accept <code>?Sized</code>
references.</li>
</ul>
<h3>Miscellaneous</h3>
<ul>
<li>Some non-exhaustive enum variants that are no longer used have been
modified to be statically
proven as uninhabited. The relevant fields are doc-hidden and not
semver-guaranteed to remain as
such, though it is unlikely to change.</li>
<li>An unnecessary check when parsing RFC 2822 has been removed.</li>
<li>Various methods have had their implementations changed, resulting in
significant performance
gains. Among the methods changed are
<ul>
<li><code>util::is_leap_year</code></li>
<li><code>util::weeks_in_year</code></li>
<li><code>Month::length</code></li>
<li><code>Date::to_calendar_date</code></li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7949d2c2e8"><code>7949d2c</code></a>
v0.3.39 release</li>
<li><a
href="f51623b653"><code>f51623b</code></a>
Fix breakage from v0.3.38</li>
<li><a
href="1a31c0595b"><code>1a31c05</code></a>
v0.3.38 release</li>
<li><a
href="addf231ef5"><code>addf231</code></a>
Permit unsized writers for <code>format_into</code></li>
<li><a
href="338f84f545"><code>338f84f</code></a>
Allow clippy::ref_option lint for serde::format_description.</li>
<li><a
href="f8ecd81e8f"><code>f8ecd81</code></a>
feat: timestamp::milliseconds_i64 serializer</li>
<li><a
href="ce03bcab8f"><code>ce03bca</code></a>
Update Unicode license for cargo-audit</li>
<li><a
href="3d0b981381"><code>3d0b981</code></a>
Add parentheses for clarity</li>
<li><a
href="3096301eb3"><code>3096301</code></a>
Remove specific year from license</li>
<li><a
href="ec327a26db"><code>ec327a2</code></a>
Optimize Julian day calculations</li>
<li>Additional commits viewable in <a
href="https://github.com/time-rs/time/compare/v0.3.37...v0.3.39">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=time&package-manager=cargo&previous-version=0.3.37&new-version=0.3.39)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-06 17:35:39 -08:00
Orhun Parmaksız
d045305c67
chore(deps): bump rand and rand_chacha (#1633)
<https://rust-random.github.io/book/update-0.9.html>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 14:13:35 -08:00
Jens Krause
7ad9c29eac
feat(linegauge): customized symbols (#1601)
With this PR any symbol (`&str`) can be used to render `filled` and
`unfilled` parts of `LineGauge` now. Before that change, only
[`symbols::line::Set`](https://docs.rs/ratatui/latest/ratatui/symbols/line/struct.Set.html)
was accepted.

Note: New methods are introduced to define those symbols:
`filled_symbol` and `unfilled_symbol`. The method
[`line_set`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.LineGauge.html#method.line_set)
is still there, but marked as `deprecated`.

![line_gauge](https://github.com/user-attachments/assets/cae308b8-151b-461d-8af6-9a20012adf2f)
2025-01-22 19:56:22 -08:00
n4n5
50ba96518f
feat: add a new RatatuiMascot widget (#1584)
Move the Mascot from Demo2 into a new widget.
Make the Rat grey and adjust the other colors.

```rust
frame.render_widget(RatatuiMascot::default(), frame.area());
```
2024-12-26 04:32:38 -08:00
dependabot[bot]
3646c97840
chore(deps): bump time from 0.3.36 to 0.3.37 (#1561)
Bumps [time](https://github.com/time-rs/time) from 0.3.36 to 0.3.37.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/releases">time's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.37</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">time's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.37 [2024-12-03]</h2>
<h3>Added</h3>
<ul>
<li><code>Time::MAX</code>, equivalent to
<code>time!(23:59:59.999999999)</code></li>
<li><code>[year repr:century]</code> is now supported in format
descriptions. When used in conjunction with
<code>[year repr:last_two]</code>, there is sufficient information to
parse a date. Note that with the
<code>large-date</code> feature enabled, there is an ambiguity when
parsing the two back-to-back.</li>
<li>Parsing of <code>strftime</code>-style format descriptions, located
at
<code>time::format_description::parse_strftime_borrowed</code> and
<code>time::format_description::parse_strftime_owned</code></li>
<li><code>time::util::refresh_tz</code> and
<code>time::util::refresh_tz_unchecked</code>, which updates information
obtained via the <code>TZ</code> environment variable. This is
equivalent to the <code>tzset</code> syscall on Unix-like
systems, with and without built-in soundness checks, respectively.</li>
<li><code>Month::length</code> and <code>util::days_in_month</code>,
replacing <code>util::days_in_year_month</code>.</li>
<li>Expressions are permitted in
<code>time::serde::format_description!</code> rather than only paths.
This also
drastically improves diagnostics when an invalid value is provided.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>
<p>Obtaining the system UTC offset on Unix-like systems should now
succeed when multi-threaded.
However, if the <code>TZ</code> environment variable is altered, the
program will not be aware of this until
<code>time::util::refresh_tz</code> or
<code>time::util::refresh_tz_unchecked</code> is called.
<code>refresh_tz</code> has the
same soundness requirements as obtaining the system UTC offset
previously did, with the
requirements still being automatically enforced.
<code>refresh_tz_unchecked</code> does not enforce these
requirements at the expense of being <code>unsafe</code>. Most programs
should not need to call either
function.</p>
<p>Due to this change, the <code>time::util::local_offset</code> module
has been deprecated in its entirety. The
<code>get_soundness</code> and <code>set_soundness</code> functions are
now no-ops.</p>
<p>Note that while calls <em>should</em> succeed, success is not
guaranteed in any situation. Downstream
users should always be prepared to handle the error case.</p>
</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Floating point values are truncated, not rounded, when
formatting.</li>
<li>RFC3339 allows arbitrary separators between the date and time
components.</li>
<li>Serialization of negative <code>Duration</code>s less than one
second is now correct. It previously omitted
the negative sign.</li>
<li><code>From&lt;js_sys::Date&gt; for OffsetDateTime</code> now ensures
sub-millisecond values are not erroneously
returned.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d4e39b306d"><code>d4e39b3</code></a>
v0.3.37 release</li>
<li><a
href="09439970e5"><code>0943997</code></a>
Fix CI failure</li>
<li><a
href="8b50f04ee0"><code>8b50f04</code></a>
Update lints</li>
<li><a
href="56f1db6dfa"><code>56f1db6</code></a>
Add <code>Month::length</code>, <code>days_in_month</code></li>
<li><a
href="03bcfe9f28"><code>03bcfe9</code></a>
Skip formatting some macros, update UI tests</li>
<li><a
href="4404638fe2"><code>4404638</code></a>
Permit exprs in <code>serde::format_description!</code></li>
<li><a
href="6b43b44060"><code>6b43b44</code></a>
strftime implementation</li>
<li><a
href="98569ffe5b"><code>98569ff</code></a>
Hide deprecations from docs</li>
<li><a
href="febf3a10de"><code>febf3a1</code></a>
Obtain local offset in multi-threaded situations</li>
<li><a
href="1e19827c5a"><code>1e19827</code></a>
Update rstest and rstest_reuse; bump MSRV to 1.67.1 (<a
href="https://redirect.github.com/time-rs/time/issues/716">#716</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/time-rs/time/compare/v0.3.36...v0.3.37">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=time&package-manager=cargo&previous-version=0.3.36&new-version=0.3.37)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 15:26:18 -08:00
Josh McKinney
35eba76b4d
chore(example): move demo2 to top level folder (#1524) 2024-12-01 13:46:26 +03:00