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