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 icon to profile title on settings UI #9694

Open
cinnamon-msft opened this issue Apr 2, 2021 · 19 comments · Fixed by #10046 · May be fixed by #18244
Open

Add icon to profile title on settings UI #9694

cinnamon-msft opened this issue Apr 2, 2021 · 19 comments · Fixed by #10046 · May be fixed by #18244
Labels
Area-Settings UI Anything specific to the SUI good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Milestone

Comments

@cinnamon-msft
Copy link
Contributor

Description of the new feature/enhancement

If would be cool if we displayed the icon of the profile at the top of the profile page on the settings UI.

profile-icon

Proposed technical implementation details (optional)

@cinnamon-msft cinnamon-msft added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Apr 2, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Apr 2, 2021
@cinnamon-msft cinnamon-msft added Area-Settings UI Anything specific to the SUI Product-Terminal The new Windows Terminal. labels Apr 2, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Apr 2, 2021
@zadjii-msft zadjii-msft added good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Apr 7, 2021
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Apr 7, 2021
@vastatio-xoxo
Copy link

Hi, do you have any UI mockups (for dimensions, spacings etc) for the icon?

@zadjii-msft zadjii-msft self-assigned this May 6, 2021
@ghost ghost added the In-PR This issue has a related PR label May 6, 2021
@ghost ghost closed this as completed in #10046 May 13, 2021
ghost pushed a commit that referenced this issue May 13, 2021
## Summary of the Pull Request

Adds the profile icons to the page header. I had to manually create the header, and manually bind it to the `Icon` and `Content` of each `NavViewItem`. 

It's important that each `NavViewItem`'s icon is set as an `IconSource`, so that we can bind to it. If it's just a plain old `FontIcon`, then we can't re-use it. 

Additionally, I removed the manual sizing of all font icons to font size 12. That would make font icons _tiny_ in the header. Now, they'll properly re-use the size of the `NavigationViewTitleHeaderContentControlTextStyle` in the nav view header. This involved also manually making the icons smaller on the `AddProfile` page and in the `CommandPalette`.

As per usual, images are in Teams


## PR Checklist
* [x] Closes #9694
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed
* Checked (bitmap|font) icons in tabs
* (bitmap|font) icons in the flyout
* (bitmap|font) icons in command palette
* (bitmap|font) icons in the nav view
* (bitmap|font) icons in the header
* (bitmap|font) icons in the add profile page
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels May 13, 2021
DHowett pushed a commit that referenced this issue May 18, 2021
…0124)

This reverts commit a3a2a41.

#10046 causes a crash on save. MainPage::UpdateSettings() is unable to update the navigation view's selected item due to an "incorrect parameter". This is particularly strange to see because #10046 only modifies the navigation view's header, not the menu items themselves. Reverting this change fixes that crash (verified).

Reopens #9694
@DHowett DHowett reopened this May 18, 2021
@DHowett DHowett removed the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label May 18, 2021
@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, 22H2 Jan 4, 2022
@zadjii-msft zadjii-msft removed their assignment May 5, 2022
@zadjii-msft zadjii-msft modified the milestones: 22H2, Backlog Dec 5, 2022
@zadjii-msft zadjii-msft moved this to Should be written in Terminal Walkthroughs Feb 6, 2023
@HimanshuMahto
Copy link

Hey can you assign this to me

@zadjii-msft
Copy link
Member

@HimanshuMahto Let us know if you need any help ☺️

@HimanshuMahto
Copy link

HimanshuMahto commented Oct 18, 2023

Since I'm new to this can you help me @zadjii-msft

@zadjii-msft
Copy link
Member

Sure thing! I'd start by looking at #10046. That was an earlier attempt to do this, which we ultimately reverted in #10124. We had to revert that due to some crash when you saved the settings, but I'm thinking that crash is probably no longer applicable?

Now, the thing is, we've kinda re-written the settings UI since that original PR. It's still structurally pretty much the same, but there's been some minor changes to account for the Windows 11 style differences. You'll probably still want to put the icon in:

