提交 841456f0 编写于 作者: R Rob Lourens

Fix #55521 - prevent flashing when clicking in exclude control

上级 b54c8efe
......@@ -89,7 +89,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
const listSelectBackgroundColor = theme.getColor(listActiveSelectionBackground);
if (listSelectBackgroundColor) {
collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row:focus { background-color: ${listSelectBackgroundColor}; }`);
collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row.selected:focus { background-color: ${listSelectBackgroundColor}; }`);
}
const listInactiveSelectionBackgroundColor = theme.getColor(listInactiveSelectionBackground);
......@@ -104,7 +104,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
const listSelectForegroundColor = theme.getColor(listActiveSelectionForeground);
if (listSelectForegroundColor) {
collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row.selected { color: ${listSelectForegroundColor}; }`);
collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row.selected:focus { color: ${listSelectForegroundColor}; }`);
}
const codeTextForegroundColor = theme.getColor(textPreformatForeground);
......@@ -152,6 +152,10 @@ export class ExcludeSettingListModel {
this._selectedIdx = idx;
}
getSelected(): number {
return this._selectedIdx;
}
selectNext(): void {
if (typeof this._selectedIdx === 'number') {
this._selectedIdx = Math.min(this._selectedIdx + 1, this._dataItems.length - 1);
......@@ -206,12 +210,18 @@ export class ExcludeSettingWidget extends Disposable {
return;
}
const targetIdx = element.getAttribute('data-index');
if (!targetIdx) {
const targetIdxStr = element.getAttribute('data-index');
if (!targetIdxStr) {
return;
}
const targetIdx = parseInt(targetIdxStr);
if (this.model.getSelected() === targetIdx) {
return;
}
this.model.select(parseInt(targetIdx));
this.model.select(targetIdx);
this.renderList();
e.preventDefault();
e.stopPropagation();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册