-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Introduce text
macro
#2338
Introduce text
macro
#2338
Conversation
It would be nice to be able to receive as a second parameter (optional) a custom style. |
I don't think this would help much, have you seen #2312? I would say that |
Well, that's make more sense! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks 🙇
This PR introduces a
text
macro in thewidget::helpers
module analogous to thestd::format
macro.Implementation
This is a simple macro similar to the
row
andcolumn
helper macros, it usesformat
internally.The
macro_rules
definition:Usage
Since it uses the
std::format
macro internally, it's usage is analogous and should be familiar to most users, but some examples are documented in the macro definition:As a result, the
text(format!(
pattern has been replaced with the newtext
macro throughout theexamples
.