Merge branch 'main' into window_context_2
This commit is contained in:
commit
c52b6328b7
47 changed files with 3046 additions and 1772 deletions
|
@ -37,7 +37,7 @@ pub struct TooltipStyle {
|
|||
pub container: ContainerStyle,
|
||||
pub text: TextStyle,
|
||||
keystroke: KeystrokeStyle,
|
||||
pub max_text_width: f32,
|
||||
pub max_text_width: Option<f32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Default)]
|
||||
|
@ -135,9 +135,14 @@ impl<V: View> Tooltip<V> {
|
|||
) -> impl Drawable<V> {
|
||||
Flex::row()
|
||||
.with_child({
|
||||
let text = Text::new(text, style.text)
|
||||
.constrained()
|
||||
.with_max_width(style.max_text_width);
|
||||
let text = if let Some(max_text_width) = style.max_text_width {
|
||||
Text::new(text, style.text)
|
||||
.constrained()
|
||||
.with_max_width(max_text_width)
|
||||
} else {
|
||||
Text::new(text, style.text).constrained()
|
||||
};
|
||||
|
||||
if measure {
|
||||
text.flex(1., false).boxed()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue