Tabs Studio Blog (organizing Visual Studio document tabs)

September 17, 2012

Smart suggestions for tab coloring

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 4:20 pm

I’ve added suggestions to the Tab Coloring Rule dialog. Each field in the dialog now has a corresponding samples button that lets you quickly define tab coloring rules:

Tab Coloring Rule dialog with suggestion buttons

Tab Coloring Rule dialog with suggestion buttons

Let me remind you, that you can start adding a tab coloring rule from two places. From the tab context menu Set color… command and from the Tabs Studio Presentation options page. In the first case the suggestions will be tailored for the tab you selected to color and in the second case all open tabs appear in the suggestions.

For example, Project name regex suggestions for the selected tab contain tab’s project:

Project name regex suggestions for the selected tab

Project name regex suggestions for the selected tab

Selecting the exact match sets the regex to ^WpfApplication1$ and selecting the Contains option sets the regex to WpfApplication1. While you rarely have other projects containing selected project name, it shows how easily you can set the regex for example to Wpf and have a distinct color for all your WPF projects.

If you opened the dialog from Tabs Studio options, all project names from all open tabs appear in the suggestions. The names are alphabetically sorted and the first name has the prebuild regex for the exact match:

Project name regex suggestions for all tabs

Project name regex suggestions for all tabs

I should clarify that while suggestions are different for one tab and all tabs, the rule created works exactly the same. All that matter is actual text in a regex filed.

Tab extensions regex suggestions show extensions from the selected tab or from all tabs:

Tab extensions regex suggestions

Tab extensions regex suggestions

Coloring by file extension can also be done using Document paths regex, but only with the tab extensions regex you can target tabs like [Design]. Selecting an extension suggestion creates a regex like \.vb \[Design]\$. All special regex characters are automatically escaped (it works for all regex fields). \$ forces exact match on extension end.

Tab name regex suggestions work like Project name regex suggestions and Document paths regex suggestions work like Tab extensions regex suggestions.

Custom conditions suggestions show most common currently available tab properties (with current values in one tab mode):

Custom conditions suggestions

Custom conditions suggestions

The list of suggestions is filtered depending on what version of Visual Studio you are running, active Tabs Studio add-ins and whether you have one or more tab groups open. Selecting a suggestion adds a condition like <ConditionX IsTabSelected=”True”/>. It is a shortened form that I use only for this text edit control. The normal form of a WPF MultiDataTrigger condition (that I restore on dialog save) is this:

<Condition Binding="{Binding Path=IsTabSelected, RelativeSource={RelativeSource Self}}" Value="True"/>

Finally, Background suggestions let you select a template for a gradient or solid color brush:

Background suggestions

Background suggestions

2 Comments

  1. Bloody hell Sergey! When you’re given an idea you really run with it, don’t you? I’ll be playing with this later today.

    Comment by Stuart Hemming — September 17, 2012 @ 4:28 pm


RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Blog at WordPress.com.