Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finetune message and fix quickpick styling #187855

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vs/platform/quickinput/browser/media/quickInput.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

.quick-input-header .quick-input-description {
margin: 4px 2px;
flex: 1;
}

.quick-input-header {
Expand Down
9 changes: 6 additions & 3 deletions src/vs/platform/quickinput/browser/quickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ interface QuickInputUI {
widget: HTMLElement;
rightActionBar: ActionBar;
checkAll: HTMLInputElement;
inputContainer: HTMLElement;
filterContainer: HTMLElement;
inputBox: QuickInputBox;
visibleCountContainer: HTMLElement;
Expand Down Expand Up @@ -1331,8 +1332,8 @@ export class QuickInputController extends Disposable {
}));

const description2 = dom.append(headerContainer, $('.quick-input-description'));
const extraContainer = dom.append(headerContainer, $('.quick-input-and-message'));
const filterContainer = dom.append(extraContainer, $('.quick-input-filter'));
const inputContainer = dom.append(headerContainer, $('.quick-input-and-message'));
const filterContainer = dom.append(inputContainer, $('.quick-input-filter'));

const inputBox = this._register(new QuickInputBox(filterContainer, this.styles.inputBox, this.styles.toggle));
inputBox.setAttribute('aria-describedby', `${this.idPrefix}message`);
Expand Down Expand Up @@ -1360,7 +1361,7 @@ export class QuickInputController extends Disposable {
this.onDidCustomEmitter.fire();
}));

const message = dom.append(extraContainer, $(`#${this.idPrefix}message.quick-input-message`));
const message = dom.append(inputContainer, $(`#${this.idPrefix}message.quick-input-message`));

const progressBar = new ProgressBar(container, this.styles.progressBar);
progressBar.getContainer().classList.add('quick-input-progress');
Expand Down Expand Up @@ -1481,6 +1482,7 @@ export class QuickInputController extends Disposable {
widget,
rightActionBar,
checkAll,
inputContainer,
filterContainer,
inputBox,
visibleCountContainer,
Expand Down Expand Up @@ -1749,6 +1751,7 @@ export class QuickInputController extends Disposable {
ui.description1.style.display = visibilities.description && (visibilities.inputBox || visibilities.checkAll) ? '' : 'none';
ui.description2.style.display = visibilities.description && !(visibilities.inputBox || visibilities.checkAll) ? '' : 'none';
ui.checkAll.style.display = visibilities.checkAll ? '' : 'none';
ui.inputContainer.style.display = visibilities.inputBox ? '' : 'none';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this fix?

Copy link
Member Author

@sandy081 sandy081 Jul 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:

image

After:

image

ui.filterContainer.style.display = visibilities.inputBox ? '' : 'none';
ui.visibleCountContainer.style.display = visibilities.visibleCount ? '' : 'none';
ui.countContainer.style.display = visibilities.count ? '' : 'none';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,27 +507,14 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
quickPick.hideCheckAll = true;
quickPick.ignoreFocusOut = true;
quickPick.customLabel = localize('create', "Create Profile");
quickPick.description = localize('customise the profile', "Unselect to link to the Default Profile");
quickPick.description = localize('customise the profile', "Choose what you want to configure in the profile. Unselected items are shared from the default profile.");
quickPick.items = resources;
quickPick.selectedItems = resources.filter(item => item.picked);

const disposables = new DisposableStore();
const update = () => {
quickPick.items = resources;
quickPick.selectedItems = resources.filter(item => item.picked);
};
update();

disposables.add(quickPick.onDidChangeSelection(items => {
let needUpdate = false;
for (const resource of resources) {
resource.picked = items.includes(resource);
const description = resource.picked ? undefined : localize('use default profile', "Default Profile");
if (resource.description !== description) {
resource.description = description;
needUpdate = true;
}
}
if (needUpdate) {
update();
}
}));

Expand Down