debugger: More focus tweaks (#31232)
- Make remembering focus work with `ActivatePaneDown` as well - Tone down the console's focus-in behavior so clicking doesn't misbehave Release Notes: - N/A
This commit is contained in:
@@ -74,7 +74,7 @@ pub struct RunningState {
|
||||
console: Entity<Console>,
|
||||
breakpoint_list: Entity<BreakpointList>,
|
||||
panes: PaneGroup,
|
||||
active_pane: Option<Entity<Pane>>,
|
||||
active_pane: Entity<Pane>,
|
||||
pane_close_subscriptions: HashMap<EntityId, Subscription>,
|
||||
dock_axis: Axis,
|
||||
_schedule_serialize: Option<Task<()>>,
|
||||
@@ -85,8 +85,8 @@ impl RunningState {
|
||||
self.thread_id
|
||||
}
|
||||
|
||||
pub(crate) fn active_pane(&self) -> Option<&Entity<Pane>> {
|
||||
self.active_pane.as_ref()
|
||||
pub(crate) fn active_pane(&self) -> &Entity<Pane> {
|
||||
&self.active_pane
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,6 +703,7 @@ impl RunningState {
|
||||
|
||||
workspace::PaneGroup::with_root(root)
|
||||
};
|
||||
let active_pane = panes.first_pane();
|
||||
|
||||
Self {
|
||||
session,
|
||||
@@ -715,7 +716,7 @@ impl RunningState {
|
||||
stack_frame_list,
|
||||
session_id,
|
||||
panes,
|
||||
active_pane: None,
|
||||
active_pane,
|
||||
module_list,
|
||||
console,
|
||||
breakpoint_list,
|
||||
@@ -1230,7 +1231,7 @@ impl RunningState {
|
||||
cx.notify();
|
||||
}
|
||||
Event::Focus => {
|
||||
this.active_pane = Some(source_pane.clone());
|
||||
this.active_pane = source_pane.clone();
|
||||
}
|
||||
Event::ZoomIn => {
|
||||
source_pane.update(cx, |pane, cx| {
|
||||
@@ -1254,10 +1255,10 @@ impl RunningState {
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
let active_pane = self.active_pane.clone();
|
||||
if let Some(pane) = self
|
||||
.active_pane
|
||||
.as_ref()
|
||||
.and_then(|pane| self.panes.find_pane_in_direction(pane, direction, cx))
|
||||
.panes
|
||||
.find_pane_in_direction(&active_pane, direction, cx)
|
||||
{
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.focus_active_item(window, cx);
|
||||
|
||||
@@ -84,7 +84,7 @@ impl Console {
|
||||
this.update_output(window, cx)
|
||||
}
|
||||
}),
|
||||
cx.on_focus_in(&focus_handle, window, |console, window, cx| {
|
||||
cx.on_focus(&focus_handle, window, |console, window, cx| {
|
||||
if console.is_running(cx) {
|
||||
console.query_bar.focus_handle(cx).focus(window);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user