Cursor color in PropertyGrid editors when dark theme is selected

Editors for WPF Forum

Posted 4 years ago by Erel Uziel
Version: 15.1.0621
Environment: Windows 8 (64-bit)
Avatar

The cursor color remains black in the interop editors. In the other fields it is white as expected. You can see it in your example as well.

 

Is there any workaround for this? It makes the property grid less usable in dark themes.

Comments (4)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Erel,

Thanks for letting us know about this.  We've updated our code for the next build to resolve this.  We are adding this setter to several control Styles, including editors:TextBoxBase, editors:PartEditBox, editors.PartGroup, and editors:Part:

<Setter Property="editors:CaretLayer.CaretBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.EditCaretBackgroundNormalBrushKey}}" />

We also are changing the default editors:CaretLayer.CaretOpacity property value to be 1.0 instead of 0.5.  The combination of these changes will match the caret appearance in other controls like our themes of TextBox and SyntaxEditor.

In the meantime before the next build, you could try to make those changes via implicit Styles in your app's Resources that target the types mentioned above.


Actipro Software Support

Posted 4 years ago by Erel Uziel
Avatar

Thank you. I'm quite new to WPF so I'm probably doing something wrong.

I've added this code to the window:

 <Window.Resources>
        <Style  TargetType="editors:PartEditBox">
            <Setter Property="editors:CaretLayer.CaretBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.EditCaretBackgroundNormalBrushKey}}" />
        </Style>
        <Style  TargetType="editors:TextBoxBase">
            <Setter Property="editors:CaretLayer.CaretBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.EditCaretBackgroundNormalBrushKey}}" />
        </Style>
        <Style TargetType="editors:Part">
            <Setter Property="editors:CaretLayer.CaretBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.EditCaretBackgroundNormalBrushKey}}" />
        </Style>
    </Window.Resources>

 It doesn't seem to do anything.

Posted 4 years ago by Erel Uziel
Avatar

I was able to solve it with a small modification to the source code.

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

I'm glad you got it going.  Note that there were two problems in our current official build, one was that I don't think the caret brush was getting applied to be different in dark themes, which the CaretBrush setters fix.  If you only do that (and if the implicit styles are taking effect), then you should at least see a light gray line instead of nothing.

The other thing is that you'd need to set the attached CaretOpacity property for each of those types to 1.0, which will make it full white instead of gray.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 8 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.