The Tab coloring rule dialog lets you conveniently define background and foreground colors for a tab matching specific criteria:
The same rule can be also defined as an XAML Tabs style:
<Style TargetType="TabsStudio:Tab" BasedOn="{StaticResource DefaultTabStyle}"> <Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> <Condition Binding="{Binding Path=Paths, RelativeSource={RelativeSource Self}, Converter={StaticResource RegexMatch},ConverterParameter='WpfApp1'}" Value="True"/> <Condition Binding="{Binding Path=IsTabSelected, RelativeSource={RelativeSource Self}}" Value="True"/> </MultiDataTrigger.Conditions> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop Color="#e87400" Offset="0"/> <GradientStop Color="#0089E1" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property="Foreground"> <Setter.Value> <SolidColorBrush Color="White"/> </Setter.Value> </Setter> </MultiDataTrigger> </Style.Triggers> </Style>
If you have many similar tab coloring rules, instead of using the Tab coloring rule dialog you may consider generating an XAML style programmatically and then copy it to Tabs Studio.
TStyle.zip is a sample project for Visual Studio 2019 using a T4 Text Template that generates 3 styles for a project tab, selected project tab and previously selected project tab given a project path and a base background color. If you want to define these styles for multiple projects, in the tab.tt file just add a path-color pair to the dictionary, save the file and copy generated tab.txt file contents as Tabs style:
<# var rules = new Dictionary<string, string> { {"WebApplication1", "#800000"}, {"WpfApp1", "#e87400"} }; #>
Any chance you could create an add-on that would default auto-coloring for projects by index the way Custom Document Well? I discovered this product due to your posts in the the various VS feature requests since Custom Document Well doesn’t work in VS 2019. I’m interested in purchasing this because I can see that I’d use several of the other features, but I work in several different solutions containing several projects each and that’s a lot of colors to set up. It would be awesome if it had default colors by indexed projects the way that Custom Document Well has by default. That’s the only feature missing that I use from Custom Document Well.
Comment by Jason Seeley — May 1, 2019 @ 7:28 pm
Jason,
With Tabs Studio you can sort and group tabs by project with the Sorter add-in:
https://tabsstudio.com/documentation/addins/sorter.html
And then you can visually separate tabs between different projects using Super groups:
https://tabsstudio.com/documentation/visual_studio_tab_grouping.html#SuperGroup
https://blog.tabsstudio.com/2017/06/06/super-grouping-tabs/
And then you can add the corresponding project name to the first tab in each super group with the SuperName add-in:
https://blog.tabsstudio.com/2018/03/14/super-group-label/
It gives you the exact project name for a tab group instead of a generic color and retains the ability to define
custom colors for specific projects.
Comment by Sergey Vlasov — May 1, 2019 @ 10:52 pm