Adjust names of negated style methods (#11453)

This PR adjusts the names of the negated style methods by moving the
`neg_` to after the property name instead of before.

This will help keep related style methods grouped together in
completions.

It also makes it a bit clearer that the negation applies to the value.

### Before

```rs
div()
    .neg_mx_1()
    .neg_mt_2()
```

### After

```rs
div()
    .mx_neg_1()
    .mt_neg_2()
```

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-05-06 13:56:25 -04:00 committed by GitHub
parent 32b59bfa0e
commit 8871fec2a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12 additions and 12 deletions

View File

@ -620,7 +620,7 @@ impl AssistantChat {
div()
.py_1()
.px_2()
.neg_mx_1()
.mx_neg_1()
.rounded_md()
.border_1()
.border_color(theme.status().error_border)

View File

@ -572,7 +572,7 @@ impl ChatPanel {
)
.child(
self.render_popover_buttons(&cx, message_id, can_delete_message, can_edit_message)
.neg_mt_2p5(),
.mt_neg_2p5(),
)
}

View File

@ -31,7 +31,7 @@ impl RenderOnce for FacePile {
.into_iter()
.enumerate()
.rev()
.map(|(ix, player)| div().when(ix > 0, |div| div.neg_ml_1()).child(player)),
.map(|(ix, player)| div().when(ix > 0, |div| div.ml_neg_1()).child(player)),
)
}
}

View File

@ -114,16 +114,16 @@ fn generate_predefined_setter(
negate: bool,
doc_string: &str,
) -> TokenStream2 {
let (negation_prefix, negation_token) = if negate {
("neg_", quote! { - })
let (negation_qualifier, negation_token) = if negate {
("_neg", quote! { - })
} else {
("", quote! {})
};
let method_name = if length.is_empty() {
format_ident!("{}{}", negation_prefix, name)
format_ident!("{name}{negation_qualifier}")
} else {
format_ident!("{}{}_{}", negation_prefix, name, length)
format_ident!("{name}{negation_qualifier}_{length}")
};
let field_assignments = fields

View File

@ -75,7 +75,7 @@ impl Render for PlayerStory {
.child(
div()
.relative()
.neg_mx_1()
.mx_neg_1()
.rounded_full()
.border_2()
.border_color(player.background)
@ -90,7 +90,7 @@ impl Render for PlayerStory {
.child(
div()
.relative()
.neg_mx_1()
.mx_neg_1()
.rounded_full()
.border_2()
.border_color(player.background)
@ -105,7 +105,7 @@ impl Render for PlayerStory {
.child(
div()
.relative()
.neg_mx_1()
.mx_neg_1()
.rounded_full()
.border_2()
.border_color(player.background)

View File

@ -396,8 +396,8 @@ impl RenderOnce for IconWithIndicator {
.border_1()
.border_color(indicator_border_color)
.rounded_full()
.neg_bottom_0p5()
.neg_right_1()
.bottom_neg_0p5()
.right_neg_1()
.child(indicator),
)
})