Fix double borders in mode buttons.

Co-authored-by: Kyle <kyle@zed.dev>
This commit is contained in:
Piotr Osiewicz 2023-08-14 14:43:06 +02:00
parent 7314456685
commit d17aba4fd3
2 changed files with 8 additions and 8 deletions

View file

@ -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,
}
}

View file

@ -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() {