source files navigation

This commit is contained in:
Vadim Lopatin 2015-01-19 13:47:54 +03:00
parent 79d8ebff2b
commit ecfafab3bc
2 changed files with 14 additions and 3 deletions

View File

@ -66,7 +66,7 @@
<debuglevel>0</debuglevel> <debuglevel>0</debuglevel>
<debugids /> <debugids />
<versionlevel>0</versionlevel> <versionlevel>0</versionlevel>
<versionids>Unicode USE_OPENGL</versionids> <versionids>Unicode</versionids>
<dump_source>0</dump_source> <dump_source>0</dump_source>
<mapverbosity>3</mapverbosity> <mapverbosity>3</mapverbosity>
<createImplib>0</createImplib> <createImplib>0</createImplib>

View File

@ -64,6 +64,15 @@ class IDEFrame : AppFrame {
super.init(); super.init();
} }
/// move focus to editor in currently selected tab
void focusEditor(string id) {
Widget w = _tabs.tabBody(id);
if (w) {
if (w.visible)
w.setFocus();
}
}
/// source file selected in workspace tree /// source file selected in workspace tree
bool onSourceFileSelected(ProjectSourceFile file, bool activate) { bool onSourceFileSelected(ProjectSourceFile file, bool activate) {
Log.d("onSourceFileSelected ", file.filename); Log.d("onSourceFileSelected ", file.filename);
@ -87,8 +96,9 @@ class IDEFrame : AppFrame {
return false; return false;
} }
} }
if (activate) if (activate) {
_tabs.setFocus(); focusEditor(file.filename);
}
requestLayout(); requestLayout();
return true; return true;
} }
@ -101,6 +111,7 @@ class IDEFrame : AppFrame {
if (file) { if (file) {
// tab is source file editor // tab is source file editor
_wsPanel.selectItem(file); _wsPanel.selectItem(file);
focusEditor(file.filename);
} }
} }
} }