-
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
Manually select a new tab when we're in fullscreen mode #5809
Merged
DHowett-MSFT
merged 1 commit into
master
from
dev/migrie/b/5799-accidentally-the-whole-thing
May 8, 2020
Merged
Manually select a new tab when we're in fullscreen mode #5809
DHowett-MSFT
merged 1 commit into
master
from
dev/migrie/b/5799-accidentally-the-whole-thing
May 8, 2020
Conversation
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
DHowett-MSFT
approved these changes
May 8, 2020
(do not automerge) |
carlos-zamora
approved these changes
May 8, 2020
DHowett-MSFT
pushed a commit
that referenced
this pull request
May 8, 2020
If we're fullscreen, the TabView isn't `Visible`. If it's not `Visible`, it's _not_ going to raise a `SelectionChanged` event, which is what we usually use to focus another tab. Instead, we'll have to do it manually here. So, what we're going to try to do is move the focus to the tab to the left, within the bounds of how many tabs we have. EX: we have 4 tabs: [A, B, C, D]. If we close: * A (`tabIndex=0`): We'll want to focus tab B (now in index 0) * B (`tabIndex=1`): We'll want to focus tab A (now in index 0) * C (`tabIndex=2`): We'll want to focus tab B (now in index 1) * D (`tabIndex=3`): We'll want to focus tab C (now in index 2) `_UpdatedSelectedTab` will do the work of setting up the new tab as the focused one, and unfocusing all the others. Also, we need to _manually_ set the SelectedItem of the tabView here. If we don't, then the TabView will technically not have a selected item at all, which can make things like ClosePane not work correctly. ## PR Checklist * [x] Closes #5799 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed Played with it a bunch (cherry picked from commit d77745d)
🎉 Handy links: |
jelster
pushed a commit
to jelster/terminal
that referenced
this pull request
May 28, 2020
If we're fullscreen, the TabView isn't `Visible`. If it's not `Visible`, it's _not_ going to raise a `SelectionChanged` event, which is what we usually use to focus another tab. Instead, we'll have to do it manually here. So, what we're going to try to do is move the focus to the tab to the left, within the bounds of how many tabs we have. EX: we have 4 tabs: [A, B, C, D]. If we close: * A (`tabIndex=0`): We'll want to focus tab B (now in index 0) * B (`tabIndex=1`): We'll want to focus tab A (now in index 0) * C (`tabIndex=2`): We'll want to focus tab B (now in index 1) * D (`tabIndex=3`): We'll want to focus tab C (now in index 2) `_UpdatedSelectedTab` will do the work of setting up the new tab as the focused one, and unfocusing all the others. Also, we need to _manually_ set the SelectedItem of the tabView here. If we don't, then the TabView will technically not have a selected item at all, which can make things like ClosePane not work correctly. ## PR Checklist * [x] Closes microsoft#5799 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed Played with it a bunch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area-UserInterface
Issues pertaining to the user interface of the Console or Terminal
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Priority-1
A description (P1)
Product-Terminal
The new Windows Terminal.
Severity-DataLoss
A bug that causes the user's data to be lost, unintentionally
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.
Summary of the Pull Request
If we're fullscreen, the TabView isn't
Visible
. If it's notVisible
, it's not going to raise aSelectionChanged
event, which is what we usually use to focus another tab. Instead, we'll have to do it manually here.So, what we're going to try to do is move the focus to the tab to the left, within the bounds of how many tabs we have.
EX: we have 4 tabs: [A, B, C, D]. If we close:
tabIndex=0
): We'll want to focus tab B (now in index 0)tabIndex=1
): We'll want to focus tab A (now in index 0)tabIndex=2
): We'll want to focus tab B (now in index 1)tabIndex=3
): We'll want to focus tab C (now in index 2)_UpdatedSelectedTab
will do the work of setting up the new tab as the focused one, and unfocusing all the others.Also, we need to manually set the SelectedItem of the tabView here. If we don't, then the TabView will technically not have a selected item at all, which can make things like ClosePane not work correctly.
References
PR Checklist
Validation Steps Performed
Played with it a bunch