-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Added Close Pane to Context Menu #15198
Added Close Pane to Context Menu #15198
Conversation
You're in luck! For You will likely need to run |
Also - any suggestions on what the icon should be @zadjii-msft - https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-ui-symbol-font? |
Yep looks like it! I bet the cmd version wasn't robust enough to be run from outside the solution root directory 🤷 |
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.
As far as icons, maybe e89f
, "ClosePane"? That's not great, since like, you could have a horizontal split, or be closing the left one... Honestly, I think it's okay without one for now.
Update to this comment: The below suggestion I made does not work as ctl + shift + w uses ClosePane --> back to the drawing board :). Does it make sense to call DetachPane instead of ClosePane in the menu item click?
Then in DetachPane it makes sense to me that we would know that only one pane is left.
With these changes it seems like it resolves the edge case you mentioned. I'm very new to the codebase so if this is not quite the way you were thinking this should be implemented let me know :) Not really sure what DetachPane vs. ClosePane does. |
I'm not sure if this is what you were thinking but seems to work ok if the check is in _UpdateActivePane(). |
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.
Personally, I think we should...
- remove the tooltip (doesn't seem useful)
- make the menu item always visible/active (regardless of number of open panes)
Thoughts? Open to discussion/disagreement on this one.
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.
I love this. This is exactly what I'd've done. Thanks for bearing with us!
if (_rootPane->GetLeafPaneCount() == 1) | ||
{ | ||
_closePaneMenuItem.Visibility(WUX::Visibility::Collapsed); | ||
} |
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.
this is infinitely better than before
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.
Yay! Completely new to the project and really appreciate the support and guidance from both you and @carlos-zamora. Excited to try out some new issues too.
FYI, I LOVE the walkthroughs. Makes it way easier to get started for people who aren't as experienced in C++ or the Terminal project :)
Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
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.
Love it. Thanks so much!
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.
Love it, thanks for the contribution @joadoumie !
Summary of the Pull Request
Adding a 'Close Pane' menu item in the context menu.
References and Relevant Issues
#13580
Detailed Description of the Pull Request / Additional comments
If a user decides to split a tab to create multiple panes through the context menu, they should be able to then close the pane via the context menu too. This PR introduces a new context menu item, 'Close Pane', that only appears when a user has 2 or more panes in a tab. When a user clicks close pane, the _active_pane will be closed.
Validation Steps Performed
As it's my first PR, I still need to understand how to go through the testing suite.
PR Checklist