Skip to content

Commit 8708686

Browse files
committed
add 'viewColumn' for SimpleUIConfig
1 parent b958ca4 commit 8708686

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/SimpleUIDef.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as vscode from 'vscode';
12

23
export interface SimpleUIConfig {
34

@@ -7,6 +8,10 @@ export interface SimpleUIConfig {
78

89
iconName?: string;
910

11+
viewColumn?: vscode.ViewColumn;
12+
13+
notTakeFocus?: boolean;
14+
1015
btns?: {
1116
'submit'?: SimpleUIBtnInfo;
1217
'reset'?: SimpleUIBtnInfo;

src/WebPanelManager.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,16 @@ export class WebPanelManager {
5555

5656
const resManager = ResManager.GetInstance();
5757

58+
let ViewCol = cfg.viewColumn;
59+
60+
if (ViewCol == undefined || ViewCol == null) {
61+
ViewCol = vscode.ViewColumn.One;
62+
}
63+
5864
const panel = vscode.window.createWebviewPanel('eide.simple-cfg-ui',
59-
cfg.title, vscode.ViewColumn.One, { enableScripts: true, retainContextWhenHidden: true });
65+
cfg.title,
66+
{ viewColumn: ViewCol, preserveFocus: cfg.notTakeFocus },
67+
{ enableScripts: true, retainContextWhenHidden: true });
6068

6169
panel.iconPath = vscode.Uri.file(resManager.GetIconByName(cfg.iconName || 'Property_16x.svg').path);
6270

0 commit comments

Comments
 (0)