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

Retain Library/Boards Manager installation interface using version menu #1471

Merged
merged 1 commit into from
Oct 13, 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
4 changes: 2 additions & 2 deletions arduino-ide-extension/src/browser/style/list-widget.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
flex-direction: column-reverse;
}

.component-list-item:hover .footer > * {
.component-list-item .footer > * {
display: inline-block;
margin: 5px 0px 0px 10px;
}
Expand Down Expand Up @@ -160,4 +160,4 @@

.hc-black.hc-theia.theia-hc .component-list-item .header .installed:before {
border: 1px solid var(--theia-button-border);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class ComponentListItem<
this.state = {
selectedVersion: version,
focus: false,
versionUpdate: false,
};
}
}
Expand All @@ -33,7 +34,9 @@ export class ComponentListItem<
return (
<div
onMouseEnter={() => this.setState({ focus: true })}
onMouseLeave={() => this.setState({ focus: false })}
onMouseLeave={() => {
if (!this.state.versionUpdate) this.setState({ focus: false });
}}
>
{itemRenderer.renderItem(
Object.assign(this.state, { item }),
Expand All @@ -52,6 +55,7 @@ export class ComponentListItem<
)[0];
this.setState({
selectedVersion: version,
versionUpdate: false,
});
try {
await this.props.install(item, toInstall);
Expand All @@ -67,7 +71,7 @@ export class ComponentListItem<
}

private onVersionChange(version: Installable.Version): void {
this.setState({ selectedVersion: version });
this.setState({ selectedVersion: version, versionUpdate: true });
}
}

Expand All @@ -83,5 +87,6 @@ export namespace ComponentListItem {
export interface State {
selectedVersion?: Installable.Version;
focus: boolean;
versionUpdate: boolean;
}
}