Nate Butler and Antonio Scandurra
23672987ff
gpui: Add support for slash pattern fills (///) ( #23576 )
...
TODO:
- [x] Add BackgroundTag::PatternSlash
- [x] Support metal slash pattern fills
- [x] Support blade slash pattern fills
---
Adds support for a new background type in gpui, `pattern_slash`.
Usage:
```rust
div().size(px(56.0)).bg(pattern_slash(gpui::red()))
```
This will create a 56px square with a red slash pattern fill.
You can run the pattern example with `cargo run -p gpui --example
pattern`:

---
After talking with @as-cii at length about how we want to support
patterns in gpui, we decided for now we'll simply add a new
BackgroundTag specific to this pattern.
It isn't the best long term plan however – we'll likely want to
introduce the concept of a `Fill` at some point so we can have
`Fill::Solid`, `Fill::Gradient(LinearGradient)`, etc in the future.
The pattern is designed to seamlessly tile vertically for elements of
the same height. For example, for use in editor line backgrounds:

---
Release Notes:
(do we do gpui release notes?)
- Adds support for slash pattern fills in `gpui`.
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com >
2025-01-28 11:33:34 -05:00
..
2025-01-27 04:00:27 +00:00
2025-01-28 10:56:05 -05:00
2025-01-26 03:02:45 +00:00
2025-01-27 21:56:29 +00:00
2025-01-28 11:40:42 -03:00
2025-01-27 21:56:29 +00:00
2025-01-27 13:40:59 -05:00
2025-01-26 03:02:45 +00:00
2025-01-28 11:40:42 -03:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 23:37:34 +00:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 04:00:27 +00:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-17 17:39:22 +01:00
2025-01-28 10:37:56 +02:00
2025-01-27 04:00:27 +00:00
2025-01-17 17:39:22 +01:00
2025-01-27 04:00:27 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 23:37:34 +00:00
2025-01-26 03:02:45 +00:00
2025-01-27 21:56:29 +00:00
2025-01-26 03:02:45 +00:00
2025-01-27 13:40:59 -05:00
2025-01-27 04:00:27 +00:00
2025-01-26 03:02:45 +00:00
2025-01-28 10:47:11 +02:00
2025-01-26 23:37:34 +00:00
2025-01-26 03:02:45 +00:00
2025-01-17 17:39:22 +01:00
2025-01-17 17:39:22 +01:00
2025-01-26 23:37:34 +00:00
2025-01-27 04:00:27 +00:00
2025-01-28 12:27:09 +01:00
2025-01-27 18:17:43 -05:00
2025-01-27 04:00:27 +00:00
2025-01-26 03:02:45 +00:00
2025-01-17 17:39:22 +01:00
2025-01-26 03:02:45 +00:00
2025-01-17 17:39:22 +01:00
2025-01-17 17:39:22 +01:00
2025-01-27 18:11:15 -08:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 21:56:29 +00:00
2025-01-17 17:39:22 +01:00
2025-01-28 11:33:34 -05:00
2025-01-27 21:56:29 +00:00
2025-01-26 03:02:45 +00:00
2025-01-17 17:39:22 +01:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-28 12:27:09 +01:00
2025-01-26 23:37:34 +00:00
2025-01-26 03:02:45 +00:00
2025-01-27 16:38:03 +00:00
2025-01-26 23:37:34 +00:00
2025-01-27 13:40:59 -05:00
2025-01-27 12:29:08 -03:00
2025-01-27 13:40:59 -05:00
2025-01-27 04:00:27 +00:00
2025-01-27 04:00:27 +00:00
2025-01-28 10:23:43 +01:00
2025-01-26 23:37:34 +00:00
2025-01-26 03:02:45 +00:00
2025-01-17 17:39:22 +01:00
2025-01-26 03:02:45 +00:00
2025-01-26 23:37:34 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 04:00:27 +00:00
2025-01-17 17:39:22 +01:00
2025-01-17 17:39:22 +01:00
2025-01-27 23:05:46 -07:00
2025-01-17 17:39:22 +01:00
2025-01-27 04:00:27 +00:00
2025-01-26 03:02:45 +00:00
2025-01-27 14:44:12 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 12:32:22 +01:00
2025-01-27 04:00:27 +00:00
2025-01-26 23:37:34 +00:00
2025-01-28 14:54:00 +01:00
2025-01-28 10:42:10 +02:00
2025-01-27 04:00:27 +00:00
2025-01-27 21:56:29 +00:00
2025-01-28 10:37:56 +02:00
2025-01-27 04:00:27 +00:00
2025-01-23 16:10:38 -05:00
2025-01-26 03:02:45 +00:00
2025-01-26 23:37:34 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 04:00:27 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-25 19:24:19 +00:00
2025-01-26 23:37:34 +00:00
2025-01-27 21:56:29 +00:00
2025-01-27 04:00:27 +00:00
2025-01-17 17:39:22 +01:00
2025-01-26 03:02:45 +00:00
2025-01-26 23:37:34 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-28 10:37:48 +01:00
2025-01-27 04:00:27 +00:00
2025-01-26 03:02:45 +00:00
2025-01-17 17:39:22 +01:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-17 17:39:22 +01:00
2025-01-24 14:18:22 -07:00
2025-01-26 23:37:34 +00:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 23:37:34 +00:00
2025-01-17 17:39:22 +01:00
2025-01-17 17:39:22 +01:00
2025-01-28 16:03:48 +02:00
2025-01-27 04:00:27 +00:00
2025-01-27 18:11:15 -08:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-17 17:39:22 +01:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 13:40:59 -05:00
2025-01-26 03:02:45 +00:00
2025-01-26 03:02:45 +00:00
2025-01-26 14:56:07 +08:00
2025-01-27 04:00:27 +00:00
2025-01-27 23:13:13 -07:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-27 23:11:35 -07:00
2025-01-28 11:40:42 -03:00
2025-01-28 11:10:00 +02:00
2025-01-26 03:02:45 +00:00
2025-01-27 04:00:27 +00:00
2025-01-28 13:56:57 +01:00