vizia_core/views/
mod.rs

1//! Built-in views provided by vizia.
2
3mod avatar;
4mod badge;
5mod button;
6mod checkbox;
7mod chip;
8mod collapsible;
9mod combobox;
10mod datepicker;
11mod divider;
12mod dropdown;
13mod element;
14mod grid;
15mod image;
16mod knob;
17mod label;
18mod list;
19mod markdown;
20mod menu;
21mod picklist;
22mod popup;
23mod progressbar;
24mod radio;
25mod rating;
26mod scrollbar;
27mod scrollview;
28mod slider;
29mod spinbox;
30mod stack;
31mod switch;
32mod tabview;
33mod textbox;
34mod toggle_button;
35mod tooltip;
36mod virtual_list;
37mod xypad;
38
39pub use crate::binding::Binding;
40pub use avatar::*;
41pub use badge::*;
42pub use button::*;
43pub use checkbox::*;
44pub use chip::*;
45pub use collapsible::*;
46pub use combobox::*;
47pub use datepicker::*;
48pub use divider::*;
49pub use dropdown::*;
50pub use element::*;
51pub use grid::*;
52pub use image::*;
53pub use knob::*;
54pub use label::*;
55pub use list::*;
56#[cfg(feature = "markdown")]
57pub use markdown::*;
58pub use menu::*;
59pub use picklist::*;
60pub use popup::*;
61pub use progressbar::*;
62pub use radio::*;
63pub use rating::*;
64pub use scrollbar::*;
65pub use scrollview::*;
66pub use slider::*;
67pub use spinbox::*;
68pub use stack::*;
69pub use switch::*;
70pub use tabview::*;
71pub use textbox::*;
72pub use toggle_button::*;
73pub use tooltip::*;
74pub use virtual_list::*;
75pub use xypad::*;
76
77use crate::prelude::*;
78
79/// The orientation of a widget, such as a slider or scrollbar
80#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Data)]
81pub enum Orientation {
82    #[default]
83    /// A horizontal orientation.
84    Horizontal,
85    /// A vertical orientation.
86    Vertical,
87}
88
89impl_res_simple!(Orientation);
90
91/// Describes the placement of a view relative to its parent element.
92#[derive(Debug, Clone, Copy, Data, PartialEq, Eq)]
93pub enum Placement {
94    /// The view should be placed above its parent with its left edge aligned with the left edge of its parent.
95    TopStart,
96    /// The view should be placed above its parent with its center aligned with the center of its parent.
97    Top,
98    /// The view should be placed above its parent with its right edge aligned with the right edge of its parent.
99    TopEnd,
100    /// The view should be placed below its parent with its left edge aligned with the left edge of its parent.
101    BottomStart,
102    /// The view should be placed below its parent with its center aligned with the center of its parent.
103    Bottom,
104    /// The view should be placed below its parent with its right edge aligned with the right edge of its parent.
105    BottomEnd,
106    /// The view should be placed to the right of its parent with its top edge aligned with the top edge of its parent.
107    RightStart,
108    /// The view should be placed to the right of its parent with its center aligned with the center of its parent.
109    Right,
110    /// The view should be placed to the right of its parent with its bottom edge aligned with the bottom edge of its parent.
111    RightEnd,
112    /// The view should be placed to the left of its parent with its top edge aligned with the top edge of its parent.
113    LeftStart,
114    /// The view should be placed to the left of its parent with its center aligned with the center of its parent.
115    Left,
116    /// The view should be placed to the left of its parent with its bottom edge aligned with the bottom edge of its parent.
117    LeftEnd,
118    /// The view should be placed over its parent.
119    Over,
120    /// The view should follow the cursor.
121    Cursor,
122}
123
124impl_res_simple!(Placement);