-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Feature Request: allow to pick the color of the tabs #2994
Comments
If the Tabs are to be given Context Menus #1912 with Close, Rename options etc - this could be a Sub Menu Flyout |
I really like this idea. I'd note that doing this based on the working directory of the child process might just be impossible, but just setting the color isn't a bad idea. I'm also wary of doing anything to write the settings file currently, so I'd definitely lean towards an initial implementation only setting the color at runtime, and not persisting it. Sure, we'll be back in the business of writing the settings file when we have a proper Settings UI (#1564), but lets just avoid that for now. Maybe later we could add an optional "make this change temporary" checkbox that lets the user persist the changes. I'd also add that personally, I'd reject any PR if it didn't also include a "choose my own color" option. I hate when I have to pick from an application's palette of colors. It's 2019. There are 16.7 million colors to chose from, not 16. 16 colors can be a good suggestion, but sometimes I just want more than 3 blues 😝 Related:
I do feel however that this might be something that's better suited for an inevitable extensibility model. Maybe we could incorporate it directly temporarily, then later move to an external extension. It certainly seems to hit on a few good extension requirements:
It would certainly be a good case study IMO. I'm going to tag it up for that purpose. |
This is largely similar to #1337, which had another issue about right-clicking a tab to set its color duped into it, but it puzzlingly has no mention of that functionality. |
Yea I see that. Considering we left "add a setting to change the tab title" and "add a menu to change the tab title at runtime" as separate issues, I felt this could stand on its own as well. |
Also slightly related: #1868. |
Hello folks, @zadjii-msft Yes, I'm going to implement the simple scenario. I haven't looked at the code, but I assumed that is quite likely that the terminal is not aware where or what the shell, which it is hosting, is doing. No settings involved, you can simply set the color for the session and that is.
I take it that you currently do not have a plugin or similar system in place, correct? Also, agreed - there must be an option to pick your own color (maybe you can talk to the OneNote guys about this - this is where the screenshot comes from 😉 ) @DHowett-MSFT I searched for I'm going to try to drop you a PR next week, it is Hactoberfest and all :) Regards |
WinUI includes a colour picking control, you would have to handle opening a dialog with the control in for any custom colour. |
Just wondering: Do you guys think it makes sense for the 16 initially offered colors to be the configured palette colors of the given terminal? This is probably by far not the best set of 16 colors per se, but gives a more consistent overall appearance, and are colors that users can mentally connect to existing contexts within the terminal. They would also auto-follow the user's preference regarding the color palette, including more exotic ones such as Solarized, on a per-tab basis. To second zadjii, I agree that there should be a way to pick any of the 16M colors. Probably even offer a shorthand for several LRU ones. |
@egmontkob That's certainly where I'd start with this feature, though I'm not really qualified to be a UX designer 😜 |
Me neither 😜 |
@egmontkob I think eventually you want the Tab colour to be stored in the settings, but they want to implement it first without making it persist. I don't think you need to store more than the one colour, so adding 16 colours to every profile's settings, is probably overkill, and not useful |
It's unclear to me how this could be stored in settings. As far as I understand, the whole point is to make individual terminals (that otherwise probably use the same profile) more easy to distinguish via a quick user action. The settings define the look and behavior of profiles, not individual terminals of the same profile.
That's not what I meant; I meant to offer the 16 colors that are already defined for a profile as its basic colors (either explicitly, or by using the defaults). I agree that defining 16 colors purely for a tabcolor chooser would be an overkill. |
@egmontkob Ok I get you know. You want the default colours offered to be pulled from the profile. |
I don't want it, I threw this in as an idea :) |
Hi everybody, If I try to right click the tab or click the split button to choose a tab profile, if I'm debugging, I'm getting the following exception:
But if I try to run the program without the debugger, I can see the menu flyouts displayed properly. Do you have any tips whether or not this exceptions could be avoided, when I start the program from within Visual Studio? Overall I have terrible experience building and running the project :( |
It turns out that #3027 didn't fix this, so I'll see if we can't get a followup filed on the MUX team. |
Alright @DHowett-MSFT thank you very much for reponding and checking :) |
Hello folks, thank you very much for the kind feedback and suggestions. I just want to give you a heads up that - no, I'm not dead and I did not give up on this feature. But I have my job and private stuff I need to take care of, so I think you understand. I'm going to try to submit a work in progress PR next week, so that you can take a look at. What is the current situation:
I've already thought about the Firefox way of highlighting the selected tab, as @ShiromMakkad suggested, but the problem is I'm not sure how to implement it. I also tried to use a Gradient Brush with a very sharp gradient to emulate this effect, but it looks terrible. Maybe a solution would be to paint the frame of the whole window in the tab's color, see for example the tabs of the stash in Path of Exile: As for the question of @DHowett-MSFT (how do I change the tab item) - I simply push some colors in the resource dictionary of the TabViewItem (e.g. TabViewItemHeaderBackground) and switch the visual state using the VisualStateManager, so that the changes are reflected immediately. Even if I remove the visual state code, the weird issue persists. Another question, the branch of my repo is based on your master branch. Is this correct, or I should've taken another branch? I think this is all for now. Best regards |
Glad to hear you're not dead 😜 So, in my opinion, it's probably better to get this checked-in in it's current state, and continue to iterate on the design in future releases. We can work with @teaP and other XAML folks to help us style it as an underline/overline on the tab later, but it's probably best to get the fundamentals there now. |
PR is dropped, as promised. |
- remove redundant files - disable the alpha settings in the color picker - move the winrt/Windows.UI.Popups.h to pch.h - move the VisualState switching code to a helper method - use weak ptr in the color pickup flyout - use weak_ptr in lambdas instead of [this]
- add color helper class for converting colors, calculating luminance, etc. - paint the tab row when a tab's color changes - paint the title bar when a tab's color changes - remove spurious orig files
…ft#2994 Co-Authored-By: Mike Griese <migrie@microsoft.com>
This commit introduces a context menu for Tab and a new item, "Color...", which will display a color picker. A flyout menu, containing a custom flyout, is attached to each tab. The flyout displays a palette of 16 preset colors and includes a color picker. When the user selects or clears color, an event is fired, which is intercepted by the tab to which the flyout belongs. The changing of the color is achieved by putting the selected color in the resource dictionary of the tab, using well-defined dictionary keys (e.g. TabViewItemHeaderBackground). Afterwards the visual state of the tab is toggled, so that the color change is visible immediately. Custom-colored tabs will be desaturated (somewhat) by alpha blending them with the tab bar background. The flyout menu also contains a 'Close' flyout item. ## Validation Steps Performed I've validated the behavior manually: start the program via the start menu. Right click on the tab -> Choose a tab color. The color flyout is going to be shown. Click a color swatch or click 'Select a custom color' to use the color picker. Use the 'Clear the current color' to remove the custom color. Closes #2994. References #3327.
🎉This issue was addressed in #3789, which has now been successfully released as Handy links: |
Description of the new feature/enhancement
Hello everybody, I think it is a good idea to give the user the possibility to pick colors of the currently opened tabs. The use case is the following: I use command line git and I work on multiple projects in parallel. This means that I have multiple tabs, each for a different git repo.
I want to be able to differentiate at a quick glance which tab is for which folder/repo/project/whatever and a tab color (if I can set one) is very strong visual cue.
For example, Visual Studio Code has the Peacock extension, which gives you the possibility to color your editors differently, according to the project you are currently working on.
Visual Studio has similarly SolutionColor
Proposed technical implementation details (optional)
What I imagine is that, if the user does a right click on a tab, a menu is shown, with an element called 'Choose a color' or something similar. When the element is clicked, a simple color picker (ala OneNote) is displayed:
Then there are two possibilities:
If this is interesting to you, I would like to try to implement it. What are your thoughts?
Regards
The text was updated successfully, but these errors were encountered: