Fix double borders in mode buttons.
Co-authored-by: Kyle <kyle@zed.dev>
This commit is contained in:
parent
7314456685
commit
d17aba4fd3
2 changed files with 8 additions and 8 deletions
|
@ -51,15 +51,16 @@ impl SearchMode {
|
|||
|
||||
pub(crate) fn border_right(&self) -> bool {
|
||||
match self {
|
||||
SearchMode::Text => false,
|
||||
_ => true,
|
||||
SearchMode::Regex => true,
|
||||
SearchMode::Text => true,
|
||||
SearchMode::Semantic => true,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn border_left(&self) -> bool {
|
||||
match self {
|
||||
SearchMode::Regex => false,
|
||||
_ => true,
|
||||
SearchMode::Text => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,10 +125,9 @@ pub(crate) fn render_search_mode_button<V: View>(
|
|||
.in_state(is_active)
|
||||
.style_for(state)
|
||||
.clone();
|
||||
if mode.button_side().is_some() {
|
||||
style.container.border.left = mode.border_left();
|
||||
style.container.border.right = mode.border_right();
|
||||
}
|
||||
style.container.border.left = mode.border_left();
|
||||
style.container.border.right = mode.border_right();
|
||||
|
||||
let label = Label::new(mode.label(), style.text.clone()).contained();
|
||||
let mut container_style = style.container.clone();
|
||||
if let Some(button_side) = mode.button_side() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue