retroglyph-ui 0.5.1

Immediate-mode terminal UI toolkit for retroglyph: widgets, layout, input/focus, theming, and animation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! [`ListDirection`]: which end of a [`List`](super::List)'s area its items render from.

/// Which end of a [`List`](super::List)'s area its items render from.
///
/// [`ListDirection::TopToBottom`] is the default: `items[state.offset()]` draws at the top row
/// and later items draw downward, the list's only behavior before this type existed.
/// [`ListDirection::BottomToTop`] draws the same window from the bottom of the area instead:
/// `items[state.offset()]` draws at the bottom row and later items draw upward, for a
/// chat/log-style list that grows toward the top.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum ListDirection {
    /// `items[state.offset()]` draws at the top of the area; later items draw downward.
    #[default]
    TopToBottom,
    /// `items[state.offset()]` draws at the bottom of the area; later items draw upward.
    BottomToTop,
}