mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 09:35:40 -05:00
Add focus logic to the tabbed panel (#5649)
* add focus logic to the tabbed panel * change enter to be on key up * fix tests
This commit is contained in:
@@ -94,6 +94,7 @@ export class MessagePanel extends Disposable {
|
||||
renderer: this.renderer,
|
||||
controller: this.controller
|
||||
}, { keyboardSupport: false, horizontalScrollMode: ScrollbarVisibility.Auto }));
|
||||
this.tree.setInput(this.model);
|
||||
this.tree.onDidScroll(e => {
|
||||
// convert to old VS Code tree interface with expandable methods
|
||||
let expandableTree: IExpandableTree = <IExpandableTree>this.tree;
|
||||
@@ -158,7 +159,6 @@ export class MessagePanel extends Disposable {
|
||||
this.container.style.height = '100%';
|
||||
this._register(attachListStyler(this.tree, this.themeService));
|
||||
container.appendChild(this.container);
|
||||
this.tree.setInput(this.model);
|
||||
}
|
||||
|
||||
public layout(size: Dimension): void {
|
||||
@@ -176,6 +176,11 @@ export class MessagePanel extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
this.tree.refresh();
|
||||
this.tree.domFocus();
|
||||
}
|
||||
|
||||
public set queryRunner(runner: QueryRunner) {
|
||||
dispose(this.queryRunnerDisposables);
|
||||
this.queryRunnerDisposables = [];
|
||||
|
||||
@@ -110,7 +110,7 @@ export class QueryEditor extends BaseEditor {
|
||||
this.splitview.addView({
|
||||
element: this.textEditorContainer,
|
||||
layout: size => this.textEditor.layout(new DOM.Dimension(this.dimension.width, size)),
|
||||
minimumSize: 220,
|
||||
minimumSize: 0,
|
||||
maximumSize: Number.POSITIVE_INFINITY,
|
||||
onDidChange: Event.None
|
||||
}, Sizing.Distribute);
|
||||
@@ -336,7 +336,7 @@ export class QueryEditor extends BaseEditor {
|
||||
this.splitview.addView({
|
||||
element: this.resultsEditorContainer,
|
||||
layout: size => this.resultsEditor && this.resultsEditor.layout(new DOM.Dimension(this.dimension.width, size)),
|
||||
minimumSize: 220,
|
||||
minimumSize: 0,
|
||||
maximumSize: Number.POSITIVE_INFINITY,
|
||||
onDidChange: Event.None
|
||||
}, Sizing.Distribute);
|
||||
|
||||
@@ -42,6 +42,10 @@ class MessagesView extends Disposable implements IPanelView {
|
||||
this.messagePanel.layout(dimension);
|
||||
}
|
||||
|
||||
focus(): void {
|
||||
this.messagePanel.focus();
|
||||
}
|
||||
|
||||
public clear() {
|
||||
this.messagePanel.clear();
|
||||
}
|
||||
@@ -85,6 +89,10 @@ class ResultsView extends Disposable implements IPanelView {
|
||||
this.gridPanel.layout(dimension);
|
||||
}
|
||||
|
||||
focus(): void {
|
||||
this.gridPanel.focus();
|
||||
}
|
||||
|
||||
public clear() {
|
||||
this.gridPanel.clear();
|
||||
}
|
||||
|
||||
@@ -155,6 +155,10 @@ export class GridPanel {
|
||||
this.currentHeight = size.height;
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
// will need to add logic to save the focused grid and focus that
|
||||
}
|
||||
|
||||
public set queryRunner(runner: QueryRunner) {
|
||||
dispose(this.queryRunnerDisposables);
|
||||
this.reset();
|
||||
|
||||
@@ -49,6 +49,10 @@ export class QueryModelViewTabView implements IPanelView {
|
||||
public layout(dimension: Dimension): void {
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the angular components and record for this input that we have done so
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user