1//! `widgets` is a collection of types that implement [`Widget`].
3//! All widgets are implemented using the builder pattern and are consumable objects. They are not
4//! meant to be stored but used as *commands* to draw common figures in the UI.
6//! The available widgets are:
18pub use self::block::{Block, BorderType};
19// pub use self::list::{List, ListItem, ListState};
20pub use self::paragraph::{Paragraph, Wrap};
21pub use self::table::{Cell, Row, Table, TableState};
23use crate::buffer::Buffer;
24use bitflags::bitflags;
26use helix_view::graphics::Rect;
29 /// Bitflags that can be composed to set the visible borders essentially on the block widget.
30 pub struct Borders: u32 {
31 /// Show no border (default)
32 const NONE = 0b0000_0001;
33 /// Show the top border
34 const TOP = 0b0000_0010;
35 /// Show the right border
36 const RIGHT = 0b0000_0100;
37 /// Show the bottom border
38 const BOTTOM = 0b000_1000;
39 /// Show the left border
40 const LEFT = 0b0001_0000;
42 const ALL = Self::TOP.bits | Self::RIGHT.bits | Self::BOTTOM.bits | Self::LEFT.bits;
46/// Base requirements for a Widget
48 /// Draws the current state of the widget in the given buffer. That the only method required to
49 /// implement a custom widget.
50 fn render(self, area: Rect, buf: &mut Buffer);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list