-
Notifications
You must be signed in to change notification settings - Fork 628
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
String: Add .is-empty and .character-count properties #7192
base: master
Are you sure you want to change the base?
Conversation
1a94a2f
to
aea12f3
Compare
Thanks a lot for the PR. What is the usecase for this? (I also wonder if it shouldn't be a property instead of a function, like the one on model/array) |
Thanks for your comment.
How can I generate the docs like https://docs.slint.dev/latest/docs/slint/reference/primitive-types/#images ? I've tried https://github.com/slint-ui/slint/blob/master/docs/development.md#documentation but it seems that only rust documentation is generated.
For
Your are right. I will figure out how it would be.
I thought so, then I found that is-float() was implemented as a function. I will check model/array and try to make them as properties. |
bedc413
to
9dc80d7
Compare
I read https://github.com/slint-ui/slint/blob/master/docs/astro/README.md and was able to build the slintdoc. |
Olivier and I discussed this a bit in a call and came to the following conclusion:
Thanks for working on this :) |
Subsequence discussion in Mattermost yielded a new compromise on the new name for |
Looks good to me appart from the two small details i made comment on. |
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 to me. Thanks @task-jp! We'd like to release 1.9.2 in the coming days. Would you be okay if we included this PR after the release, so that it'll be part of 1.10?
@@ -62,6 +62,7 @@ image = { workspace = true, optional = true, features = ["default"] } | |||
|
|||
esp-backtrace = { version = "0.14.0", features = ["panic-handler", "println"], optional = true } | |||
esp-println = { version = "0.12.0", default-features = false, features = ["uart"], optional = true } | |||
unicode-segmentation = "1.12.0" |
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.
After #7310 this could be:
unicode-segmentation = "1.12.0" | |
unicode-segmentation = { workspace = true } |
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.
Thanks for the PR. I'll update all of them once #7310 is merged.
@@ -187,6 +187,8 @@ log = { workspace = true, optional = true } | |||
|
|||
raw-window-handle-06 = { workspace = true, optional = true } | |||
|
|||
unicode-segmentation = "1.12.0" |
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.
unicode-segmentation = "1.12.0" | |
unicode-segmentation = { workspace = true } |
@@ -134,6 +134,7 @@ spin_on = { workspace = true, optional = true } | |||
raw-window-handle-06 = { workspace = true, optional = true } | |||
itertools = { workspace = true } | |||
smol_str = { workspace = true } | |||
unicode-segmentation = "1.12.0" |
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.
unicode-segmentation = "1.12.0" | |
unicode-segmentation = { workspace = true } |
Sure, it is not in a hurry. |
Introduce two new properties for string in .slint: - .is-empty: Checks if a string is empty. - .character-count: Retrieves the number of grapheme clusters https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries These additions enhance functionality and improve convenience when working with string properties.
Introduce two new methods for string properties in .slint:
These additions enhance functionality and improve convenience when working with string properties.