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

ui/ux: fix flickering icons when resizing explorer #12629

Merged
merged 4 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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: 4 additions & 0 deletions packages/core/src/browser/style/view-container.css
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,7 @@
.theia-view-container-part-title {
display: flex;
}

.no-pointer-events {
pointer-events: none;
}
14 changes: 14 additions & 0 deletions packages/core/src/browser/view-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,8 @@ export class ViewContainerPart extends BaseWidget {
protected readonly onDidChangeBadgeTooltipEmitter = new Emitter<void>();
readonly onDidChangeBadgeTooltip = this.onDidChangeBadgeTooltipEmitter.event;

protected readonly onResizeEvent = new Event('onResizeEvent');

protected readonly toolbar: TabBarToolbar;

protected _collapsed: boolean;
Expand Down Expand Up @@ -1234,7 +1236,19 @@ export class ViewContainerPart extends BaseWidget {
};
}

protected handleResize(): void {
const handleMouseEnter = () => {
this.node?.classList.add('no-pointer-events');
setTimeout(() => {
this.node?.classList.remove('no-pointer-events');
this.node?.removeEventListener('mouseenter', handleMouseEnter);
}, 1000);
msujew marked this conversation as resolved.
Show resolved Hide resolved
};
this.node?.addEventListener('mouseenter', handleMouseEnter);
}

protected override onResize(msg: Widget.ResizeMessage): void {
this.handleResize();
if (this.wrapped.isAttached && !this.collapsed) {
MessageLoop.sendMessage(this.wrapped, Widget.ResizeMessage.UnknownSize);
}
Expand Down