tab titles white on windows xp

May 12, 2009 at 12:25 PM

Without changing anything in the code, what looks fine on Vista, looks unreadable on XP. The color of tab titles (headers) is white on grey background and it's nearly impossible to read. How can I change the color to be black all the time (not linked to Windows colors).

May 12, 2009 at 12:35 PM

Foreground="{DynamicResource {x:Static SystemColors.InactiveCaptionTextBrushKey}}"

I found this line of code on line #66 in DockablePaneStyles.xaml. How can I set it without recompiling the library? Do I have to copy and modify the entire style definition inside my project?

May 12, 2009 at 4:18 PM

Well, I tried copying the whole file and importing it in window's resources, but it didn't change anything.

Here's a screenshot of the issue

May 14, 2009 at 5:35 PM
Edited May 14, 2009 at 5:36 PM

I found it after a lot of searching, replacing foreground colors with simply "Black", testing...

Eventually, I had to replace colors in the xaml files with style definitions related to tabItemTitle text block and also the header of the dockable pane.... mostly "(In)ActiveCaptionTextBrushKey" with "WindowTextColor", I also fixed the white on blue text ("Status"/"Error List (0)") by specifying similar values for some brushes. This of course required me to recompile the library and use this custom build.

Windows XP used darker title bars all the time, not only when window is maximized (that's how Vista works). That results in "Caption Text" being always white or something. To me this looks like a styling incompatibility between XP and Vista, and of course, although it was a really painful issue for me to resolve, I don't think it really needs to be addressed in the component itself.

The only question remains is why have my testers noticed this only after the new version of AvalonDock was used? Is it something that was added only in the last version? I thought the styles were there before as well...

Jun 8, 2009 at 10:05 PM

Hi,

Could you be a little more specific about what needs to change to fix this? Are you editing the source resource xaml files and rebuilding?

thanks,

Adam

Jun 9, 2009 at 10:00 AM

Yes, I edited source xaml files and rebuilt the library.

I'm sorry, but I didn't document what I changed, it was very difficult to debug and fix this issue. I tried changing the color in a lot of places, and only some of them worked. I could probably compare the source files to an original source package, but I don't really have time. Is it ok if I send you my modified package so you can compare the files?

Jun 17, 2009 at 12:20 PM
Edited Jun 17, 2009 at 12:20 PM

Thanks. I found it.

The file to change is themes/classic.xml and its just changing the foreground on the tab textblock:

Original:

           <TextBlock
                x:Name="tabItemTitle"
                                        Grid.Column="1"
                TextTrimming="CharacterEllipsis" TextWrapping="NoWrap"
                Text="{TemplateBinding Title}"
                Margin="2,0,0,0" VerticalAlignment="Center"
                Foreground="{DynamicResource {x:Static SystemColors.InactiveCaptionTextBrushKey}}"/>

New Version To Fix Problem:

              <TextBlock
                x:Name="tabItemTitle"
                                        Grid.Column="1"
                TextTrimming="CharacterEllipsis" TextWrapping="NoWrap"
                Text="{TemplateBinding Title}"
                Margin="2,0,0,0" VerticalAlignment="Center"
                Foreground="Black"/>

Jun 17, 2009 at 2:35 PM

No, thank you! :)

I've now revisited the code and you're right, that's the main thing to fix. However, I would also like to add this modification in the classic.brushes.xaml:

 

 

 

<SolidColorBrush 
        x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleForeground}}" 
        Color="Black"/>

That makes sure that the title in the dockable pane is visible on the light blue gradient background. See my first image where it says "Error List (0)".

 

 

 

Dec 13, 2009 at 7:42 AM
Edited Dec 13, 2009 at 6:49 PM

Any chance of exposing this as an option for those of us not quite brave enough to try a custom build of the code?

I too have unreadable values (white on light blue) when I try to use aero on xp.

Something like an UnselectedHeaderColor property or something?

Dec 13, 2009 at 7:05 PM
Edited Dec 13, 2009 at 7:07 PM

Ah, it is already in there:

ColorFactory.ChangeBrush(AvalonDockBrushes.DockablePaneTitleForeground, Brushes.Black);

Changed it to black.


Thanks for the great code!