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

Add icons to commands in the Command Palette #7368

Merged
1 commit merged into from
Aug 21, 2020
Merged

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

cmdpal-icons

Adds support for setting a command's icon. This supports a couple different scenarios:

  • setting a path to an image
  • on "iterateOn": "profiles" commands, setting the icon to ${profile.icon} (to use the profile's icon)
  • setting the icon to a symbol from Segoe MDL2 Assets
  • setting the icon to an emoji
  • setting the icon to a character (what is an emoji other than a character, after all?)

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

Importantly, the creation of these icons must occur on the UI thread. That's why it's done in a "load the path from json", then "get the actual IconSource" structure.

Validation Steps Performed

see the gif

@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Aug 21, 2020
@zadjii-msft
Copy link
Member Author

Some hopefully useful symbols:

icon  codepoint name
image  F57C CollatePortrait
image  F614 DoublePortrait
image  F615 DoubleLandscape
image  E8A0 OpenPane
image  E784 GripperBarVertical
image  E76F GripperBarHorizontal
image  E756 CommandPrompt
image  E713 Setting
image  F7ED WindowSnipping

Man there are just not very many good pane icons for us to use. There's an icon for the number 16 but no good panes ones :/

@DHowett
Copy link
Member

DHowett commented Aug 21, 2020

SHIP IT

Copy link
Contributor

@leonMSFT leonMSFT left a comment

Choose a reason for hiding this comment

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

oh man I love that you're able to use anything as an icon and it'll just know what to do

F57C and its 90deg rotato version could be good for split panes?

@zadjii-msft
Copy link
Member Author

Man I thought emoji would come to the rescue, but not so much. Fuse is close to a hypothetical "WHITE SQUARE WITH CENTRE HORIZONTAL LINE", but that doesn't exist. Neither does "WHITE SQUARE WITH HORIZONTAL BISECTING LINE"

Character Name Browser Image
U+25E7 SQUARE WITH LEFT HALF BLACK view
U+25E8 SQUARE WITH RIGHT HALF BLACK view
U+2385 WHITE SQUARE WITH CENTRE VERTICAL LINE view
U+23DB FUSE view
U+25EB WHITE SQUARE WITH VERTICAL BISECTING LINE view
U+2B12 SQUARE WITH TOP HALF BLACK view
U+2B13 SQUARE WITH BOTTOM HALF BLACK view

@zadjii-msft
Copy link
Member Author

F57C and its 90deg rotato version could be good for split panes?

Yea, now I've gotta introduce a rotation variable too, but that's not too horrifying.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 21, 2020
@ghost
Copy link

ghost commented Aug 21, 2020

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 7 hours 17 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@zadjii-msft
Copy link
Member Author

@msftbot merge this in like 1 minute

@ghost
Copy link

ghost commented Aug 21, 2020

Hello @zadjii-msft!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Fri, 21 Aug 2020 18:07:08 GMT, which is in 1 minute

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 58efe79 into master Aug 21, 2020
@ghost ghost deleted the dev/migrie/f/cmdpal-icons branch August 21, 2020 18:08
@ghost
Copy link

ghost commented Aug 26, 2020

🎉Windows Terminal Preview v1.3.2382.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command palette entries should have optional icons
3 participants