zng/
rule_line.rs

1#![cfg(feature = "rule_line")]
2
3//! Rule line widgets and properties.
4//!
5//! A rule line is a horizontal or vertical separator line, this module provides 3 widgets the [`RuleLine!`](struct@RuleLine)
6//! base that can dynamically change orientation and the [`hr::Hr!`](struct@hr::Hr) and [`vr::Vr!`](struct@vr::Vr) that represents
7//! each orientation and can be styled separately.
8//!
9//! ```
10//! use zng::prelude::*;
11//! # fn demo() {
12//!
13//! # let _ =
14//! Window! {
15//!     context_menu = ContextMenu!(ui_vec![
16//!         Button!(zng::app::NEW_CMD.scoped(WINDOW.id())),
17//!         Button!(zng::app::OPEN_CMD.scoped(WINDOW.id())),
18//!         Hr!(),
19//!         Button!(zng::app::EXIT_CMD),
20//!     ]);
21//! }
22//! # ; }
23//! ```
24//!
25//! The example above uses the `Hr!` widget in a context menu to separate the commands into two groups.
26//!
27//! # Full API
28//!
29//! See [`zng_wgt_rule_line`] for the full widget API.
30
31pub use zng_wgt_rule_line::RuleLine;
32
33/// Horizontal rule line widget and properties.
34pub mod hr {
35    pub use zng_wgt_rule_line::hr::{Hr, color, line_style, margin, stroke_thickness};
36}
37
38/// Vertical rule line widget and properties.
39pub mod vr {
40    pub use zng_wgt_rule_line::vr::{Vr, color, line_style, margin, stroke_thickness};
41}