Move terminal icon picker position to relevant terminal tab#212174
Move terminal icon picker position to relevant terminal tab#212174albarv340 wants to merge 5 commits intomicrosoft:mainfrom
Conversation
|
@microsoft-github-policy-service agree |
|
Well the question is if i try to update the color it opens up at the top and if I try to update the icon it is opening near the terminal tab, why two different choices? |
|
Like @abhijit-chikane has expressed his concern we should probably change the position of the terminal icon colour change tab as well if not it might look weird where one shows the position on bottom and the other on top . |
|
@Narendherraj, it's been a few months. I'm gonna take over @albarv340 's changes, rebase and change the location of the colour picker. I don't think it's fair to just copy the commits line by line, but I don't see any other way. I'll make sure to credit albarv What do you think? |
|
Also, I tested these changes, and this only works when there are multiple terminal tabs, when there is just one the picker goes back to the top of the window |
c232359 to
bc185d2
Compare
@Tyriar I think you should take my comment into consideration |
| // Force a rerender to make the position correct | ||
| setTimeout(() => { | ||
| window.dispatchEvent(new Event('resize')); | ||
| }, 10); |
There was a problem hiding this comment.
I can't seem to get the double scroll bars, but I do agree that the resize event is an ugly solution. I found what caused the problem and "fixed" it. There was a check for whether the hover was going beyond the window, but it seems to not account for something and falsely deemed the hover to be outside the window and thus moving it away from the target. When I subtracted the height of the hover in that comparison (or removed the check entirely) the issue of the placement disappeared.


Fixes #211083
This moves the icon picker to always point to the terminal being affected by the icon change. If triggered via the command palette, the active tab is pointed to, since it is the one changing. If triggered via the terminal tab, it points to the terminal tab that is being changed.
Examples:

Change Icon was clicked on bash 1:
Triggered via action bar with bash 3 active:
