-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
When the profile icon is set to null, fall back to the icon of the commandline #15843
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fb588b8
This is easy enough
zadjii-msft c41895e
be smart, use the first word as the application name
zadjii-msft c6c933a
Merge remote-tracking branch 'origin/main' into dev/migrie/b/705-defa…
zadjii-msft cf7ebb8
add a sui checkbox for hiding the icon
zadjii-msft 9d9a8e3
better to use constants
zadjii-msft be28766
This works for PowerShell in 'Program Files' now too
zadjii-msft 180ac97
Merge remote-tracking branch 'origin/main' into dev/migrie/b/705-defa…
zadjii-msft a4de082
smort
zadjii-msft b804bc2
Merge branch 'dev/migrie/b/705-default-to-commandline' of https://git…
zadjii-msft c31ea4d
Merge remote-tracking branch 'origin/main' into dev/migrie/b/705-defa…
zadjii-msft 01b62c5
phrasing
zadjii-msft 10d9157
Merge remote-tracking branch 'origin/main' into dev/migrie/b/705-defa…
zadjii-msft 77fb50a
allow setting the icon to clear the cache
zadjii-msft 07fd586
Merge remote-tracking branch 'origin/main' into dev/migrie/b/705-defa…
zadjii-msft 6c20f9f
Merge remote-tracking branch 'origin/main' into dev/migrie/b/705-defa…
zadjii-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,3 +336,28 @@ Json::Value Profile::ToJson() const | |
|
||
return json; | ||
} | ||
winrt::hstring Profile::EvaluatedIcon() const | ||
{ | ||
// If the profile has an icon, return it. | ||
if (!Icon().empty()) | ||
{ | ||
return Icon(); | ||
} | ||
|
||
// Otherwise, return the first word of the commandline - that should be the executable name. | ||
std::wstring_view cmdline{ Commandline() }; | ||
if (cmdline.empty()) | ||
{ | ||
return {}; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW you can remove this check. An empty |
||
|
||
auto firstSpace = cmdline.find_first_of(L" "); | ||
if (firstSpace == std::wstring::npos) | ||
{ | ||
return winrt::hstring{ cmdline }; | ||
} | ||
else | ||
{ | ||
return winrt::hstring{ cmdline.substr(0, firstSpace) }; | ||
} | ||
zadjii-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we not use our own member here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, we can't because profile is layered so
_Icon
isn't the actual icon necessarily