kas_widgets/
lib.rs

1// Licensed under the Apache License, Version 2.0 (the "License");
2// you may not use this file except in compliance with the License.
3// You may obtain a copy of the License in the LICENSE-APACHE file or at:
4//     https://www.apache.org/licenses/LICENSE-2.0
5
6//! KAS widget library
7//!
8//! ## Complex widgets
9//!
10//! -   [`EventConfig`] provides an editor for event configuration
11//! -   [`kas::Window`] is the root of any UI tree used as a window
12//! -   [`kas::Popup`] is the root of any popup
13//!
14//! ## Sub-modules
15//!
16//! -   [`adapt`] provides [`Adapt`], [`AdaptWidget`], [`AdaptWidgetAny`] and supporting items
17//!     (the items mentioned are re-export here).
18//! -   [`dialog`] provides [`MessageBox`](dialog::MessageBox), ...
19//! -   [`edit`] provides [`EditBox`], [`EditField`] widgets, [`EditGuard`] trait and some impls
20//! -   [`menu`] provides a [`MenuBar`](menu::MenuBar), [`SubMenu`](menu::SubMenu), ...
21//!
22//! ## Container widgets
23//!
24//! -   [`Frame`], [`NavFrame`]: frames around content
25//! -   [`ScrollRegion`], [`ScrollBarRegion`]: larger on the inside
26//! -   [`Stack`], [`TabStack`]: a stack of widgets in the same rect
27//! -   [`List`]: a row / column of children
28//! -   [`Splitter`]: like [`List`] but with resizing handles
29//! -   [`Grid`]: a container using matrix layout
30//!
31//! ## Controls
32//!
33//! -   [`Button`], [`MarkButton`]: button widgets
34//! -   [`CheckBox`], [`CheckButton`]: checkable boxes
35//! -   [`RadioBox`], [`RadioButton`]: linked checkable boxes
36//! -   [`ComboBox`]: a drop-down menu over a list
37//! -   [`ScrollBar`]: a scroll bar; [`ScrollBars`]: a wrapper adding scroll
38//!     bars around an inner widget
39//! -   [`Slider`]: a slider
40//! -   [`Spinner`]: numeric entry
41//!
42//! ## Displays
43//!
44//! -   [`Filler`]: an empty widget, sometimes used to fill space
45//! -   [`Image`]: a pixmap image
46//! -   [`Label`], [`AccessLabel`]: are static text labels
47//! -   [`Text`]: a dynamic (input-data derived) text label
48//! -   [`Mark`]: a small mark
49//! -   [`ScrollLabel`]: static text label supporting scrolling and selection
50//! -   [`ScrollText`]: dynamic text label supporting scrolling and selection
51//! -   [`Separator`]: a visible bar to separate things
52//! -   [`format_value`] and [`format_data`] are constructors for [`Text`],
53//!     displaying a text label derived from input data
54//! -   [`ProgressBar`]: show completion level
55//!
56//! ## Components
57//!
58//! -   [`AccessLabel`]: a label which parses access keys
59//! -   [`GripPart`]: a handle (e.g. for a slider, splitter or scroll_bar)
60
61#![cfg_attr(docsrs, feature(doc_auto_cfg))]
62#![cfg_attr(feature = "min_spec", feature(min_specialization))]
63
64pub mod adapt;
65#[doc(no_inline)]
66pub use adapt::{Adapt, AdaptWidget, AdaptWidgetAny};
67
68mod button;
69mod check_box;
70mod combobox;
71pub mod dialog;
72pub mod edit;
73mod event_config;
74mod filler;
75mod frame;
76mod grid;
77mod grip;
78mod image;
79mod label;
80mod list;
81mod mark;
82pub mod menu;
83mod nav_frame;
84mod progress;
85mod radio_box;
86mod scroll;
87mod scroll_bar;
88mod scroll_label;
89mod scroll_text;
90mod separator;
91mod slider;
92mod spinner;
93mod splitter;
94mod stack;
95mod tab_stack;
96mod text;
97
98pub use kas_macros::{aligned_column, aligned_row, column, float, grid, list, row};
99
100pub use crate::image::Image;
101#[cfg(feature = "image")] pub use crate::image::ImageError;
102pub use button::Button;
103pub use check_box::{CheckBox, CheckButton};
104pub use combobox::ComboBox;
105pub use edit::{EditBox, EditField, EditGuard};
106pub use event_config::EventConfig;
107pub use filler::Filler;
108pub use frame::Frame;
109pub use grid::Grid;
110pub use grip::{GripMsg, GripPart};
111pub use label::{AccessLabel, Label};
112pub use list::*;
113pub use mark::{Mark, MarkButton};
114pub use nav_frame::NavFrame;
115pub use progress::ProgressBar;
116pub use radio_box::{RadioBox, RadioButton};
117pub use scroll::ScrollRegion;
118pub use scroll_bar::{ScrollBar, ScrollBarRegion, ScrollBars, ScrollMsg};
119pub use scroll_label::ScrollLabel;
120pub use scroll_text::ScrollText;
121pub use separator::Separator;
122pub use slider::{Slider, SliderValue};
123pub use spinner::{Spinner, SpinnerValue};
124pub use splitter::Splitter;
125pub use stack::{BoxStack, Stack};
126pub use tab_stack::{BoxTabStack, Tab, TabStack};
127pub use text::Text;