[]Struct gtk::AspectFrame

pub struct AspectFrame(_, _);

The AspectFrame is useful when you want pack a widget so that it can resize but always retains the same aspect ratio. For instance, one might be drawing a small preview of a larger image. AspectFrame derives from Frame, so it can draw a label and a frame around the child. The frame will be “shrink-wrapped” to the size of the child.

CSS nodes

AspectFrame uses a CSS node with name frame.

Implements

AspectFrameExt, FrameExt, BinExt, ContainerExt, WidgetExt, glib::object::ObjectExt, BuildableExt, WidgetExtManual, BuildableExtManual

Implementations

impl AspectFrame[src]

pub fn new(
    label: Option<&str>,
    xalign: f32,
    yalign: f32,
    ratio: f32,
    obey_child: bool
) -> AspectFrame
[src]

Create a new AspectFrame.

label

Label text.

xalign

Horizontal alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)

yalign

Vertical alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned)

ratio

The desired aspect ratio.

obey_child

If true, ratio is ignored, and the aspect ratio is taken from the requistion of the child.

Returns

the new AspectFrame.

Trait Implementations

impl Clone for AspectFrame

impl Debug for AspectFrame

impl Display for AspectFrame[src]

impl Eq for AspectFrame

impl Hash for AspectFrame

impl IsA<Bin> for AspectFrame

impl IsA<Buildable> for AspectFrame

impl IsA<Container> for AspectFrame

impl IsA<Frame> for AspectFrame

impl IsA<Widget> for AspectFrame

impl Ord for AspectFrame

impl<T: ObjectType> PartialEq<T> for AspectFrame

impl<T: ObjectType> PartialOrd<T> for AspectFrame

impl StaticType for AspectFrame

Auto Trait Implementations

impl RefUnwindSafe for AspectFrame

impl !Send for AspectFrame

impl !Sync for AspectFrame

impl Unpin for AspectFrame

impl UnwindSafe for AspectFrame

Blanket Implementations

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>, 

impl<T> Cast for T where
    T: ObjectType, 

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

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

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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.