# Is it possible to change to Dark Mode Style by code?

**URL:** <https://discourse.slicer.org/t/is-it-possible-to-change-to-dark-mode-style-by-code/34093>\
**Category:** Support\
**Created:** [February 1, 2024, 1:22pm UTC](https://discourse.slicer.org/t/is-it-possible-to-change-to-dark-mode-style-by-code/34093 "2024-02-01T13:22:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apparrilla](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/apparrilla/32/9230_2.png) [@apparrilla](https://discourse.slicer.org/u/apparrilla)\
**Post date:** [February 1, 2024, 1:22pm UTC](https://discourse.slicer.org/t/is-it-possible-to-change-to-dark-mode-style-by-code/34093/1 "2024-02-01T13:22:27Z")

</div>

I want to put my SlicerCustomApp in Dark Mode by default.  
I´m looking for it in the forum and in API but I can´t get it…  
What is the CmakeList parameter to add? Should be possible to add it to a module instead?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [February 1, 2024, 6:57pm UTC](https://discourse.slicer.org/t/is-it-possible-to-change-to-dark-mode-style-by-code/34093/2 "2024-02-01T18:57:10Z")

</div>

You can define default settings for existing Slicer settings in your custom application’s settings file:

> <https://github.com/KitwareMedical/SlicerCustomAppTemplate/blob/a53f0c58dc94a5dab38e87afd35759d1780b6c3c/%7B%7Bcookiecutter.project_name%7D%7D/Applications/%7B%7Bcookiecutter.app_name%7D%7DApp/Resources/Settings/DefaultSettings.ini>

If I open Slicer go to Edit-\>Application Settings-\>Appearance-\>Style and change it from “Slicer” to “Dark Slicer” you will then notice in the user settings file (%AppData%\slicer.org\SonoEQ.ini), that it will have something like the following section:

```auto
[Styles]
AdditionalPaths=@Invalid()
Style=Dark Slicer

```

If you add the same entry into your custom application’s DefaultSettings.ini, that should define it as the new default.

---

<div class="post-metadata">

**Author:** ![apparrilla](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/apparrilla/32/9230_2.png) [@apparrilla](https://discourse.slicer.org/u/apparrilla)\
**Post date:** [February 2, 2024, 7:05am UTC](https://discourse.slicer.org/t/is-it-possible-to-change-to-dark-mode-style-by-code/34093/3 "2024-02-02T07:05:27Z")

</div>

Hi @jamesobutler.

I´ve compile CustomSlicer over the night with this change in DefaultSettings.ini but I´m still doing something wrong.

MyCustomSlicer.ini is located in:

> C:\USERS\USER\AppData\Roaming\MyCustomCompanuy(I changed Kitware)\MyCustomSlicer.ini

For my surprise,

> [Styles]  
> AdditionalPaths=@Invalid()  
> Style=Slicer

Is there any other config parameter I miss?  
Thank´s

---

<div class="post-metadata">

**Author:** ![apparrilla](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/apparrilla/32/9230_2.png) [@apparrilla](https://discourse.slicer.org/u/apparrilla)\
**Post date:** [February 2, 2024, 7:23am UTC](https://discourse.slicer.org/t/is-it-possible-to-change-to-dark-mode-style-by-code/34093/4 "2024-02-02T07:23:08Z")

</div>

Try to forgive me…  
As MyCustomSlicer was previosly compiled, I have to delete the existing MyCustomSlicer.ini… My mistake.  
I leave the comment to prevent other users not to have same trouble,

Thanks again…
