Skip to content

Adjust library installation dialog buttons style #1401

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

Merged
merged 4 commits into from
Oct 20, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions arduino-ide-extension/src/browser/library/library-list-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,30 +119,26 @@ export class LibraryListWidget extends ListWidget<
message.appendChild(question);
const result = await new MessageBoxDialog({
title: nls.localize(
'arduino/library/dependenciesForLibrary',
'Dependencies for library {0}:{1}',
item.name,
version
'arduino/library/installLibraryDependencies',
'Install library dependencies'
),
message,
buttons: [
nls.localize('vscode/issueMainService/cancel', 'Cancel'),
nls.localize(
'arduino/library/installOnly',
'Install {0} only',
item.name
'arduino/library/installWithoutDependencies',
'Install without dependencies'
),
nls.localize('arduino/library/installAll', 'Install all'),
nls.localize('arduino/library/installAll', 'Install All'),
],
maxWidth: 740, // Aligned with `settings-dialog.css`.
}).open();

if (result) {
const { response } = result;
if (response === 1) {
if (response === 0) {
// Current only
installDependencies = false;
} else if (response === 2) {
} else if (response === 1) {
// All
installDependencies = true;
}
Expand Down Expand Up @@ -203,7 +199,11 @@ class MessageBoxDialog extends AbstractDialog<MessageBoxDialog.Result> {
const button = this.createButton(text);
const isPrimaryButton =
index === (options.buttons ? options.buttons.length - 1 : 0);
button.classList.add(isPrimaryButton ? 'main' : 'secondary');
button.title = text;
button.classList.add(
isPrimaryButton ? 'main' : 'secondary',
'message-box-dialog-button'
);
this.controlPanel.appendChild(button);
this.toDisposeOnDetach.push(
addEventListener(button, 'click', () => {
Expand Down
7 changes: 7 additions & 0 deletions arduino-ide-extension/src/browser/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ button.secondary[disabled], .theia-button.secondary[disabled] {
background-color: var(--theia-secondaryButton-background);
}

button.theia-button.message-box-dialog-button {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}

/* To make the progress-bar slightly thicker, and use the color from the status bar */
.theia-progress-bar-container {
width: 100%;
Expand Down
6 changes: 3 additions & 3 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@
"addZip": "Add .ZIP Library...",
"arduinoLibraries": "Arduino libraries",
"contributedLibraries": "Contributed libraries",
"dependenciesForLibrary": "Dependencies for library {0}:{1}",
"include": "Include Library",
"installAll": "Install all",
"installAll": "Install All",
"installLibraryDependencies": "Install library dependencies",
"installMissingDependencies": "Would you like to install all the missing dependencies?",
"installOneMissingDependency": "Would you like to install the missing dependency?",
"installOnly": "Install {0} only",
"installWithoutDependencies": "Install without dependencies",
"installedSuccessfully": "Successfully installed library {0}:{1}",
"libraryAlreadyExists": "A library already exists. Do you want to overwrite it?",
"manageLibraries": "Manage Libraries...",
Expand Down