mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 18:41:56 +03:00
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:
parent
32b59bfa0e
commit
8871fec2a8
@ -620,7 +620,7 @@ impl AssistantChat {
|
|||||||
div()
|
div()
|
||||||
.py_1()
|
.py_1()
|
||||||
.px_2()
|
.px_2()
|
||||||
.neg_mx_1()
|
.mx_neg_1()
|
||||||
.rounded_md()
|
.rounded_md()
|
||||||
.border_1()
|
.border_1()
|
||||||
.border_color(theme.status().error_border)
|
.border_color(theme.status().error_border)
|
||||||
|
@ -572,7 +572,7 @@ impl ChatPanel {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
self.render_popover_buttons(&cx, message_id, can_delete_message, can_edit_message)
|
self.render_popover_buttons(&cx, message_id, can_delete_message, can_edit_message)
|
||||||
.neg_mt_2p5(),
|
.mt_neg_2p5(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ impl RenderOnce for FacePile {
|
|||||||
.into_iter()
|
.into_iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.rev()
|
.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)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,16 +114,16 @@ fn generate_predefined_setter(
|
|||||||
negate: bool,
|
negate: bool,
|
||||||
doc_string: &str,
|
doc_string: &str,
|
||||||
) -> TokenStream2 {
|
) -> TokenStream2 {
|
||||||
let (negation_prefix, negation_token) = if negate {
|
let (negation_qualifier, negation_token) = if negate {
|
||||||
("neg_", quote! { - })
|
("_neg", quote! { - })
|
||||||
} else {
|
} else {
|
||||||
("", quote! {})
|
("", quote! {})
|
||||||
};
|
};
|
||||||
|
|
||||||
let method_name = if length.is_empty() {
|
let method_name = if length.is_empty() {
|
||||||
format_ident!("{}{}", negation_prefix, name)
|
format_ident!("{name}{negation_qualifier}")
|
||||||
} else {
|
} else {
|
||||||
format_ident!("{}{}_{}", negation_prefix, name, length)
|
format_ident!("{name}{negation_qualifier}_{length}")
|
||||||
};
|
};
|
||||||
|
|
||||||
let field_assignments = fields
|
let field_assignments = fields
|
||||||
|
@ -75,7 +75,7 @@ impl Render for PlayerStory {
|
|||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.relative()
|
.relative()
|
||||||
.neg_mx_1()
|
.mx_neg_1()
|
||||||
.rounded_full()
|
.rounded_full()
|
||||||
.border_2()
|
.border_2()
|
||||||
.border_color(player.background)
|
.border_color(player.background)
|
||||||
@ -90,7 +90,7 @@ impl Render for PlayerStory {
|
|||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.relative()
|
.relative()
|
||||||
.neg_mx_1()
|
.mx_neg_1()
|
||||||
.rounded_full()
|
.rounded_full()
|
||||||
.border_2()
|
.border_2()
|
||||||
.border_color(player.background)
|
.border_color(player.background)
|
||||||
@ -105,7 +105,7 @@ impl Render for PlayerStory {
|
|||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.relative()
|
.relative()
|
||||||
.neg_mx_1()
|
.mx_neg_1()
|
||||||
.rounded_full()
|
.rounded_full()
|
||||||
.border_2()
|
.border_2()
|
||||||
.border_color(player.background)
|
.border_color(player.background)
|
||||||
|
@ -396,8 +396,8 @@ impl RenderOnce for IconWithIndicator {
|
|||||||
.border_1()
|
.border_1()
|
||||||
.border_color(indicator_border_color)
|
.border_color(indicator_border_color)
|
||||||
.rounded_full()
|
.rounded_full()
|
||||||
.neg_bottom_0p5()
|
.bottom_neg_0p5()
|
||||||
.neg_right_1()
|
.right_neg_1()
|
||||||
.child(indicator),
|
.child(indicator),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user