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

clean up icon path confusion #41577

Merged
merged 4 commits into from
Jan 23, 2018
Merged

clean up icon path confusion #41577

merged 4 commits into from
Jan 23, 2018

Conversation

bpasero
Copy link
Member

@bpasero bpasero commented Jan 13, 2018

fixes #35491

@bpasero bpasero added this to the January 2018 milestone Jan 13, 2018
@bpasero bpasero self-assigned this Jan 13, 2018
@bpasero bpasero requested a review from jrieken January 13, 2018 17:24
@bpasero
Copy link
Member Author

bpasero commented Jan 23, 2018

@jrieken ping


constructor(
action: MenuItemAction,
private action: MenuItemAction,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_action

private _wantsAltCommand: boolean = false;
private _itemClassDispose: IDisposable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last one always leaks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting line of argumentation... Well, now that this is created by an object with a lifecycle we could make use of that fact...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrieken sorry I thought you meant something else, pushed a fix

@IKeybindingService private _keybindingService: IKeybindingService,
@IMessageService protected _messageService: IMessageService,
@IContextMenuService private _contextMenuService: IContextMenuService
) {
super(undefined, action, { icon: !!action.class, label: !action.class });
super(undefined, action, { icon: !!(action.class || action.item.iconPath), label: !action.class && !action.item.iconPath });
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what that is for. Does the super-type support icon being a class-name or a file paths?

Copy link
Member Author

@bpasero bpasero Jan 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrieken this is just a hint that we have an icon to show and do not expect a label

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and that hint is used somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

@@ -23,8 +23,7 @@ export interface ICommandAction {
id: string;
title: string | ILocalizedString;
category?: string | ILocalizedString;
iconClass?: string;
iconPath?: string;
iconPath?: string | { light: string; dark: string; };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at consumer code would it be nicer to just have { light: string; dark: string; }? Where dark defaults to light if missing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrieken yeah makes sense, pushed

@jrieken
Copy link
Member

jrieken commented Jan 23, 2018

ops, forgot to press submit...

@jrieken
Copy link
Member

jrieken commented Jan 23, 2018

lgtm

@bpasero bpasero merged commit 58c705b into master Jan 23, 2018
@bpasero bpasero deleted the ben/fix-35491 branch January 23, 2018 14:49
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clean up icon path confusion
2 participants