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

[TabView] Fix issue where hitting Ctrl+F4 would not resize tabs #4980

Conversation

marcelwgn
Copy link
Contributor

Description

Fixed this by updating call to UpdateTabWidths on RequestCloseTab.

Motivation and Context

Closes #4971

How Has This Been Tested?

Added new interaction test

Screenshots (if appropriate):

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label May 7, 2021
@beervoley
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@beervoley beervoley added the team-Controls Issue for the Controls team label May 8, 2021
@beervoley beervoley merged commit b83ac1c into microsoft:main May 9, 2021
@ranjeshj ranjeshj removed the needs-triage Issue needs to be triaged by the area owners label May 11, 2021
@zadjii-msft
Copy link
Member

🤔

@beervoley @chingucoding Did this PR only fix this for specifically the built-in ctrl+f4 shortcut? Over in the Terminal, we're closing tabs with tabView.TabItems().RemoveAt

https://github.com/microsoft/terminal/blob/9662bc69102e2e152a062a9060cb63d2742582d3/src/cascadia/TerminalApp/TabManagement.cpp#L511

and that doesn't seem fixed in 2.7. See microsoft/terminal#9822. Should we get #4971 reopened, or should I file a new issue?

@beervoley
Copy link
Contributor

beervoley commented Oct 25, 2021

@zadjii-msft @chingucoding looks like we're not always calling UpdateTabWidths() in the scenario of underlying tab collection change.

if (TabWidthMode() == winrt::TabViewWidthMode::Equal)
{
m_updateTabWidthOnPointerLeave = true;
if (args.Index() == TabItems().Size())
{
UpdateTabWidths(true, false);
}

If the Tab was deleted manually, we only call UpdateTabWidths() if the last Tab was removed. I can't remember why we did it this way :(
@chingucoding would you like to submit a fix for this? should be pretty straightforward:)

@marcelwgn marcelwgn deleted the user/chingucoding/tabview-ctrl+f4-notresizing-tabs branch October 25, 2021 19:07
@marcelwgn
Copy link
Contributor Author

Sure thing, I'll take a look at this @beervoley and @zadjii-msft !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TabView team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remaining tabs are not resized when closing tabs with keyboard
4 participants