diff --git a/crates/debugger_ui/src/persistence.rs b/crates/debugger_ui/src/persistence.rs index bb2a9b14f0ffb44a460fd3d6799b15055938c7a0..79d17116e4af8ed7b5ea2245348d95f3703ebb55 100644 --- a/crates/debugger_ui/src/persistence.rs +++ b/crates/debugger_ui/src/persistence.rs @@ -61,6 +61,28 @@ impl DebuggerPaneItem { DebuggerPaneItem::Terminal => SharedString::new_static("Terminal"), } } + pub(crate) fn tab_tooltip(self) -> SharedString { + let tooltip = match self { + DebuggerPaneItem::Console => { + "Displays program output and allows manual input of debugger commands." + } + DebuggerPaneItem::Variables => { + "Shows current values of local and global variables in the current stack frame." + } + DebuggerPaneItem::BreakpointList => "Lists all active breakpoints set in the code.", + DebuggerPaneItem::Frames => { + "Displays the call stack, letting you navigate between function calls." + } + DebuggerPaneItem::Modules => "Shows all modules or libraries loaded by the program.", + DebuggerPaneItem::LoadedSources => { + "Lists all source files currently loaded and used by the debugger." + } + DebuggerPaneItem::Terminal => { + "Provides an interactive terminal session within the debugging environment." + } + }; + SharedString::new_static(tooltip) + } } impl From for SharedString { diff --git a/crates/debugger_ui/src/session/running.rs b/crates/debugger_ui/src/session/running.rs index 331961e08988133eee6fad7932cc9767fe319c32..22216ab78a4ec4c77e5a12f3bdb7057beb162731 100644 --- a/crates/debugger_ui/src/session/running.rs +++ b/crates/debugger_ui/src/session/running.rs @@ -173,6 +173,10 @@ impl Item for SubView { self.kind.to_shared_string() } + fn tab_tooltip_text(&self, _: &App) -> Option { + Some(self.kind.tab_tooltip()) + } + fn tab_content( &self, params: workspace::item::TabContentParams, @@ -399,6 +403,9 @@ pub(crate) fn new_debugger_pane( .p_1() .rounded_md() .cursor_pointer() + .when_some(item.tab_tooltip_text(cx), |this, tooltip| { + this.tooltip(Tooltip::text(tooltip)) + }) .map(|this| { let theme = cx.theme(); if selected { diff --git a/crates/debugger_ui/src/session/running/console.rs b/crates/debugger_ui/src/session/running/console.rs index 4a996b8b6029555e7cc6c0fdb298888c74263ec4..d149beb46147792476788c3e77906488047c067b 100644 --- a/crates/debugger_ui/src/session/running/console.rs +++ b/crates/debugger_ui/src/session/running/console.rs @@ -176,16 +176,18 @@ impl Console { } fn render_console(&self, cx: &Context) -> impl IntoElement { - EditorElement::new(&self.console, self.editor_style(cx)) + EditorElement::new(&self.console, Self::editor_style(&self.console, cx)) } - fn editor_style(&self, cx: &Context) -> EditorStyle { + fn editor_style(editor: &Entity, cx: &Context) -> EditorStyle { + let is_read_only = editor.read(cx).read_only(cx); let settings = ThemeSettings::get_global(cx); + let theme = cx.theme(); let text_style = TextStyle { - color: if self.console.read(cx).read_only(cx) { - cx.theme().colors().text_disabled + color: if is_read_only { + theme.colors().text_muted } else { - cx.theme().colors().text + theme.colors().text }, font_family: settings.buffer_font.family.clone(), font_features: settings.buffer_font.features.clone(), @@ -195,15 +197,15 @@ impl Console { ..Default::default() }; EditorStyle { - background: cx.theme().colors().editor_background, - local_player: cx.theme().players().local(), + background: theme.colors().editor_background, + local_player: theme.players().local(), text: text_style, ..Default::default() } } fn render_query_bar(&self, cx: &Context) -> impl IntoElement { - EditorElement::new(&self.query_bar, self.editor_style(cx)) + EditorElement::new(&self.query_bar, Self::editor_style(&self.query_bar, cx)) } fn update_output(&mut self, window: &mut Window, cx: &mut Context) {