Struct wayland_protocols::unstable::xdg_shell::v6::client::zxdg_positioner_v6::ConstraintAdjustment [−][src]
pub struct ConstraintAdjustment { /* fields omitted */ }
constraint adjustments
The constraint adjustment value define ways the compositor will adjust the position of the surface, if the unadjusted position would result in the surface being partly constrained.
Whether a surface is considered ‘constrained’ is left to the compositor to determine. For example, the surface may be partly outside the compositor’s defined ‘work area’, thus necessitating the child surface’s position be adjusted until it is entirely inside the work area.
The adjustments can be combined, according to a defined precedence: 1) Flip, 2) Slide, 3) Resize.
Implementations
impl ConstraintAdjustment
[src][−]
pub const None: ConstraintAdjustment
[src][−][−]
don’t move the child surface when constrained
Don’t alter the surface position even if it is constrained on some axis, for example partially outside the edge of a monitor.
pub const SlideX: ConstraintAdjustment
[src][−][−]
move along the x axis until unconstrained
Slide the surface along the x axis until it is no longer constrained.
First try to slide towards the direction of the gravity on the x axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.
Then try to slide towards the opposite direction of the gravity on the x axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.
pub const SlideY: ConstraintAdjustment
[src][−][−]
move along the y axis until unconstrained
Slide the surface along the y axis until it is no longer constrained.
First try to slide towards the direction of the gravity on the y axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.
Then try to slide towards the opposite direction of the gravity on the y axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.
pub const FlipX: ConstraintAdjustment
[src][−][−]
invert the anchor and gravity on the x axis
Invert the anchor and gravity on the x axis if the surface is constrained on the x axis. For example, if the left edge of the surface is constrained, the gravity is ‘left’ and the anchor is ‘left’, change the gravity to ‘right’ and the anchor to ‘right’.
If the adjusted position also ends up being constrained, the resulting position of the flip_x adjustment will be the one before the adjustment.
pub const FlipY: ConstraintAdjustment
[src][−][−]
invert the anchor and gravity on the y axis
Invert the anchor and gravity on the y axis if the surface is constrained on the y axis. For example, if the bottom edge of the surface is constrained, the gravity is ‘bottom’ and the anchor is ‘bottom’, change the gravity to ‘top’ and the anchor to ‘top’.
If the adjusted position also ends up being constrained, the resulting position of the flip_y adjustment will be the one before the adjustment.
pub const ResizeX: ConstraintAdjustment
[src][−][−]
horizontally resize the surface
Resize the surface horizontally so that it is completely unconstrained.
pub const ResizeY: ConstraintAdjustment
[src][−][−]
vertically resize the surface
Resize the surface vertically so that it is completely unconstrained.
pub const fn empty() -> ConstraintAdjustment
[src][−]
Returns an empty set of flags
pub const fn all() -> ConstraintAdjustment
[src][−]
Returns the set containing all flags.
pub const fn bits(&self) -> u32
[src][−]
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u32) -> Option<ConstraintAdjustment>
[src][−]
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub const fn from_bits_truncate(bits: u32) -> ConstraintAdjustment
[src][−]
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u32) -> ConstraintAdjustment
[src][−]
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const fn is_empty(&self) -> bool
[src][−]
Returns true
if no flags are currently stored.
pub const fn is_all(&self) -> bool
[src][−]
Returns true
if all flags are currently set.
pub const fn intersects(&self, other: ConstraintAdjustment) -> bool
[src][−]
Returns true
if there are flags common to both self
and other
.
pub const fn contains(&self, other: ConstraintAdjustment) -> bool
[src][−]
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: ConstraintAdjustment)
[src][−]
Inserts the specified flags in-place.
pub fn remove(&mut self, other: ConstraintAdjustment)
[src][−]
Removes the specified flags in-place.
pub fn toggle(&mut self, other: ConstraintAdjustment)
[src][−]
Toggles the specified flags in-place.
pub fn set(&mut self, other: ConstraintAdjustment, value: bool)
[src][−]
Inserts or removes the specified flags depending on the passed value.
impl ConstraintAdjustment
[src][−]
Trait Implementations
impl Binary for ConstraintAdjustment
[src][+]
impl BitAnd<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl BitAndAssign<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl BitOr<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl BitOrAssign<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl BitXor<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl BitXorAssign<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl Clone for ConstraintAdjustment
[src][+]
impl Copy for ConstraintAdjustment
[src]
impl Debug for ConstraintAdjustment
[src][+]
impl Eq for ConstraintAdjustment
[src]
impl Extend<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl FromIterator<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl Hash for ConstraintAdjustment
[src][+]
impl LowerHex for ConstraintAdjustment
[src][+]
impl Not for ConstraintAdjustment
[src][+]
impl Octal for ConstraintAdjustment
[src][+]
impl Ord for ConstraintAdjustment
[src][+]
impl PartialEq<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl PartialOrd<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl StructuralEq for ConstraintAdjustment
[src]
impl StructuralPartialEq for ConstraintAdjustment
[src]
impl Sub<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl SubAssign<ConstraintAdjustment> for ConstraintAdjustment
[src][+]
impl UpperHex for ConstraintAdjustment
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for ConstraintAdjustment
impl Send for ConstraintAdjustment
impl Sync for ConstraintAdjustment
impl Unpin for ConstraintAdjustment
impl UnwindSafe for ConstraintAdjustment
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,