diff --git a/masonry/src/widget/prose.rs b/masonry/src/widget/prose.rs index 70ed3470b..4d6ac633f 100644 --- a/masonry/src/widget/prose.rs +++ b/masonry/src/widget/prose.rs @@ -81,7 +81,7 @@ impl Prose { /// Read the underlying text area. Useful for getting its ID. // This is a bit of a hack, to work around `from_text_area_pod` not being // able to set padding. - pub fn region_pod(&self) -> &WidgetPod> { + pub fn text_area_pod(&self) -> &WidgetPod> { &self.text } } diff --git a/masonry/src/widget/text_area.rs b/masonry/src/widget/text_area.rs index 05f051c31..e6aa190fc 100644 --- a/masonry/src/widget/text_area.rs +++ b/masonry/src/widget/text_area.rs @@ -62,7 +62,7 @@ pub struct TextArea { /// How many clicks have occurred in this click sequence. click_count: u32, - /// Whether to wrap words in this region. + /// Whether to wrap words in this area. /// /// Note that if clipping is desired, that should be added by the parent widget. /// Can be set using [`set_word_wrap`](Self::set_word_wrap). @@ -779,11 +779,11 @@ impl Widget for TextArea { let text_width = max_advance.unwrap_or(layout.full_width()); let text_size = Size::new(text_width.into(), layout.height().into()); - let region_size = Size { + let area_size = Size { height: text_size.height + padding_size.height, width: text_size.width + padding_size.width, }; - bc.constrain(region_size) + bc.constrain(area_size) } fn paint(&mut self, ctx: &mut PaintCtx, scene: &mut Scene) { diff --git a/masonry/src/widget/textbox.rs b/masonry/src/widget/textbox.rs index 44746253d..a319494a5 100644 --- a/masonry/src/widget/textbox.rs +++ b/masonry/src/widget/textbox.rs @@ -47,7 +47,7 @@ pub struct Textbox { impl Textbox { /// Create a new `Prose` with the given text. /// - /// To use non-default text properties, use [`from_area_region`](Self::from_text_area) instead. + /// To use non-default text properties, use [`from_text_area`](Self::from_text_area) instead. pub fn new(text: &str) -> Self { Self::from_text_area(TextArea::new_editable(text)) } diff --git a/xilem/src/view/prose.rs b/xilem/src/view/prose.rs index f8c75d646..191ab4d01 100644 --- a/xilem/src/view/prose.rs +++ b/xilem/src/view/prose.rs @@ -92,25 +92,25 @@ impl View for Prose { _ctx: &mut ViewCtx, mut element: Mut, ) { - let mut region = widget::Prose::text_mut(&mut element); + let mut text_area = widget::Prose::text_mut(&mut element); if prev.content != self.content { - widget::TextArea::reset_text(&mut region, &self.content); + widget::TextArea::reset_text(&mut text_area, &self.content); } if prev.text_brush != self.text_brush { - widget::TextArea::set_brush(&mut region, self.text_brush.clone()); + widget::TextArea::set_brush(&mut text_area, self.text_brush.clone()); } if prev.alignment != self.alignment { - widget::TextArea::set_alignment(&mut region, self.alignment); + widget::TextArea::set_alignment(&mut text_area, self.alignment); } if prev.text_size != self.text_size { - widget::TextArea::insert_style(&mut region, StyleProperty::FontSize(self.text_size)); + widget::TextArea::insert_style(&mut text_area, StyleProperty::FontSize(self.text_size)); } if prev.line_break_mode != self.line_break_mode { widget::TextArea::set_word_wrap( - &mut region, + &mut text_area, self.line_break_mode == LineBreaking::WordWrap, ); - drop(region); + drop(text_area); widget::Prose::set_clip(&mut element, line_break_clips(self.line_break_mode)); } } diff --git a/xilem/src/view/textbox.rs b/xilem/src/view/textbox.rs index e256d3f7e..535ee52f5 100644 --- a/xilem/src/view/textbox.rs +++ b/xilem/src/view/textbox.rs @@ -85,7 +85,7 @@ impl View for Textbox, ) { - let mut region = widget::Textbox::text_mut(&mut element); + let mut text_area = widget::Textbox::text_mut(&mut element); // Unlike the other properties, we don't compare to the previous value; // instead, we compare directly to the element's text. This is to handle @@ -94,15 +94,15 @@ impl View for Textbox