File tree Expand file tree Collapse file tree
src/vs/workbench/parts/preferences/browser Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments