You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Problem
I'm looking to using text with mixed formatting as the text of a CollapsingHeader, whose parameter is an Into<WidgetText>. In my case, I am trying to get ordinary body text, with one word in the middle bolded (like this: "Using: Chrome (started using 2 minutes ago)"). As far as I can tell, this currently requires the use of a LayoutJob, whose API, while allowing a great deal of control, is not very ergonomic and takes some work to make it visually match a RichText.
Example
The best way I know how to achieve this currently looks something like this:
I could reduce a little duplication by pulling the 'normal text' TextFormat into a variable, but this is still a lot of code just to get one part of the text bolded. Manipulating TextFormat directly is much more difficult than using a RichText.
My Dream
I would love if there were an easy way to make something implementing Into<WidgetText> from multiple RichTexts. The RichText api is very ergonomic, and this would ensure visual consistency across the application.
I will be raising a PR shortly that takes a small step towards this, but I'm not sure if it's the best solution.
The text was updated successfully, but these errors were encountered:
The Problem
I'm looking to using text with mixed formatting as the text of a
CollapsingHeader
, whose parameter is anInto<WidgetText>
. In my case, I am trying to get ordinary body text, with one word in the middle bolded (like this: "Using: Chrome (started using 2 minutes ago)"). As far as I can tell, this currently requires the use of a LayoutJob, whose API, while allowing a great deal of control, is not very ergonomic and takes some work to make it visually match aRichText
.Example
The best way I know how to achieve this currently looks something like this:
I could reduce a little duplication by pulling the 'normal text'
TextFormat
into a variable, but this is still a lot of code just to get one part of the text bolded. ManipulatingTextFormat
directly is much more difficult than using aRichText
.My Dream
I would love if there were an easy way to make something implementing
Into<WidgetText>
from multipleRichText
s. TheRichText
api is very ergonomic, and this would ensure visual consistency across the application.I will be raising a PR shortly that takes a small step towards this, but I'm not sure if it's the best solution.
The text was updated successfully, but these errors were encountered: