github dnGrep/dnGrep v2.9.143.0
v2.9.143.0 (beta)

latest releases: v4.1.92.0, v4.1.47.0, v4.1.27.0...
pre-release4 years ago

This release contains two changes:

• Color themes have been added to the UI (request #312 ), and themes are user customizable.
• The application installer has also been fixed so that ngen will run to generate native images for the application and dlls.

All changes in this release are to the user interface; nothing in the application logic has been changed. The layout of the Options dialog has been updated. A minor bug where the selection in the grep results tree is sometimes lost was fixed.

If you are running on a version of Windows 10 that supports light and dark modes, dnGrep will switch modes based on that setting. On any version of Windows, you can choose a color theme from the Options dialog in dnGrep.

The installation of dnGrep comes with three themes: Light, Dark and Sunset. The Light and Dark themes are contained in the the application executable, and the Sunset theme is an external file. The Sunset theme is an example of a theme file, and you can use it as a template for new custom themes. dnGrep will load theme files from the APPDATA\dnGrep folder (typically that is C:\Users\youraccount\AppData\Roaming\dnGrep).

The themed controls used in dnGrep were extracted from the default WPF controls using Blend. With a few exceptions, all the colors used in each control were extracted as named brush resources. Each control has a unique set of color names, which makes for a lot of named resources, but gives better control over the colors used. The theme files contain the collection of colored brushes, plus a few other options. The theme file must have a .xaml extension and follow the sample file format. All elements in the sample theme files are required, and the theme will not load if any are missing. Check the dnGrep error log if your theme does not load. If you are working on customizing a theme, you can quickly reload the theme by pressing ctrl+F5 on the main window, or from the Options dialog.

If anyone wants to create new themes, let us see them: they can be shared or included in future releases.

For reference, you can find the source for the Light and Dark themes in github at https://github.com/dnGrep/dnGrep/tree/master/dnGREP.WPF/Themes in the LightBrushes.xaml and DarkBrushes.xaml files. For details on how each named color is used, see the files in the dnGREP.WPF/ ThemedControls directory.

The syntax highlighting colors in the preview and replace windows also change with the current theme, but these colors are not user customizable. There is one set of colors for each syntax, and those colors are modified in the code based on a flag in the theme file to work on either a white or black background.

Finally a couple of acknowledgements: I learned a lot about theming WPF controls from these two sources: https://engy.us/blog/2018/10/20/dark-theme-in-wpf/ and https://github.com/Dirkster99/Edi

I have a limited number of systems to test on, so please report any problems you find. Include the version of Windows and .NET you have installed, and screen shots of the problem.

Don't miss a new dnGrep release

NewReleases is sending notifications on new releases.