Tabs Studio Blog (organizing Visual Studio document tabs)

February 28, 2011

Open all corresponding files at once

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

If you use large tab groups, for example with test classes, you may find the new OpenAll add-in useful. OpenAll adds the new Open all context menu command to open all available corresponding files at once:

Open all context menu command

Open all context menu command


All corresponding files opened

All corresponding files opened


Download link: OpenAll v1.0.1.

February 27, 2011

No default SSMS tab grouping

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 9:17 pm

The most frequent support question I receive is how to work with tabs in SQL Server Management Studio. To improve the first impression for Tabs Studio in SSMS, I’ve decided to disable default SSMS tab grouping:

No tab grouping in SSMS by default

No tab grouping in SSMS by default


If you want tab grouping, two sample expressions equal to the default regex in previous releases are readily available:
SSMS tab grouping snippets

SSMS tab grouping snippets

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>

February 25, 2011

Selected tab overlay

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 3:23 pm

If you use custom colors for your tabs, for example, different colors for tabs from different projects, what do you do with the selected tab from a particular project? In the simplest setup you create a project coloring rule that excludes the selected tab and the selected tab looks the same no matter which project it belongs to:

Tab coloring rule for the WpfApplication5 project

Tab coloring rule for the WpfApplication5 project


Tab coloring rule for the WpfApplication6 project

Tab coloring rule for the WpfApplication6 project


Selected tab from the WpfApplication5 project

Selected tab from the WpfApplication5 project


Selected tab from the WpfApplication6 project

Selected tab from the WpfApplication6 project

If you get used to project colors, you may want to show selected tab’s project too. You can add an additional selected tab rule for each project:
Tab coloring rule for the selected tab in the WpfApplication5 project

Tab coloring rule for the selected tab in the WpfApplication5 project


Selected tab from the WpfApplication5 project showing project's color

Selected tab from the WpfApplication5 project showing project's color


The obvious disadvantage is that now you have to provide two coloring rules for each project (three rules if you use distinct color for the previously selected tab too). It would be nice to specify a selected tab overlay only once. Tabs Studio doesn’t currently support coloring rule overlays or rule combinations, but you can use a custom style for the TabInternals element to achieve the same result. First you change the tab coloring rules for the WpfApplication5 and WpfApplication6 projects to include the tab selected state:
Tab coloring rule for the WpfApplication5 project including the tab selected state

Tab coloring rule for the WpfApplication5 project including the tab selected state


Then add the following custom style:
Simple TabInternals overlay for the selected tab

Simple TabInternals overlay for the selected tab


Now this overlay works for all projects, but the red bar has some undesired padding around it. To remove this padding we remove Tab‘s padding, add TabNameGroup‘s left padding and add CloseTabButton‘s right padding (note that you need to uncomment one of the three CloseTabButton styles depending on your close tab button presentation setting):

<Style TargetType="TabsStudio:TabInternals" BasedOn="{StaticResource DefaultTabInternalsStyle}">
  <Setter Property="Margin" Value="-1,-1,-1,0"/>
  <Style.Triggers>
    <Trigger Property="IsTabSelected" Value="True">
      <Setter Property="Background">
      <Setter.Value>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
          <GradientStop Color="Red" Offset="0"/>
          <GradientStop Color="Transparent" Offset="0.3"/>
        </LinearGradientBrush>
      </Setter.Value>
      </Setter>
    </Trigger>
  </Style.Triggers>
</Style>

<Style TargetType="TabsStudio:Tab" BasedOn="{StaticResource DefaultTabStyle}">
  <Setter Property="Padding" Value="0,0,0,1"/>  
</Style>

<Style TargetType="TabsStudio:TabNameGroup" BasedOn="{StaticResource DefaultTabNameGroupStyle}">
  <Setter Property="Margin" Value="5,0,0,0"/>  
</Style>

<!--Close tab button: Show on selected tab-->
<Style TargetType="TabsStudio:CloseTabButton" BasedOn="{StaticResource DefaultCloseTabButtonStyle}">
  <Setter Property="Margin" Value="2,0,1,0"/>
  <Style.Triggers>
    <Trigger Property="IsTabSelected" Value="False">
      <Setter Property="Width" Value="4"/>
      <Setter Property="Visibility" Value="Hidden"/>
    </Trigger>
  </Style.Triggers>
</Style>

<!--Close tab button: Show on all tabs-->
<!--<Style TargetType="TabsStudio:CloseTabButton" BasedOn="{StaticResource DefaultCloseTabButtonStyle}">
  <Setter Property="Margin" Value="2,0,1,0"/>
</Style>-->

<!--Close tab button: Don't show-->
<!--<Style TargetType="TabsStudio:CloseTabButton" BasedOn="{StaticResource DefaultCloseTabButtonStyle}">
  <Setter Property="Width" Value="9"/>
  <Setter Property="Visibility" Value="Hidden"/>
  <Style.Triggers>
    <Trigger Property="IsTabSelected" Value="False">
      <Setter Property="Visibility" Value="Hidden"/>
    </Trigger>
  </Style.Triggers>
</Style>-->
Final selected tab overlay

Final selected tab overlay

February 23, 2011

Testimonials

Filed under: Uncategorized — Sergey Vlasov @ 11:18 am

I’ve created the Tabs Studio testimonials page. If you want to share your opinion about Tabs Studio with the developer community, review Tabs Studio at the Microsoft Visual Studio Gallery site or write me an e-mail!

February 18, 2011

Closing tabs to the right

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 12:35 pm

Another feature from web browsers that you may be familiar with – a context menu command to close all tabs to the right of the selected tab. You can now have it in Tabs Studio with the new CloseRight add-in:

Close tabs to the right context menu command

Close tabs to the right context menu command

Download link: CloseRight v1.0.0.

February 17, 2011

Tabs Studio v2.2.7 released

Filed under: Releases — Sergey Vlasov @ 9:05 pm

Tabs Studio v2.2.7 released: fixed absence of the file save dialog when closing a modified xaml file, fixed TypeInitializationException during debugging when dragging the DataSet Visualizer over tabs.

Download link: Tabs Studio v2.2.7.

Opening a new tab next to the current one

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 8:56 pm

Many Internet browsers give you an option to open a new tab next to the current one. If you like this behavior you can now have it in Tabs Studio with the new OpenNext add-in. OpenNext doesn’t have any options and just changes default placement for a new tab from the right end to the right of the active tab.

Download link: OpenNext v1.0.0.

Blog at WordPress.com.