-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gpui: Add support for slash pattern fills (///
)
#23576
base: main
Are you sure you want to change the base?
Conversation
Co-Authored-By: Antonio Scandurra <[email protected]>
@jansol Mind taking a peek at this one? Any thoughts? |
Looks like the base pattern size does not take display scaling into account? Other than that nothing immediately caught my eye on a quick peek. This was a problem for squiggly underlines too and I can't remember rn if those were ever fixed? Also it would be neat if it was possible to specify the on and off size of the pattern from app code in em or pt units. |
@jansol Thanks for taking a look! Hmm... let me take a look at the display scaling thing. Agreed. I want to expand patterns quite a bit more than this – at the very least I'd like to use them for dashes. I'll see what I can do then about adding some more control! |
TODO:
Adds support for a new background type in gpui,
pattern_slash
.Usage:
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 haveFill::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?)
gpui
.