提交 2e449867 编写于 作者: B Benjamin Pasero

Split editor action does not show as disabled when limit hit (fixes #7651)

上级 ad55bcd3
......@@ -89,7 +89,37 @@ export abstract class TitleControl {
this.initActions();
}
private updateActionEnablement(): void {
if (!this.context) {
return;
}
const group = this.context;
const groupCount = this.stacks.groups.length;
// Move group
switch (this.stacks.positionOfGroup(group)) {
case Position.LEFT:
this.moveGroupLeftAction.enabled = false;
this.moveGroupRightAction.enabled = this.stacks.groups.length > 1;
break;
case Position.CENTER:
this.moveGroupRightAction.enabled = this.stacks.groups.length > 2;
break;
case Position.RIGHT:
this.moveGroupRightAction.enabled = false;
break;
}
// Split editor
this.splitEditorAction.enabled = groupCount < 3;
}
private onSchedule(): void {
this.updateActionEnablement();
if (this.refreshScheduled) {
this.doRefresh();
} else {
......@@ -294,22 +324,6 @@ export abstract class TitleControl {
primary.push(this.splitEditorAction);
}
// Make sure enablement is good
switch (this.stacks.positionOfGroup(group)) {
case Position.LEFT:
this.moveGroupLeftAction.enabled = false;
this.moveGroupRightAction.enabled = this.stacks.groups.length > 1;
break;
case Position.CENTER:
this.moveGroupRightAction.enabled = this.stacks.groups.length > 2;
break;
case Position.RIGHT:
this.moveGroupRightAction.enabled = false;
break;
}
// Return actions
const secondary = [
this.moveGroupLeftAction,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册