retroglyph_ui/widget/list_direction.rs
1//! [`ListDirection`]: which end of a [`List`](super::List)'s area its items render from.
2
3/// Which end of a [`List`](super::List)'s area its items render from.
4///
5/// [`ListDirection::TopToBottom`] is the default: `items[state.offset()]` draws at the top row
6/// and later items draw downward, the list's only behavior before this type existed.
7/// [`ListDirection::BottomToTop`] draws the same window from the bottom of the area instead:
8/// `items[state.offset()]` draws at the bottom row and later items draw upward, for a
9/// chat/log-style list that grows toward the top.
10#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
11#[non_exhaustive]
12pub enum ListDirection {
13 /// `items[state.offset()]` draws at the top of the area; later items draw downward.
14 #[default]
15 TopToBottom,
16 /// `items[state.offset()]` draws at the bottom of the area; later items draw upward.
17 BottomToTop,
18}