🚧 Code tweaks
This commit is contained in:
parent
b5fc06e84e
commit
928b3f91b6
6 changed files with 7 additions and 7 deletions
|
|
@ -22,7 +22,7 @@ impl ComponentTrait for Block {
|
||||||
fn setup_before_prepare(&mut self, _cx: &mut Context) {
|
fn setup_before_prepare(&mut self, _cx: &mut Context) {
|
||||||
self.alter_classes(
|
self.alter_classes(
|
||||||
ClassesOp::Prepend,
|
ClassesOp::Prepend,
|
||||||
[String::from("block__container"), self.style().to_string()].join(" "),
|
["block__container".to_string(), self.style().to_string()].join(" "),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ impl ComponentTrait for Button {
|
||||||
self.alter_classes(
|
self.alter_classes(
|
||||||
ClassesOp::Prepend,
|
ClassesOp::Prepend,
|
||||||
[
|
[
|
||||||
String::from("button__tap"),
|
"button__tap".to_string(),
|
||||||
self.style().to_string(),
|
self.style().to_string(),
|
||||||
self.font_size().to_string(),
|
self.font_size().to_string(),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ impl ComponentTrait for Container {
|
||||||
self.alter_classes(
|
self.alter_classes(
|
||||||
ClassesOp::Prepend,
|
ClassesOp::Prepend,
|
||||||
[
|
[
|
||||||
String::from("flex__container"),
|
"flex__container".to_string(),
|
||||||
self.direction().to_string(),
|
self.direction().to_string(),
|
||||||
self.wrap().to_string(),
|
self.wrap().to_string(),
|
||||||
self.justify().to_string(),
|
self.justify().to_string(),
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ impl ComponentTrait for Item {
|
||||||
self.alter_classes(
|
self.alter_classes(
|
||||||
ClassesOp::Prepend,
|
ClassesOp::Prepend,
|
||||||
[
|
[
|
||||||
String::from("flex__item"),
|
"flex__item".to_string(),
|
||||||
self.grow().to_string(),
|
self.grow().to_string(),
|
||||||
self.shrink().to_string(),
|
self.shrink().to_string(),
|
||||||
self.size().to_string(),
|
self.size().to_string(),
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ impl ComponentTrait for ActionButton {
|
||||||
self.alter_classes(
|
self.alter_classes(
|
||||||
ClassesOp::Prepend,
|
ClassesOp::Prepend,
|
||||||
[
|
[
|
||||||
String::from("button__tap"),
|
"button__tap".to_string(),
|
||||||
self.style().to_string(),
|
self.style().to_string(),
|
||||||
self.font_size().to_string(),
|
self.font_size().to_string(),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ impl TypeInfo {
|
||||||
.get(if start >= 0 {
|
.get(if start >= 0 {
|
||||||
start as usize
|
start as usize
|
||||||
} else {
|
} else {
|
||||||
segments.len() - start.abs() as usize
|
segments.len() - start.unsigned_abs()
|
||||||
})
|
})
|
||||||
.map_or(0, |&(s, _)| s);
|
.map_or(0, |&(s, _)| s);
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ impl TypeInfo {
|
||||||
if end >= 0 {
|
if end >= 0 {
|
||||||
end as usize
|
end as usize
|
||||||
} else {
|
} else {
|
||||||
segments.len() - end.abs() as usize
|
segments.len() - end.unsigned_abs()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
segments.len() - 1
|
segments.len() - 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue