Tabs Studio Blog (organizing Visual Studio document tabs)

May 18, 2009

Document and non document tabs

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

One way to differentiate tabs is by document/non document property. Document tabs are source files, designers and resources. Non document tabs are Start Page, Class View, Object Browser etc. I’ve added IsDocument property to all tab controls reflecting this dichotomy. Default style doesn’t use this property.

Custom style that sets different color for non document tabs should also take into account conditions when non document tab is selected and when non document tab was previously selected. It is possible to set different color for each case. It is also possible to use custom color for non document tab only if it is not selected and was not previously selected, as demonstrated in the following example:

<Style TargetType="TabsStudio:Tab" BasedOn="{StaticResource DefaultTabStyle}">
    <Style.Triggers>
        <MultiTrigger>
            <MultiTrigger.Conditions>
                <Condition Property="IsDocument" Value="False"/>
                <Condition Property="IsTabSelected" Value="False"/>
                <Condition Property="IsPreviouslySelectedTab" Value="False"/>
            </MultiTrigger.Conditions>
            <Setter Property="Background">
                <Setter.Value>
                     <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                         <GradientStop Color="#F5F5F5" Offset="0"/>
                         <GradientStop Color="#B0D0B0" Offset="1"/>
                     </LinearGradientBrush>
                </Setter.Value>
            </Setter>  
        </MultiTrigger>
    </Style.Triggers>
</Style>
Custom color for non document tab

Custom color for non document tab

Previously Selected Tab Command

Filed under: Uncategorized — Sergey Vlasov @ 5:16 am

After I wrote that Ctrl+Tab not always switches to previously selected tab it became obvious that I need to add special command for this functionality. I called it TabsStudio.Connect.PreviouslySelectedTab. Recommended shortcut – Ctrl+’ (if your keyboard layout has ‘ key above Tab key like mine does).

May 17, 2009

Previously Selected Tab

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 2:09 pm

When many tabs are opened they are not used equally. Some are used more often, some have been used recently. It would be nice to highlight these more used tabs to reduce time to look for them among less used tabs. Thus, I was thinking about adding tab rating indexes for usage frequency and recent usage. These ratings would be implemented as tab control properties and would be available for styling.

On the other hand, there is a risk to create too much distracting workspace and there is uncertainty whether it would be helpful at all. So, to experiment with this idea a little I’ve added IsPreviouslySelectedTab property that is true for the previously selected tab. Default style doesn’t change color for previously selected tab, but custom styling with this property works exactly the same as with IsTabSelected property:

<Style TargetType="TabsStudio:Tab" BasedOn="{StaticResource DefaultTabStyle}">
    <Style.Triggers>
        <Trigger Property="IsPreviouslySelectedTab" Value="True">
            <Setter Property="Background" Value="#F5F5FF"/>
        </Trigger>
    </Style.Triggers>
</Style>

Different color for the previously selected tab

Different color for the previously selected tab


Oftentimes you can switch to previously selected tab using standard Ctrl+Tab shortcut. But not always, as previous Ctrl+Tab window can be an extension on the currently selected tab for example. Plus, when you close selected or previously selected tab, current implementation doesn’t show next previously selected tab.

Tabs reordering

Filed under: Uncategorized — Sergey Vlasov @ 4:12 am

I’ve added ability to change tab position relative to other tabs by dragging it with mouse. To place moving tab after another tab drop it on the right half of the tab:

Moving Default.aspx tab after Class1 tab

Moving Default.aspx tab after Class1 tab


To place moving tab before another tab drop it on the left half of the tab:
Moving Default.aspx tab before TextFile tab

Moving Default.aspx tab before TextFile tab

May 16, 2009

Commands

Filed under: Uncategorized — Sergey Vlasov @ 5:52 am

I’ve added several Visual Studio commands to access Tabs Studio functions using customizable keyboard shortcuts, toolbar buttons and menu items:

VS keyboard shortcuts options for Tabs Studio's commands

VS keyboard shortcuts options for Tabs Studio's commands


VS customization for Tabs Studio's commands in toolbar and menu

VS customization for Tabs Studio's commands in toolbar and menu

Full command name Toolbar button text Command
TabsStudio.Connect.About About Tabs Studio Open the Tabs Studio About dialog
TabsStudio.Connect.Settings Tabs Studio Settings Open the Tabs Studio Settings dialog
TabsStudio.Connect.CloseTab Close Tab Close Selected Tab
TabsStudio.Connect.NextTabExtension Next Tab Extension Activate Next Extension in Selected Tab
TabsStudio.Connect.PreviousTabExtension Previous Tab Extension Activate Previous Extension in Selected Tab

Usually, tabs do not group more than two extensions and single Toggle Tab Extension command would suffice instead of two Next and Previous commands. But, for example in C++ projects we can have three .cpp .h .h [Design] extensions in a tab. Theoretically, the number of extensions in a tab can be even more. Next Tab Extension command activates the first extension when the last extension is currently active, so for two extensions it behaves exactly as hypothetical Toggle Tab Extension.

Next Tab Extension works only when, for example, both example.h and example.cpp files are already opened. Some add-ins for VS allow switching to example.h even when only example.cpp is currently opened. With multitude of extensions for grouping that Tabs Studio supports, I’m leaving this more advanced functionality for future versions.

May 14, 2009

Control template

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

XAML supports styles with control templates that can completely change control look. Following example changes tabs shape:

<Style TargetType="{x:Type TabsStudio:Tab}" BasedOn="{StaticResource DefaultTabStyle}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type TabsStudio:Tab}">
                <Grid>
                    <Border Name="Border" BorderBrush="Black" BorderThickness="1,1,1,1" CornerRadius="6,6,0,0">
                        <ContentPresenter ContentSource="Header" Margin="12,2,12,2"/>
                    </Border>
                    <Polygon Points="0 22, 9 0, 0 0" Fill="{x:Static SystemColors.ControlBrush}"/>
                    <Line X1="0" Y1="22" X2="9" Y2="0" Stroke="Black" />
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsTabSelected" Value="True">
                        <Setter TargetName="Border" Property="Background" Value="White"/>
                    </Trigger>
                    <Trigger Property="IsTabSelected" Value="False">
                        <Setter TargetName="Border" Property="Background" Value="LightGray" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Custom control template

Custom control template


While extra powerful, control templates in particular require nontrivial XAML skills and persistence to produce desired result.

Tabs Studio v1.1.1 is released

Filed under: Releases — Sergey Vlasov @ 4:29 pm

Tabs Studio v1.1.1 is released – added style preview and fixed unhandled exception when applying style with control template having invalid type.

Style preview

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

I’ve added live style preview when editing it:

Style preview

Style preview

May 8, 2009

Mail list

Filed under: Uncategorized — Sergey Vlasov @ 6:29 pm

I’ve created Tabs Studio mail list on Yahoo Groups for announcements and discussions. Welcome!

Tabs Studio v1.1.0 is released

Filed under: Releases — Sergey Vlasov @ 2:02 pm

Tabs Studio v1.1.0 is released. The only change comparing to v1.0.6 is that I removed default custom style example.

« Newer PostsOlder Posts »

Blog at WordPress.com.