Tabs Studio Blog (organizing Visual Studio document tabs)

December 16, 2011

Dark theme for Visual Studio 2010

Filed under: Uncategorized — Tags: , — Sergey Vlasov @ 12:32 pm

If you like the original Visual Studio 2010 tabs theme you can use the excellent Visual Studio 2010 style for Tabs Studio by Jameel Al-Aziz. But, as this style changes many aspects of tabs presentation, it also overrides custom colors that you assign with tab coloring rules in Tabs Studio presentation options. (Of course, you can implement all coloring rules as style rules, it just requires working directly with XAML). Below is a simple style that closer to the overall Visual Studio 2010 theme and still supports additional tab coloring rules.

The following style changes tab text color from default black to white for not selected and not highlighted tabs:

<Style TargetType="TabsStudio:TabName" BasedOn="{StaticResource DefaultTabNameStyle}">
  <Style.Triggers>
  <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType=TabsStudio:Tab}}" Value="False"/>
                <Condition Binding="{Binding Path=IsTabSelected, RelativeSource={RelativeSource AncestorType=TabsStudio:Tab}}" Value="False"/>
            </MultiDataTrigger.Conditions>
            <Setter Property="Foreground" Value="White"/>
      </MultiDataTrigger>
  </Style.Triggers>
</Style>

<Style TargetType="TabsStudio:TabExtension" BasedOn="{StaticResource DefaultTabExtensionStyle}">
  <Style.Triggers>
  <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType=TabsStudio:Tab}}" Value="False"/>
                <Condition Binding="{Binding Path=IsTabSelected, RelativeSource={RelativeSource AncestorType=TabsStudio:Tab}}" Value="False"/>
            </MultiDataTrigger.Conditions>
            <Setter Property="Foreground" Value="White"/>
      </MultiDataTrigger>
  </Style.Triggers>
</Style>

<Style TargetType="TabsStudio:TabNameModificationMarker" BasedOn="{StaticResource DefaultTabNameModificationMarkerStyle}">
  <Style.Triggers>
  <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType=TabsStudio:Tab}}" Value="False"/>
                <Condition Binding="{Binding Path=IsTabSelected, RelativeSource={RelativeSource AncestorType=TabsStudio:Tab}}" Value="False"/>
            </MultiDataTrigger.Conditions>
            <Setter Property="Foreground" Value="White"/>
      </MultiDataTrigger>
  </Style.Triggers>
</Style>

<Style TargetType="TabsStudio:TabExtensionModificationMarker" BasedOn="{StaticResource DefaultTabExtensionModificationMarkerStyle}">
  <Style.Triggers>
  <MultiDataTrigger>
            <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType=TabsStudio:Tab}}" Value="False"/>
                <Condition Binding="{Binding Path=IsTabSelected, RelativeSource={RelativeSource AncestorType=TabsStudio:Tab}}" Value="False"/>
            </MultiDataTrigger.Conditions>
            <Setter Property="Foreground" Value="White"/>
      </MultiDataTrigger>
  </Style.Triggers>
</Style>

Plus you need to create a tab coloring rule for not selected tabs with transparent background:

<SolidColorBrush Color="Transparent"/>

Transparent background for not selected tabs

Transparent background for not selected tabs


It is very important that this rule be the first one in your tab coloring rules so that additional tab coloring rules could override it with custom colors. Below is the new tabs look:
Dark tabs theme in Visual Studio 2010

Dark tabs theme in Visual Studio 2010


Now you can for example set a specific color for a project with Tab coloring rules. As tab text is white, you need to use dark colors for background or use normal colors with transparency (to set transparency level, use the Opacity slider in the Color Picker dialog):
Project tab coloring rule with transparency

Project tab coloring rule with transparency


Dark theme with custom transparent colors for two projects

Dark theme with custom transparent colors for two projects


Additionally you can set selected but unfocused tab background to gray as in the original Visual Studio 2010 theme:

<Condition Binding="{Binding Path=IsGroupFocused, RelativeSource={RelativeSource Self}}" Value="False"/>
<Condition Binding="{Binding Path=IsGroupWithLastActiveDocument, RelativeSource={RelativeSource Self}}" Value="True"/>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  <GradientStop Color="#FFFDFDFD" Offset="0"/>
  <GradientStop Color="#FFD5DAE3" Offset="0.49"/>
  <GradientStop Color="#FFCED4DF" Offset="0.5"/>
  <GradientStop Color="#FFCED4DF" Offset="1"/>
</LinearGradientBrush>

Gray color rule for selected but unfocused tab

