expose OverflowAxis::Hidden as Overflow functions (#17528)

# Objective
expose `OverflowAxis::Hidden` as functions of `Overflow`, just as it is
done for `OverflowAxis::Hidden` and `OverflowAxis::Scroll`.
This commit is contained in:
Luc 2025-01-28 06:34:50 +01:00 committed by GitHub
parent 203d0b4aae
commit 51bb4f08a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1064,6 +1064,30 @@ impl Overflow {
}
}
/// Hide overflowing items on both axes by influencing layout and then clipping
pub const fn hidden() -> Self {
Self {
x: OverflowAxis::Hidden,
y: OverflowAxis::Hidden,
}
}
/// Hide overflowing items on the x axis by influencing layout and then clipping
pub const fn hidden_x() -> Self {
Self {
x: OverflowAxis::Hidden,
y: OverflowAxis::Visible,
}
}
/// Hide overflowing items on the y axis by influencing layout and then clipping
pub const fn hidden_y() -> Self {
Self {
x: OverflowAxis::Visible,
y: OverflowAxis::Hidden,
}
}
/// Overflow is visible on both axes
pub const fn is_visible(&self) -> bool {
self.x.is_visible() && self.y.is_visible()