Tabs Studio Blog (organizing Visual Studio document tabs)

October 18, 2011

Less rows priority

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 8:50 am

Sometimes you get tabs arranged in more rows than necessary:

Tabs in 4 rows

Tabs in 4 rows


The same tabs in 3 rows

The same tabs in 3 rows

This is because the current tab layout algorithm first of all tries to minimize distracting tab movement between rows (keeping tab in the last position, reserving a row buffer for new tabs and changes in tab width).

I’ve added the new LessRowsPriority property to let you customize this behavior. (Remember also the RowBuffer property.) The larger LessRowsPriority value the more actively Tabs Studio will try to minimize number of rows. It is a double with default value of 1. Value of 10 is kind of high priority and value of 100 – very high priority. You can set it in a custom style like this:

<Style TargetType="TabsStudio:Tabs" BasedOn="{StaticResource DefaultTabsStyle}">
  <Setter Property="LessRowsPriority" Value="10"/>
</Style>

2 Comments

  1. I can’t get this working. I’ve copied the rule above and added it to the beginning of my rule set …

    (The last 3 lines in the example are aboe are what /was/ at the beginning of my rule set).

    As soon as I pasted in the new rule, I got this …

    ‘Add value to dictionary of type ‘System.Windows.ResourceDictionary’ threw an exception.’ Line number ‘6’ and line position ‘3’.

    Comment by Stuart Hemming — October 20, 2011 @ 12:33 pm

    • Stuart,
      You can get this error if you already have a definition for TabsStudio:Tabs in your custom style. If this is the case, add only the setter line to your existing definition for TargetType=”TabsStudio:Tabs” style:
      <Setter Property=”LessRowsPriority” Value=”10″/>

      Comment by Sergey Vlasov — October 20, 2011 @ 5:21 pm


RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Blog at WordPress.com.

%d bloggers like this: