From 908de23b72cd8c5bd0e13fcb1079667f2155b0a8 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 8 Jun 2023 08:58:57 -0700 Subject: [PATCH] Tweak LSP log menu styling --- crates/lsp_log/src/lsp_log.rs | 15 +++++++++------ crates/theme/src/theme.rs | 1 + styles/src/styleTree/lspLogMenu.ts | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/crates/lsp_log/src/lsp_log.rs b/crates/lsp_log/src/lsp_log.rs index c7a95cab1d..1071ed435a 100644 --- a/crates/lsp_log/src/lsp_log.rs +++ b/crates/lsp_log/src/lsp_log.rs @@ -659,16 +659,17 @@ impl LspLogToolbarItemView { ) .contained() .with_style(style.container) - .aligned() - .left() + .constrained() + .with_height(theme.lsp_log_menu.row_height) }) .with_child( MouseEventHandler::::new(id.0, cx, move |state, _| { let style = theme.lsp_log_menu.item.style_for(state, logs_selected); - Flex::row() - .with_child(Label::new(SERVER_LOGS, style.text.clone()).aligned().left()) + Label::new(SERVER_LOGS, style.text.clone()) .contained() .with_style(style.container) + .constrained() + .with_height(theme.lsp_log_menu.row_height) }) .with_cursor_style(CursorStyle::PointingHand) .on_click(MouseButton::Left, move |_, view, cx| { @@ -681,8 +682,8 @@ impl LspLogToolbarItemView { Flex::row() .with_child( Label::new(RPC_MESSAGES, style.text.clone()) - .aligned() - .left(), + .constrained() + .with_height(theme.lsp_log_menu.row_height), ) .with_child( ui::checkbox_with_label::( @@ -700,6 +701,8 @@ impl LspLogToolbarItemView { .align_children_center() .contained() .with_style(style.container) + .constrained() + .with_height(theme.lsp_log_menu.row_height) }) .with_cursor_style(CursorStyle::PointingHand) .on_click(MouseButton::Left, move |_, view, cx| { diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index 164a8cc1b2..9bd17910d2 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -252,6 +252,7 @@ pub struct LspLogMenu { pub header: Interactive, pub server: ContainedText, pub item: Interactive, + pub row_height: f32, } #[derive(Clone, Deserialize, Default)] diff --git a/styles/src/styleTree/lspLogMenu.ts b/styles/src/styleTree/lspLogMenu.ts index a6b8f7b1f9..94dd4831b2 100644 --- a/styles/src/styleTree/lspLogMenu.ts +++ b/styles/src/styleTree/lspLogMenu.ts @@ -5,6 +5,7 @@ export default function contactsPanel(colorScheme: ColorScheme) { let layer = colorScheme.middle return { + rowHeight: 30, background: background(layer), border: border(layer), shadow: colorScheme.popoverShadow,