Bug: tabs don't resize to fit font size

Apr 28, 2010 at 7:59 AM

Hi,

thanks a lot for this great framework, I think it is really cool! I tried it out the last few days and it seems very professional. I have one question though: in my application a requirement is that the font size has to be adjustable, so if I set the font size of the main window to 20, everything adapts, except the tab sizes - they stay the same height, with the result that the text is not visible entirely. Would it be possible to change that easily so that tabs are resized accordinig to the font size used?

Thanks!

Apr 29, 2010 at 2:12 AM

Hi, lustuyck

Do you mean that the header of the DocumentContent will not re-size along with the font changing?

Apr 29, 2010 at 8:08 AM
Edited Apr 29, 2010 at 8:08 AM

Hi!

Yes, that's what I mean, but also the header of a DockableContent and footer of a DockablePane doesn't resize according to the font size. You can easily simulate it by setting FontSize="40" in the window of Demo.xaml in the demo application that you provide.

I uploaded a screenshot of it here: http://img714.imageshack.us/i/avalone.jpg.

Thanks for the reaction,

kind regards,

Ludwig

Apr 30, 2010 at 3:39 AM
Edited Apr 30, 2010 at 4:19 AM

Hi, lustuyck

 

The demo is not provided by me, I am also only a user of AvalonDock    : )

 

maybe you can try to fix the font size of the DocumentContent's Title like this:

<TextBlock
FontSize="12"
x:Name="tabItemTitle" 
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap" Text="{TemplateBinding Title}" ...... />

(it's in the
DocumentPaneStyles.xaml file)

Or maybe you can try to change the height of the header to 30 by modifying this part of code :
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>


but then you'll have to change the two paths defined in "DocumentTabItemStyle" to like this :
<Path Data="M 20,0.5 Q 16,0.5 10,10 Q 5,29.5 0,29.5 L 20,29.5"
 x:Name="tabItemIntPathBackground"  
 Fill="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DocumentHeaderBackground}}}"/>
 <Path
 x:Name="tabItemIntPathBorder"  
 Stroke="{StaticResource ManagedContentTabControlNormalBorderBrush}"
 Data="M 20,0.5 Q 16,0.5 10,10 Q 5,29.5 0, 29.5"
 />
Apr 30, 2010 at 8:39 AM

Hi, thanks for the feedback. I did find the file classic.xaml, in which I tried some things, but changing font size or heights or widths was insufficient. The path that is being drawn has to be modified too I think, and I'm not familiar with that :-/

Sep 15, 2011 at 10:06 PM
Edited Sep 15, 2011 at 10:13 PM

Well i guess it might be too late for you since you asked in apr 2010, but i managed to make it work by modifying the aero.normalcolor.xaml Heights to Auto in almost every part of the template that seemed to had static value for either RowDefinition or TextBlock Height. I left the images untouched. I did the same for the DocumentPaneStyles.xaml

I also did the same logic for the DockablePaneStyle.

I did not touch the Path drawing as mentioned above (since i dont really care for the moment) but i guess it would be easy to bind it's data to the FontSize property and let a converter return the modified data.

It would be nice to have those changes done in the next version of AvalonDock, developpers?