<muxc:NavigationView x:Name="SettingsNav"
Background="{ThemeResource SettingsPageBackground}"
IsBackButtonVisible="Collapsed"
IsSettingsVisible="False"
ItemInvoked="SettingsNav_ItemInvoked"
Loaded="SettingsNav_Loaded"
TabFocusNavigation="Cycle">
<muxc:NavigationView.Resources>
<ResourceDictionary>
<Thickness x:Key="NavigationViewHeaderMargin">15,0,0,0</Thickness>
</ResourceDictionary>
</muxc:NavigationView.Resources>
<muxc:NavigationView.Header>
<muxc:BreadcrumbBar x:Name="NavigationBreadcrumbBar"
MaxWidth="{StaticResource StandardControlMaxWidth}"
ItemClicked="BreadcrumbBar_ItemClicked"
ItemsSource="{x:Bind Breadcrumbs}">
<muxc:BreadcrumbBar.ItemTemplate>
<DataTemplate x:DataType="local:Breadcrumb">
<TextBlock Text="{x:Bind Label}" />
</DataTemplate>
</muxc:BreadcrumbBar.ItemTemplate>
<muxc:BreadcrumbBar.Resources>
<ResourceDictionary>
<x:Double x:Key="BreadcrumbBarItemThemeFontSize">28</x:Double>
<Thickness x:Key="BreadcrumbBarChevronPadding">11,4,12,0</Thickness>
<FontWeight x:Key="BreadcrumbBarItemFontWeight">SemiBold</FontWeight>
<x:Double x:Key="BreadcrumbBarChevronFontSize">16</x:Double>
</ResourceDictionary>
</muxc:BreadcrumbBar.Resources>
</muxc:BreadcrumbBar>
</muxc:NavigationView.Header>

@HimanshuMahto
Copy link

HimanshuMahto commented Oct 19, 2023

okay, I got it. hey, Can I get your contact so that I can ask you questions in person if you don't mind? @zadjii-msft

@zadjii-msft
Copy link
Member

To be totally honest - I'd prefer to keep discussion on GitHub. Reasons include (but aren't limited to):

  1. I'm terrible at replying to mails. There's just too much volume, and I'm known to read an email, not immediately reply, then forget about it. I'm somehow better about replying to GitHub
  2. No one should judge anyone for asking questions. Ever. How could anyone ever learn anything without starting by asking questions?
  3. If you have questions about contributing to the Terminal (or really any part of our dev stack here), then chances are, others will too. Better to leave an archive of notes for future people to learn from too ☺️

@HimanshuMahto
Copy link

okay, thanks for the advice.

@HimanshuMahto
Copy link

Hey, @zadjii-msft I'm new to this and don't know how to run and see the changes though I have installed powershell pro tools and powershell in the VS code and did try to run the code but it wasn't showing anything. Can you please help me. I know its a silly question but I don't know how to do it and want to learn want to contribute to this.

@HimanshuMahto
Copy link

HimanshuMahto commented Oct 21, 2023

Hey @zadjii-msft @DHowett @cinnamon-msft need a help

@zadjii-msft
Copy link
Member

@HimanshuMahto Did you try following these steps in the README?

Once you've got the code checked out and the tools installed, the easiest way to test the code is to open up OpenConsole.sln, set the config to
image
(or x86 if you're on an x86 machine for some reason)

and hit the big green play button to start debugging.

@HimanshuMahto
Copy link

Got it @zadjii-msft. Thanks a lot i will start working on it.

@HimanshuMahto
Copy link

Hey, @zadjii-msft, I tried what you said but its still not working.
Screenshot 2023-10-25 210800

@rohiitgit
Copy link

Hii, seems like the last person was unsuccessful at this. Can you assign this to me? It will be my first issue.

@zadjii-msft
Copy link
Member

You can just go ahead and start working on things without necessarily being assigned. Usually we really only use the Assignees field if someone on the core team has to be the one to deal with an issue 😝

@Kore-rep
Copy link

Hi @zadjii-msft, pretty much done with the implementation of this (i.e. just kinda copying your old code across). Did you ever manage to overcome the resolution scaling issues? The font icons look fine, but the powershell icon, when scaled up to a height of 28 looks quite horrible.

@aditya-sahu
Copy link

@Kore-rep Are you still working on this?
Can I start working on this if you're not working?

@zadjii-msft
Copy link
Member

Sorry, I think I missed that earlier message 😅

I never really looked into the image scaling. It sounds like something I looked at briefly, where IconPathConverter always loads icons at a fixed size:

icon.Width(32);
icon.Height(32);

icon.FontSize(12);
icon.Glyph(iconPath);
iconSource = icon;

but I can't be sure. I'd reckon it's probably more valuable to put out a PR with this change as it is now. That'd force our hands to make sure we fix that :P

@Kore-rep Kore-rep linked a pull request Nov 25, 2024 that will close this issue
4 tasks
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Nov 25, 2024
@Kore-rep
Copy link

Hi @aditya-sahu, I've opened a PR with my changes, feel free to make any changes you want to for that. I never resolved the image scaling issue, or did any particular refactoring to make things nicer, its a pretty barebones implementation

#18244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings UI Anything specific to the SUI good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
Status: Should be written
8 participants