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 support to show close button for active tab only. #15237

Conversation

kovdu
Copy link
Contributor

@kovdu kovdu commented Apr 25, 2023

This MR introduces activeOnly for the showCloseButton theme option causing the close button only to appear on the active tab.

This is more or less following the approach explained here https://github.com/orgs/microsoft/projects/686/views/2?pane=issue&itemId=19775774 which indeed just works 😄 .

You notice when switching theme the close buttons is back on all tabs again as well.

Closes #13672

I didn't check specific unit tests for this. I hope by making this MR the pipeline will show if I broke something. Or just let me know if you want me to add something specific for this.

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Task It's a feature request, but it doesn't really need a major design. Area-Theming Anything related to the theming of elements of the window Product-Terminal The new Windows Terminal. labels Apr 25, 2023
@kovdu kovdu changed the title 13672: Add support to show close button for active tab only. Add support to show close button for active tab only. Apr 26, 2023
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Yep that's literally how I'd do it 😝 Thanks!

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

Love it! Thanks for the contribution! Please be sure to...

Verified that this works if you change the showCloseButton setting via hot reload.

src/cascadia/TerminalApp/TerminalPage.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
@carlos-zamora
Copy link
Member

Demo

Small demo of the result:
active_only

NOTE: removed the demo from the PR body so that the commit history is a bit cleaner

@carlos-zamora
Copy link
Member

@kovdu I'm not going to merge this yet to give you some time to apply/respond to my comments, but the PR is good to go! Again, thanks for the contribution!

@kovdu
Copy link
Contributor Author

kovdu commented May 3, 2023

Thanks for the feedback @carlos-zamora .

Fixed your remarks, updated profiles.schema.json to reflect the new option and created an MR for updating the documentation as well: MicrosoftDocs/terminal#660. Not sure what the process is to get that one merged though.

Also verified the new value is correctly applied when hot reloading the settings file.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label May 3, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot merged commit 18d4f1a into microsoft:main May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Theming Anything related to the theming of elements of the window 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. Product-Terminal The new Windows Terminal. zBugBash-Consider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tab.closeButton: activeOnly
3 participants