mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-18 06:39:28 +00:00
feat: new UX for the boards/library manager widgets
Closes #19 Closes #781 Closes #1591 Closes #1607 Closes #1697 Closes #1707 Closes #1924 Closes #1941 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -12,7 +12,10 @@ import {
|
||||
LibrarySearch,
|
||||
LibraryService,
|
||||
} from '../../common/protocol/library-service';
|
||||
import { ListWidget } from '../widgets/component-list/list-widget';
|
||||
import {
|
||||
ListWidget,
|
||||
UserAbortError,
|
||||
} from '../widgets/component-list/list-widget';
|
||||
import { Installable } from '../../common/protocol';
|
||||
import { ListItemRenderer } from '../widgets/component-list/list-item-renderer';
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
@@ -141,6 +144,8 @@ export class LibraryListWidget extends ListWidget<
|
||||
// All
|
||||
installDependencies = true;
|
||||
}
|
||||
} else {
|
||||
throw new UserAbortError();
|
||||
}
|
||||
} else {
|
||||
// The lib does not have any dependencies.
|
||||
@@ -235,6 +240,21 @@ class MessageBoxDialog extends AbstractDialog<MessageBoxDialog.Result> {
|
||||
this.response = 0;
|
||||
super.handleEnter(event);
|
||||
}
|
||||
|
||||
protected override onAfterAttach(message: Message): void {
|
||||
super.onAfterAttach(message);
|
||||
let buttonToFocus: HTMLButtonElement | undefined = undefined;
|
||||
for (const child of Array.from(this.controlPanel.children)) {
|
||||
if (child instanceof HTMLButtonElement) {
|
||||
if (child.classList.contains('main')) {
|
||||
buttonToFocus = child;
|
||||
break;
|
||||
}
|
||||
buttonToFocus = child;
|
||||
}
|
||||
}
|
||||
buttonToFocus?.focus();
|
||||
}
|
||||
}
|
||||
export namespace MessageBoxDialog {
|
||||
export interface Options extends DialogProps {
|
||||
|
||||
Reference in New Issue
Block a user