-
Notifications
You must be signed in to change notification settings - Fork 489
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
Added TextStyle for the Text control #2270
Conversation
@@ -137,7 +138,7 @@ def __init__( | |||
size: OptionalNumber = None, | |||
weight: Optional[FontWeight] = None, | |||
italic: Optional[bool] = None, | |||
style: Optional[TextThemeStyle] = None, | |||
style: Optional[Union[TextThemeStyle, TextStyle]] = None, |
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.
Nice idea! I'm not a big fan of mixing types though, but let's users decide! :)
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.
I think we should separate props. Perhaps create text_style
and theme_style
? - such that one can use both. Or it should not be permitted?
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.
Since @ndonkoHenri noticed this 🫣 I'm not going to try convincing him that "it's OK like that" - let's have two separate properties 😏
Now, I'd love to have style
property be of TextStyle
to look the same as TextSpan.style
, and then theme_style
for named styles.
However, we don't want to break a lot of existing applications. I'm thinking what if we "temporary" make style
property accepting both TextThemeStyle
and TextStyle
(like in this PR) and also add theme_style
which accepts only TextThemeStyle
. Will update docs for .style
property to allow only TextStyle
. What do you guys think?
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.
@50Bytes-dev would you implement that (along with previous note) please?
@FeodorFitsner check it |
* add TextStyle for Text * fix * add theme_style * fix types * fix types * change to _before_build_command() * fix
Added TextStyle support for the Text control and added a height attribute for TextStyle