Skip to content

Commit

Permalink
SCM - fix action bar regression (#182063)
Browse files Browse the repository at this point in the history
SCM - fix action bar regression (#182032)
  • Loading branch information
lszomoru authored May 10, 2023
1 parent 1c5afb2 commit b3e4e68
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/vs/workbench/contrib/scm/browser/scmViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ interface ResourceTemplate {
decorationIcon: HTMLElement;
actionBar: ActionBar;
actionBarMenu: IMenu | undefined;
readonly actionBarMenuListener: MutableDisposable<IDisposable>;
readonly elementDisposables: DisposableStore;
readonly disposables: IDisposable;
}
Expand Down Expand Up @@ -418,9 +419,10 @@ class ResourceRenderer implements ICompressibleTreeRenderer<ISCMResource | IReso
});

const decorationIcon = append(element, $('.decoration-icon'));
const disposables = combinedDisposable(actionBar, fileLabel);
const actionBarMenuListener = new MutableDisposable<IDisposable>();
const disposables = combinedDisposable(actionBar, fileLabel, actionBarMenuListener);

return { element, name, fileLabel, decorationIcon, actionBar, actionBarMenu: undefined, elementDisposables: new DisposableStore(), disposables };

This comment has been minimized.

Copy link
@almlkbasm

almlkbasm Jun 1, 2023

src/vs/workbench/contrib/scm/browser/scmViewPane.ts

return { element, name, fileLabel, decorationIcon, actionBar, actionBarMenu: undefined, actionBarMenuListener, elementDisposables: new DisposableStore(), disposables };
}

renderElement(node: ITreeNode<ISCMResource, FuzzyScore | LabelFuzzyScore> | ITreeNode<ISCMResource | IResourceNode<ISCMResource, ISCMResourceGroup>, FuzzyScore | LabelFuzzyScore>, index: number, template: ResourceTemplate): void {
Expand Down Expand Up @@ -521,8 +523,9 @@ class ResourceRenderer implements ICompressibleTreeRenderer<ISCMResource | IReso
private _renderActionBar(template: ResourceTemplate, resourceOrFolder: ISCMResource | IResourceNode<ISCMResource, ISCMResourceGroup>, menu: IMenu): void {
if (!template.actionBarMenu || template.actionBarMenu !== menu) {
template.actionBar.clear();
template.elementDisposables.add(connectPrimaryMenuToInlineActionBar(menu, template.actionBar));

template.actionBarMenu = menu;

This comment has been minimized.

Copy link
@VitKHMER

VitKHMER Jun 5, 2023

V

template.actionBarMenuListener.value = connectPrimaryMenuToInlineActionBar(menu, template.actionBar);
}

template.actionBar.context = resourceOrFolder;
Expand Down

0 comments on commit b3e4e68

Please sign in to comment.