MCPcopy Create free account
hub / github.com/algoscienceacademy/RustUI / new

Method new

src/components/button.rs:18–27  ·  view source on GitHub ↗
(label: S)

Source from the content-addressed store, hash-verified

16
17impl Button {
18 pub fn new<S: Into<String>>(label: S) -> Self {
19 Self {
20 label: label.into(),
21 style: Style::default()
22 .set_background(Color::rgb(0.2, 0.2, 0.2))
23 .set_padding(10.0),
24 bounds: Rect::default(),
25 on_click: None,
26 }
27 }
28
29 pub fn with_style(mut self, style: Style) -> Self {
30 self.style = style;

Callers

nothing calls this directly

Calls 2

set_paddingMethod · 0.80
set_backgroundMethod · 0.80

Tested by

no test coverage detected