Skip to content

Commit 93291b6

Browse files
Adjust library installation dialog buttons style (#1401)
Closes #1314.
1 parent 87ebcbe commit 93291b6

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

arduino-ide-extension/src/browser/library/library-list-widget.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -119,30 +119,26 @@ export class LibraryListWidget extends ListWidget<
119119
message.appendChild(question);
120120
const result = await new MessageBoxDialog({
121121
title: nls.localize(
122-
'arduino/library/dependenciesForLibrary',
123-
'Dependencies for library {0}:{1}',
124-
item.name,
125-
version
122+
'arduino/library/installLibraryDependencies',
123+
'Install library dependencies'
126124
),
127125
message,
128126
buttons: [
129-
nls.localize('vscode/issueMainService/cancel', 'Cancel'),
130127
nls.localize(
131-
'arduino/library/installOnly',
132-
'Install {0} only',
133-
item.name
128+
'arduino/library/installWithoutDependencies',
129+
'Install without dependencies'
134130
),
135-
nls.localize('arduino/library/installAll', 'Install all'),
131+
nls.localize('arduino/library/installAll', 'Install All'),
136132
],
137133
maxWidth: 740, // Aligned with `settings-dialog.css`.
138134
}).open();
139135

140136
if (result) {
141137
const { response } = result;
142-
if (response === 1) {
138+
if (response === 0) {
143139
// Current only
144140
installDependencies = false;
145-
} else if (response === 2) {
141+
} else if (response === 1) {
146142
// All
147143
installDependencies = true;
148144
}
@@ -203,7 +199,11 @@ class MessageBoxDialog extends AbstractDialog<MessageBoxDialog.Result> {
203199
const button = this.createButton(text);
204200
const isPrimaryButton =
205201
index === (options.buttons ? options.buttons.length - 1 : 0);
206-
button.classList.add(isPrimaryButton ? 'main' : 'secondary');
202+
button.title = text;
203+
button.classList.add(
204+
isPrimaryButton ? 'main' : 'secondary',
205+
'message-box-dialog-button'
206+
);
207207
this.controlPanel.appendChild(button);
208208
this.toDisposeOnDetach.push(
209209
addEventListener(button, 'click', () => {

arduino-ide-extension/src/browser/style/index.css

+7
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ button.secondary[disabled], .theia-button.secondary[disabled] {
109109
background-color: var(--theia-secondaryButton-background);
110110
}
111111

112+
button.theia-button.message-box-dialog-button {
113+
white-space: nowrap;
114+
overflow: hidden;
115+
text-overflow: ellipsis;
116+
display: inline-block;
117+
}
118+
112119
/* To make the progress-bar slightly thicker, and use the color from the status bar */
113120
.theia-progress-bar-container {
114121
width: 100%;

i18n/en.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@
254254
"addZip": "Add .ZIP Library...",
255255
"arduinoLibraries": "Arduino libraries",
256256
"contributedLibraries": "Contributed libraries",
257-
"dependenciesForLibrary": "Dependencies for library {0}:{1}",
258257
"include": "Include Library",
259-
"installAll": "Install all",
258+
"installAll": "Install All",
259+
"installLibraryDependencies": "Install library dependencies",
260260
"installMissingDependencies": "Would you like to install all the missing dependencies?",
261261
"installOneMissingDependency": "Would you like to install the missing dependency?",
262-
"installOnly": "Install {0} only",
262+
"installWithoutDependencies": "Install without dependencies",
263263
"installedSuccessfully": "Successfully installed library {0}:{1}",
264264
"libraryAlreadyExists": "A library already exists. Do you want to overwrite it?",
265265
"manageLibraries": "Manage Libraries...",

0 commit comments

Comments
 (0)