Gray color rule for selected but unfocused tab


Gray selected tab when Solution Explorer is active

Gray selected tab when Solution Explorer is active

Update: Added white color to modification markers in the style.

July 25, 2011

Favorite Documents

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 9:42 am

If you often work on different parts of an application with different groups of document tabs opened, you may find my new Favorite Documents extension helpful:

Favorites menu in Visual Studio 2010

Favorites menu in Visual Studio 2010

Favorite Documents lets you create links to frequently used code files and then quickly open them as a group or individually from the Favorites menu in Visual Studio 2010.

Home page: Favorite Documents.
Direct download link: Favorite Documents v1.0.

March 17, 2011

Turning off Document Well 2010 Plus

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 11:31 am

Document Well 2010 Plus is another tab extension for Visual Studio 2010 that comes as a part of Productivity Power Tools. Tabs Studio hides Well tabs along with original Visual Studio tabs, so it is highly recommended to just turn Document Well 2010 Plus off:

Document Well 2010 Plus turned off

Document Well 2010 Plus turned off

As Well is a part of the big Productivity Power Tools package that can be installed for other extensions, it can be left in the default on state and interfere with Tabs Studio. To warn a developer about a possible conflict, I’ve added the explicit check for Well presence to the Tabs Studio startup procedure. This is the warning displayed when Tabs Studio detects installed and activated Document Well 2010 Plus:

Tabs Studio conflicts with Document Well 2010 Plus warning

Tabs Studio conflicts with Document Well 2010 Plus warning

March 16, 2011

Debugging add-ins for Tabs Studio in VS 2010 SP1

Filed under: Uncategorized — Tags: , — Sergey Vlasov @ 6:57 pm

If you need to debug your own add-in for Tabs Studio or an existing one (all Tabs Studio add-ins come with source code) you can do it with the following steps (from the add-ins documentation):

  1. Remove your add-in from the TabsStudioAddins directory and start VS.
  2. In your add-in project set the Build – Output path to your TabsStudioAddins directory
    (e.g. C:\Users\myadmin\Documents\Visual Studio 2008\Addins\TabsStudioAddins).
  3. In your add-in project set Debug – Start external program to VS
    (e.g. C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe).
  4. Start Debugging as usual.

Well, you can do it with VS 2008 and VS 2010 RTM, but not with VS 2010 SP1. I read about this in the VS 2010 SP1 breaks add-in debugging targeting .NET Framework 2.0 blog post by Carlos Quintero. Tabs Studio add-in targets .NET 3.5 and thus also affected by this problem.

The first workaround is to retarget your add-in to .NET 4.0 (of course, this add-in will no longer work in VS 2008 after that). You will also need to add System.Xaml to assembly references:

Setting target framework for an add-in to .NET Framework 4

Setting target framework for an add-in to .NET Framework 4

The second workaround is to create a dummy project targeting .NET Framework 4 and use it as the startup target for debugging (looks like VS 2010 SP1 is only interested in the target framework of the startup project, not the executable under debug):

Adding a new dummy project targeting .NET Framework 4

Adding a new dummy project targeting .NET Framework 4


Setting the dummy StartUp project to start VS 2010 IDE

Setting the dummy StartUp project to start VS 2010 IDE


You can also up vote this issue on the Microsoft Connect site.

March 9, 2011

Visual Studio 2010 Service Pack 1 support

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 6:11 pm

Visual Studio 2010 Service Pack 1 released this week (list of fixes). Nothing has changed in default tabs behavior and Tabs Studio works in the latest IDE just fine:

Tabs Studio in Visual Studio 2010 Service Pack 1

Tabs Studio in Visual Studio 2010 Service Pack 1

February 27, 2011

Disabling document floating on tab double click in Visual Studio 2010

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 1:31 pm

I was asked to “disable change float (undock) tab on mouse double click”. I added this feature the last summer, copying the default Visual Studio 2010 behavior. But accidental double click on a tab is a problem (e.g. read Turn off double-click undock in VS2010, How To Disable Floating Windows? and How to disable floating tabs in Visual Studio 2010).

I’m planning to disable floating on double click in the next Tabs Studio release. For those who find this feature useful, I can reintroduce it as a separate add-in. Please, comment if you feel pro or against this feature.

February 26, 2011

Horizontal tab alignment

Filed under: Uncategorized — Tags: , — Sergey Vlasov @ 9:07 pm

In Visual Studio 2010 horizontal tab alignment is a little off, note the close tab button is near the tab name instead of being docked to the right:

Left tab alignment in Visual Studio 2010

