Struct components::AlignConstraint[][src]

pub struct AlignConstraint(_, _);

Implementations

impl AlignConstraint[src]

pub fn new<P>(
    source: Option<&P>,
    axis: AlignAxis,
    factor: f32
) -> AlignConstraint where
    P: IsA<Actor>, 
[src]

Creates a new constraint, aligning a Actor’s position with regards of the size of the actor to source, with the given alignment factor

source

the Actor to use as the source of the alignment, or None

axis

the axis to be used to compute the alignment

factor

the alignment factor, between 0.0 and 1.0

Returns

the newly created AlignConstraint

pub fn get_align_axis(&self) -> AlignAxis[src]

Retrieves the value set using AlignConstraint::set_align_axis

Returns

the alignment axis

pub fn get_factor(&self) -> f32[src]

Retrieves the factor set using AlignConstraint::set_factor

Returns

the alignment factor

pub fn get_source(&self) -> Option<Actor>[src]

Retrieves the source of the alignment

Returns

the Actor used as the source of the alignment

pub fn set_align_axis(&self, axis: AlignAxis)[src]

Sets the axis to which the alignment refers to

axis

the axis to which the alignment refers to

pub fn set_factor(&self, factor: f32)[src]

Sets the alignment factor of the constraint

The factor depends on the AlignConstraint:align-axis property and it is a value between 0.0 (meaning left, when AlignConstraint:align-axis is set to AlignAxis::XAxis; or meaning top, when AlignConstraint:align-axis is set to AlignAxis::YAxis) and 1.0 (meaning right, when AlignConstraint:align-axis is set to AlignAxis::XAxis; or meaning bottom, when AlignConstraint:align-axis is set to AlignAxis::YAxis). A value of 0.5 aligns in the middle in either cases

factor

the alignment factor, between 0.0 and 1.0

pub fn set_source<P>(&self, source: Option<&P>) where
    P: IsA<Actor>, 
[src]

Sets the source of the alignment constraint

source

a Actor, or None to unset the source

pub fn connect_property_align_axis_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&AlignConstraint), 
[src]

pub fn connect_property_factor_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&AlignConstraint), 
[src]

pub fn connect_property_source_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&AlignConstraint), 
[src]

Trait Implementations

impl Clone for AlignConstraint[src]

impl Debug for AlignConstraint[src]

impl Display for AlignConstraint[src]

impl Eq for AlignConstraint[src]

impl Hash for AlignConstraint[src]

impl IsA<ActorMeta> for AlignConstraint[src]

impl IsA<Constraint> for AlignConstraint[src]

impl IsA<InitiallyUnowned> for AlignConstraint[src]

impl Ord for AlignConstraint[src]

impl<T> PartialEq<T> for AlignConstraint where
    T: ObjectType
[src]

impl<T> PartialOrd<T> for AlignConstraint where
    T: ObjectType
[src]

impl StaticType for AlignConstraint[src]

Auto Trait Implementations

Blanket Implementations

impl<O> ActorMetaExt for O where
    O: IsA<ActorMeta>, 
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Fr, To> IntoColor<To> for Fr where
    To: FromColor<Fr>, 

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: SetValue + Send + ToValue + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,