pub enum BorderStyle {
None,
Preset {
kind: BorderKind,
bg: Option<Color>,
fg: Option<Color>,
},
Custom(CustomStyleFn, Thickness),
}Variants§
Implementations§
Source§impl BorderStyle
impl BorderStyle
Sourcepub const fn new(kind: BorderKind, bg: Option<Color>, fg: Option<Color>) -> Self
pub const fn new(kind: BorderKind, bg: Option<Color>, fg: Option<Color>) -> Self
Examples found in repository?
examples/scrollviewer.rs (line 67)
53 fn default() -> Self {
54 let values = [
55 "Tomatoes",
56 "Tofu",
57 "Flatbread",
58 "Olive oil",
59 "Salt",
60 "Oregano",
61 "Butter",
62 ];
63
64 let scrollviewer = WindowFactory::create::<ScrollViewer>();
65 scrollviewer
66 .borrow_mut()
67 .set_border(BorderStyle::new(BorderKind::Solid, None, None));
68 let stackpanel = WindowFactory::create::<Stackpanel>();
69 for v in values {
70 let cbx = WindowFactory::create::<TextCheckbox>();
71 cbx.borrow_mut().set_text(v);
72 stackpanel.borrow_mut().add_item(cbx);
73 }
74 ScrollViewer::set_content(
75 &scrollviewer,
76 Some(&(stackpanel as Rc<RefCell<dyn Scrollable>>)),
77 );
78
79 Self {
80 uid: WindowUID::new(),
81 scrollviewer,
82 running: true,
83 }
84 }More examples
examples/dockpanel.rs (line 49)
30 fn default() -> Self {
31 let label = WindowFactory::create::<Label>();
32 label.borrow_mut().set_text("Lorem ipsum");
33 let label2 = WindowFactory::create::<Label>();
34 label2.borrow_mut().set_text("Bibsum loram");
35 let label3 = WindowFactory::create::<Label>();
36 label3.borrow_mut().set_text("Epsum larel");
37 let label4 = WindowFactory::create::<Label>();
38 label4.borrow_mut().set_text("Ipsel Aarel");
39 let input = WindowFactory::create::<Textbox>();
40
41 let dockpanel = WindowFactory::create::<DockPanel>();
42 {
43 let mut brw = dockpanel.borrow_mut();
44 brw.set_child(DockAlignment::Center, Some(input));
45 brw.set_child(DockAlignment::Top, Some(label));
46 brw.set_child(DockAlignment::Right, Some(label2));
47 brw.set_child(DockAlignment::Left, Some(label3));
48 brw.set_child(DockAlignment::Bottom, Some(label4));
49 brw.set_border(BorderStyle::new(BorderKind::Dashed, None, None));
50 brw.set_inner_border(true);
51 }
52
53 Self {
54 uid: WindowUID::new(),
55 dockpanel,
56 running: true,
57 }
58 }Sourcepub const fn custom(f: CustomStyleFn, thickness: Thickness) -> Self
pub const fn custom(f: CustomStyleFn, thickness: Thickness) -> Self
Use a custom callback to render the border
pub const fn thickness(&self) -> Thickness
pub const fn get_borderkind(&self) -> Option<BorderKind>
Trait Implementations§
Source§impl Clone for BorderStyle
impl Clone for BorderStyle
Source§fn clone(&self) -> BorderStyle
fn clone(&self) -> BorderStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BorderStyle
Source§impl Debug for BorderStyle
impl Debug for BorderStyle
Source§impl Default for BorderStyle
impl Default for BorderStyle
Source§fn default() -> BorderStyle
fn default() -> BorderStyle
Returns the “default value” for a type. Read more
Source§impl From<BorderKind> for BorderStyle
impl From<BorderKind> for BorderStyle
Source§fn from(value: BorderKind) -> Self
fn from(value: BorderKind) -> Self
Converts to this type from the input type.
Source§impl From<fn(&(dyn Window + 'static), BorderCanvas<'_>)> for BorderStyle
impl From<fn(&(dyn Window + 'static), BorderCanvas<'_>)> for BorderStyle
Source§fn from(value: CustomStyleFn) -> Self
fn from(value: CustomStyleFn) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for BorderStyle
impl RefUnwindSafe for BorderStyle
impl Send for BorderStyle
impl Sync for BorderStyle
impl Unpin for BorderStyle
impl UnsafeUnpin for BorderStyle
impl UnwindSafe for BorderStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more