mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-14 21:23:08 +00:00
28 lines
622 B
Rust
28 lines
622 B
Rust
use std::ops::Deref;
|
|
|
|
/// Specifies how some borders should be drawn.
|
|
///
|
|
/// Borders are used around Dialogs, select popups, and panels.
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
|
pub enum BorderStyle {
|
|
/// Simple borders.
|
|
Simple,
|
|
/// Outset borders with a simple 3d effect.
|
|
Outset,
|
|
/// No borders.
|
|
None,
|
|
}
|
|
|
|
impl<S: Deref<Target = String>> From<S> for BorderStyle {
|
|
fn from(s: S) -> Self {
|
|
if &*s == "simple" {
|
|
BorderStyle::Simple
|
|
} else if &*s == "outset" {
|
|
BorderStyle::Outset
|
|
} else {
|
|
BorderStyle::None
|
|
}
|
|
}
|
|
}
|
|
|