Skip to content

Commit 8922069

Browse files
committed
Settings editor - header rows should not be selectable
1 parent bd262c9 commit 8922069

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

src/vs/workbench/parts/preferences/browser/settingsTree.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,4 +1553,45 @@ export class SettingsTree extends NonExpandableTree {
15531553
this.style(colors);
15541554
}));
15551555
}
1556+
1557+
public setFocus(element?: any, eventPayload?: any): void {
1558+
if (element instanceof SettingsTreeGroupElement) {
1559+
const nav = this.getNavigator(element, false);
1560+
do {
1561+
element = nav.next();
1562+
} while (element instanceof SettingsTreeGroupElement);
1563+
}
1564+
1565+
super.setFocus(element, eventPayload);
1566+
}
1567+
1568+
public focusNext(count?: number, eventPayload?: any): void {
1569+
const focus = this.getFocus();
1570+
if (!focus) {
1571+
return super.focusFirst();
1572+
}
1573+
1574+
const nav = this.getNavigator(focus, false);
1575+
let current;
1576+
do {
1577+
current = nav.next();
1578+
} while (current instanceof SettingsTreeGroupElement);
1579+
1580+
this.setFocus(current, eventPayload);
1581+
}
1582+
1583+
public focusPrevious(count?: number, eventPayload?: any): void {
1584+
const focus = this.getFocus();
1585+
if (!focus) {
1586+
return super.focusFirst();
1587+
}
1588+
1589+
const nav = this.getNavigator(focus, false);
1590+
let current;
1591+
do {
1592+
current = nav.previous();
1593+
} while (current instanceof SettingsTreeGroupElement);
1594+
1595+
this.setFocus(current, eventPayload);
1596+
}
15561597
}

0 commit comments

Comments
 (0)