Fix #56539 - allow selecting text in setting name and description

This commit is contained in:
Rob Lourens 2018-08-16 11:37:56 -07:00
parent acaf5a52a6
commit 44a453a196
2 changed files with 12 additions and 7 deletions

View file

@ -232,9 +232,15 @@
margin-right: 7px;
}
.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-cat-label-container {
float: left;
}
.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-label,
.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-category {
font-weight: 600;
user-select: text;
cursor: text;
}
.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-category {
@ -244,6 +250,8 @@
.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-deprecation-message,
.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description {
margin-top: 3px;
user-select: text;
cursor: text;
}
.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-deprecation-message {

View file

@ -468,8 +468,9 @@ export class SettingsRenderer implements ITreeRenderer {
DOM.addClass(container, 'setting-item');
DOM.addClass(container, 'setting-item-' + typeClass);
const titleElement = DOM.append(container, $('.setting-item-title'));
const categoryElement = DOM.append(titleElement, $('span.setting-item-category'));
const labelElement = DOM.append(titleElement, $('span.setting-item-label'));
const labelCategoryContainer = DOM.append(titleElement, $('.setting-item-cat-label-container'));
const categoryElement = DOM.append(labelCategoryContainer, $('span.setting-item-category'));
const labelElement = DOM.append(labelCategoryContainer, $('span.setting-item-label'));
const isConfiguredElement = DOM.append(titleElement, $('span.setting-item-is-configured-label'));
isConfiguredElement.textContent = localize('configured', "Modified");
const otherOverridesElement = DOM.append(titleElement, $('span.setting-item-overrides'));
@ -1138,11 +1139,7 @@ export class SettingsTreeController extends WorkbenchTreeController {
return true;
}
// Without this, clicking on the setting description causes the tree to lose focus. I don't know why.
// The superclass does not always call it because of DND which is not used here.
eventish.preventDefault();
return super.onLeftClick(tree, element, eventish, origin);
return false;
}
}