pub struct TextBuilder { /* private fields */ }
Expand description
TextBuilder is used to create instances of Text
widget and register them in the user interface.
Implementations§
Source§impl TextBuilder
impl TextBuilder
Sourcepub fn new(widget_builder: WidgetBuilder) -> TextBuilder
pub fn new(widget_builder: WidgetBuilder) -> TextBuilder
Creates new TextBuilder
instance using the provided base widget builder.
Sourcepub fn with_text<P>(self, text: P) -> TextBuilder
pub fn with_text<P>(self, text: P) -> TextBuilder
Sets the desired text of the widget.
Sourcepub fn with_font(self, font: Resource<Font>) -> TextBuilder
pub fn with_font(self, font: Resource<Font>) -> TextBuilder
Sets the desired font of the widget.
Sourcepub fn with_opt_font(self, font: Option<Resource<Font>>) -> TextBuilder
pub fn with_opt_font(self, font: Option<Resource<Font>>) -> TextBuilder
Sets the desired font of the widget using font wrapped in Option
.
Sourcepub fn with_vertical_text_alignment(
self,
valign: VerticalAlignment,
) -> TextBuilder
pub fn with_vertical_text_alignment( self, valign: VerticalAlignment, ) -> TextBuilder
Sets the desired vertical alignment of the widget.
Sourcepub fn with_font_size(self, font_size: StyledProperty<f32>) -> TextBuilder
pub fn with_font_size(self, font_size: StyledProperty<f32>) -> TextBuilder
Sets the desired height of the text.
Sourcepub fn with_horizontal_text_alignment(
self,
halign: HorizontalAlignment,
) -> TextBuilder
pub fn with_horizontal_text_alignment( self, halign: HorizontalAlignment, ) -> TextBuilder
Sets the desired horizontal alignment of the widget.
Sourcepub fn with_wrap(self, wrap: WrapMode) -> TextBuilder
pub fn with_wrap(self, wrap: WrapMode) -> TextBuilder
Sets the desired word wrapping mode of the widget.
Sourcepub fn with_shadow(self, shadow: bool) -> TextBuilder
pub fn with_shadow(self, shadow: bool) -> TextBuilder
Whether the shadow enabled or not.
Sourcepub fn with_shadow_brush(self, brush: Brush) -> TextBuilder
pub fn with_shadow_brush(self, brush: Brush) -> TextBuilder
Sets desired shadow brush. It will be used to render the shadow.
Sourcepub fn with_shadow_dilation(self, thickness: f32) -> TextBuilder
pub fn with_shadow_dilation(self, thickness: f32) -> TextBuilder
Sets desired shadow dilation in units. Keep in mind that the dilation is absolute, not percentage-based.
Sourcepub fn with_shadow_offset(
self,
offset: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>,
) -> TextBuilder
pub fn with_shadow_offset( self, offset: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> TextBuilder
Sets desired shadow offset in units.
Sourcepub fn build(self, ctx: &mut BuildContext<'_>) -> Handle<UiNode>
pub fn build(self, ctx: &mut BuildContext<'_>) -> Handle<UiNode>
Finishes text widget creation and registers it in the user interface, returning its handle to you.
Auto Trait Implementations§
impl Freeze for TextBuilder
impl !RefUnwindSafe for TextBuilder
impl Send for TextBuilder
impl Sync for TextBuilder
impl Unpin for TextBuilder
impl !UnwindSafe for TextBuilder
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.