pub struct GrowMode {
pub lo_x: bool,
pub lo_y: bool,
pub hi_x: bool,
pub hi_y: bool,
pub rel: bool,
pub fixed: bool,
}Expand description
Grow-mode flags — control how each edge of the view tracks its owner when the owner is resized.
Set the flags on ViewState::grow_mode before inserting a view into its owner.
The most common combinations are:
- Stay anchored to the bottom-right corner (e.g. a scrollbar thumb):
hi_x = true; hi_y = true - Fill the full width of the owner (e.g. a status bar):
hi_x = true— only the right edge tracks; the left stays fixed. - Fill the entire owner (e.g. a text viewer inside a window):
use
GrowMode::grow_all(). - Fixed size, just anchor to the right edge (e.g. a vertical scrollbar):
hi_x = true; fixed = true(or useWindow::standard_scroll_bar). - Desktop window, scales with the desktop:
hi_x = true; hi_y = true; rel = true— all edges scale proportionally.
§Turbo Vision heritage
Ports the gf* flag family (views.h) as a struct-of-bools (deviation D5);
each field names its gf* source.
Fields§
§lo_x: boolgfGrowLoX — the left edge tracks the owner’s right edge.
Uncommon alone; usually paired with hi_x when the view should slide
right with its owner rather than grow.
lo_y: boolgfGrowLoY — the top edge tracks the owner’s bottom edge.
Uncommon alone; usually paired with hi_y when the view should slide
down with its owner rather than grow.
hi_x: boolgfGrowHiX — the right edge tracks the owner’s right edge.
The most common flag: lets the view widen when its owner widens. Set alone for a view that stays left-anchored and grows to the right.
hi_y: boolgfGrowHiY — the bottom edge tracks the owner’s bottom edge.
Lets the view grow taller when its owner grows. Pair with hi_x for a
view that fills its owner’s interior (use GrowMode::grow_all()).
rel: boolgfGrowRel — grow proportionally to the owner (windows on the desktop).
When set, all active lo_*/hi_* edges scale as a fraction of the owner
size rather than by a fixed delta. Use for windows that should keep their
relative position when the terminal is resized.
fixed: boolgfFixed — the view keeps its size regardless of the owner’s resize.
The view moves to stay in the same relative position but does not change
its width or height. Combine with hi_x/hi_y to anchor to the
right/bottom edge while staying fixed-size (e.g. a scrollbar).
Implementations§
Trait Implementations§
impl Copy for GrowMode
impl Eq for GrowMode
impl StructuralPartialEq for GrowMode
Auto Trait Implementations§
impl Freeze for GrowMode
impl RefUnwindSafe for GrowMode
impl Send for GrowMode
impl Sync for GrowMode
impl Unpin for GrowMode
impl UnsafeUnpin for GrowMode
impl UnwindSafe for GrowMode
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.