mirror of https://github.com/lapce/lapce.git
focus on settings when open
This commit is contained in:
parent
9f622bafbe
commit
4d0ef4adc0
|
@ -2171,6 +2171,11 @@ pub fn open_settings(&mut self, ctx: &mut EventCtx) {
|
|||
Arc::make_mut(self.editor_tabs.get_mut(&active).unwrap());
|
||||
for (i, child) in editor_tab.children.iter().enumerate() {
|
||||
if let EditorTabChild::Settings(_, _) = child {
|
||||
ctx.submit_command(Command::new(
|
||||
LAPCE_UI_COMMAND,
|
||||
LapceUICommand::Focus,
|
||||
Target::Widget(active),
|
||||
));
|
||||
editor_tab.active = i;
|
||||
return;
|
||||
}
|
||||
|
@ -2193,6 +2198,13 @@ pub fn open_settings(&mut self, ctx: &mut EventCtx) {
|
|||
self.editor_tab_new_settings(ctx, editor_tab_id);
|
||||
}
|
||||
}
|
||||
if let Some(active) = *self.active_tab {
|
||||
ctx.submit_command(Command::new(
|
||||
LAPCE_UI_COMMAND,
|
||||
LapceUICommand::Focus,
|
||||
Target::Widget(active),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn jump_to_location(
|
||||
|
|
Loading…
Reference in New Issue