pub struct Esc {
pub border_radius: f32,
pub shadow_size: f32,
pub shadow_color: Option<[f32; 4]>,
pub opacity: f32,
pub border_width: f32,
pub border_color: Option<[f32; 4]>,
}Expand description
ESC (Extra Style Controls) — opcjonalne dodatkowe właściwości wizualne Niezależny od motywu, nałożony na widget jako warstwa nadpisująca
Fields§
§border_radius: f32§shadow_size: f32§shadow_color: Option<[f32; 4]>§opacity: f32§border_width: f32§border_color: Option<[f32; 4]>Implementations§
Source§impl Esc
impl Esc
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
example/example.rs (line 17)
6fn main() {
7 let app = App::new(
8 AppConfig {
9 title: "CosG — Hello".into(),
10 width: 640,
11 height: 480,
12 theme: Theme::violet_dark(),
13 },
14 || {
15 let btn = Button::new()
16 .label("Kliknij mnie")
17 .esc(Esc::new().border_radius(12.0).opacity(1.0))
18 .on_press(|| println!("pressed!"));
19
20 let lbl = Label::new("CosG UI");
21
22 Box::new(
23 Container::new()
24 .padding(24.0)
25 .esc(Esc::new().border_radius(0.0))
26 .add(lbl)
27 .add(btn),
28 )
29 },
30 );
31
32 app.run();
33}Sourcepub fn border_radius(self, v: f32) -> Self
pub fn border_radius(self, v: f32) -> Self
Examples found in repository?
example/example.rs (line 17)
6fn main() {
7 let app = App::new(
8 AppConfig {
9 title: "CosG — Hello".into(),
10 width: 640,
11 height: 480,
12 theme: Theme::violet_dark(),
13 },
14 || {
15 let btn = Button::new()
16 .label("Kliknij mnie")
17 .esc(Esc::new().border_radius(12.0).opacity(1.0))
18 .on_press(|| println!("pressed!"));
19
20 let lbl = Label::new("CosG UI");
21
22 Box::new(
23 Container::new()
24 .padding(24.0)
25 .esc(Esc::new().border_radius(0.0))
26 .add(lbl)
27 .add(btn),
28 )
29 },
30 );
31
32 app.run();
33}pub fn shadow(self, v: f32) -> Self
pub fn shadow_color(self, c: [f32; 4]) -> Self
Sourcepub fn opacity(self, v: f32) -> Self
pub fn opacity(self, v: f32) -> Self
Examples found in repository?
example/example.rs (line 17)
6fn main() {
7 let app = App::new(
8 AppConfig {
9 title: "CosG — Hello".into(),
10 width: 640,
11 height: 480,
12 theme: Theme::violet_dark(),
13 },
14 || {
15 let btn = Button::new()
16 .label("Kliknij mnie")
17 .esc(Esc::new().border_radius(12.0).opacity(1.0))
18 .on_press(|| println!("pressed!"));
19
20 let lbl = Label::new("CosG UI");
21
22 Box::new(
23 Container::new()
24 .padding(24.0)
25 .esc(Esc::new().border_radius(0.0))
26 .add(lbl)
27 .add(btn),
28 )
29 },
30 );
31
32 app.run();
33}pub fn border_width(self, v: f32) -> Self
pub fn border_color(self, c: [f32; 4]) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Esc
impl RefUnwindSafe for Esc
impl Send for Esc
impl Sync for Esc
impl Unpin for Esc
impl UnsafeUnpin for Esc
impl UnwindSafe for Esc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more