Make border methods always require an explicit width (#11450)
This PR makes the `border` methods require an explicit width instead of
defaulting to 1px.
This breaks convention with Tailwind, but it makes GPUI more consistent
with itself. We already have an edge case where the parameterized method
had to be named `border_width`, since `border` was taken up by an alias
for the 1px variant.
### Before
```rs
div()
.border()
.border_t()
.border_r()
.border_b()
.border_l()
.border_width(px(7.))
```
### After
```rs
div()
.border_1()
.border_t_1()
.border_r_1()
.border_b_1()
.border_l_1()
.border(px(7.))
```
Release Notes:
- N/A
This commit is contained in:
@@ -623,9 +623,9 @@ impl Render for Dock {
|
||||
Axis::Vertical => this.h(size).w_full().flex_col(),
|
||||
})
|
||||
.map(|this| match self.position() {
|
||||
DockPosition::Left => this.border_r(),
|
||||
DockPosition::Right => this.border_l(),
|
||||
DockPosition::Bottom => this.border_t(),
|
||||
DockPosition::Left => this.border_r_1(),
|
||||
DockPosition::Right => this.border_l_1(),
|
||||
DockPosition::Bottom => this.border_t_1(),
|
||||
})
|
||||
.child(
|
||||
div()
|
||||
|
||||
@@ -100,7 +100,7 @@ impl Render for Toolbar {
|
||||
.when(has_left_items || has_right_items, |this| {
|
||||
this.gap(Spacing::Large.rems(cx))
|
||||
})
|
||||
.border_b()
|
||||
.border_b_1()
|
||||
.border_color(cx.theme().colors().border_variant)
|
||||
.bg(cx.theme().colors().toolbar_background)
|
||||
.child(
|
||||
|
||||
@@ -4123,8 +4123,8 @@ impl Render for Workspace {
|
||||
.flex()
|
||||
.flex_col()
|
||||
.overflow_hidden()
|
||||
.border_t()
|
||||
.border_b()
|
||||
.border_t_1()
|
||||
.border_b_1()
|
||||
.border_color(colors.border)
|
||||
.child({
|
||||
let this = cx.view().clone();
|
||||
@@ -4230,10 +4230,10 @@ impl Render for Workspace {
|
||||
.shadow_lg();
|
||||
|
||||
Some(match self.zoomed_position {
|
||||
Some(DockPosition::Left) => div.right_2().border_r(),
|
||||
Some(DockPosition::Right) => div.left_2().border_l(),
|
||||
Some(DockPosition::Bottom) => div.top_2().border_t(),
|
||||
None => div.top_2().bottom_2().left_2().right_2().border(),
|
||||
Some(DockPosition::Left) => div.right_2().border_r_1(),
|
||||
Some(DockPosition::Right) => div.left_2().border_l_1(),
|
||||
Some(DockPosition::Bottom) => div.top_2().border_t_1(),
|
||||
None => div.top_2().bottom_2().left_2().right_2().border_1(),
|
||||
})
|
||||
}))
|
||||
.child(self.modal_layer.clone())
|
||||
|
||||
Reference in New Issue
Block a user