Skip to main content

vizia_core/views/
mod.rs

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