Left tab alignment in Visual Studio 2010


In Visual Studio 2008 and even in the Visual Studio 2010 floating tool window tab alignment is correct:
Stretch tab alignment in the floating Visual Studio 2010 tool window

Stretch tab alignment in the floating Visual Studio 2010 tool window


Turns out horizontal tab alignment is Stretch by default in TabItem‘s control template, but also inherited from the HorizontalContentAlignment property of a ItemsControl visual ancestor. Tabs Studio doesn’t use ItemsControl (this is why in Visual Studio 2008 and in the separate Visual Studio 2010 window tab alignment is correct), but there is ItemsControl with HorizontalContentAlignment=Left in Visual Studio IDE that is found when tabs are above the code editor.

I’ve added ItemsControl to Tabs Studio controls tree:

TabsHost : ContentControl
|
 - TabsItemsControl : ItemsControl
   |
    - Tabs : Panel
     |
      - Tab : TabItem

With the default style:

<Style x:Key="DefaultTabsItemsControlStyle0" TargetType="TabsStudio:TabsItemsControl">
  <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>

In the next Tabs Studio release, horizontal tab alignment is Stretch by default in all scenarios:

Fixed stretch tab alignment in Visual Studio 2010

Fixed stretch tab alignment in Visual Studio 2010


If you prefer old left alignment, you will be able to set it with the following custom style:

<Style TargetType="TabsStudio:TabsItemsControl" BasedOn="{StaticResource DefaultTabsItemsControlStyle}">
  <Setter Property="HorizontalContentAlignment" Value="Left"/>
</Style>

June 28, 2010

NewGroup add-in for VS 2010

Filed under: Uncategorized — Tags: , — Sergey Vlasov @ 8:29 pm

I’m often asked about the missing New horizontal/vertical tab group commands in the Tabs Studio context menu. Due to technical difficulties I can’t come up with a good overall solution for it, but now that Visual Studio 2010 introduces two new Window.NewHorizontalTabGroup and Window.NewVerticalTabGroup commands I can solve the most common case with an add-in:

New tab group commands

New tab group commands

The NewGroup add-in adds the New horizontal/vertical tab group commands to the Tabs Studio context menu for the selected tab/extension if commands are available. For example, the New horizontal tab group command is not available when vertical tab groups already created and both commands are not available when there is only one tab in a selected group. In Tabs Studio you can open a tab context menu without making the tab selected – in this case the two new commands are not shown as it is much harder to determine if they should be available in this case.

Download the NewGroup add-in for VS 2010.

June 23, 2010

Running add-ins from a network location in Visual Studio 2010

Filed under: Uncategorized — Tags: , — Sergey Vlasov @ 11:07 am

.NET runtime traditionally has strict rules against running managed code from a network. In Visual Studio 2008 (CLR v2) to run Tabs Studio from a network share you had to add special “Code Access Security Policy”.

In Visual Studio 2010 (CLR v4) if you try to run Tabs Studio v2.0.5 from a network share you get error number 80131515:

Tabs Studio add-in failed to load with error 80131515 in VS 2010

Tabs Studio add-in failed to load with error 80131515 in VS 2010


To allow Tabs Studio to run you have to add the loadFromRemoteSources element (see the MSDN reference) to the “C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config” (note, you need to run your editor with admin rights for correct devenv.exe.config modification):

<configuration>
   <runtime>
      <loadFromRemoteSources enabled="true"/>
   </runtime>
</configuration>

Plus you have to upgrade to Tabs Studio v2.0.6 that workarounds Assembly.Location throws ArgumentException.

Another potential problem is when you download Tabs Studio add-ins to your computer for Visual Studio 2010 from the Internet they may end up blocked by Windows (it is not a problem for Visual Studio 2008):

Saver add-in marked as a file from another computer

Saver add-in marked as a file from another computer


Loading such add-in for VS 2010 silently fails in Tabs Studio v2.0.5 and gives the following error in Tabs Studio v2.0.6:
Blocked Saver add-in loading error in VS 2010

Blocked Saver add-in loading error in VS 2010


To solve this problem you can either unblock Saver.dll in Windows Explorer or enable the loadFromRemoteSources switch in devenv.exe.config the same way as for running Tabs Studio from a network share.

 

 

Organize Visual Studio tabs with Tabs Studio add-in

June 10, 2010

Document Well 2010 Plus explained by the author

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 6:57 pm

Radames Cruz Moreno thoroughly describes all the new tab features that are part of the Visual Studio 2010 Pro Power Tools on the Visual Studio Blog.

Older Posts »

Blog at WordPress.com.