Disable Dark Mode in RAW from source for macOS

6 views
Skip to first unread message

Thomas Grant

unread,
Jul 8, 2021, 11:05:23 AM7/8/21
to BioXTAS RAW
Hi,

I have installed RAW from source on macOS (10.14.6). I have Dark mode enabled in my OS settings.  When I launch RAW with pythonw, it opens in Dark mode (I presume it somehow reads that from my system setting). Is there any way to disable dark mode in RAW directly, without having to change my system-wide setting? Unfortunately some of the text becomes very difficult to see (e.g. white text on white background).  

Thanks,
Tom

Thomas Grant

unread,
Jul 8, 2021, 11:05:45 AM7/8/21
to BioXTAS RAW
I should mention it is RAW version 2.1.1.

Jesse Hopkins

unread,
Jul 8, 2021, 11:15:34 AM7/8/21
to bioxt...@googlegroups.com
Hi Tom,

Can you send a screenshot showing an example of the issue? Also, what version of python and wxpython are you using? I just tested on my mac running 10.14.6 and RAW was completely unresponsive to dark mode, so I couldn't recreate the problem.

My suspicion is it's something to do with your particular wxpython version, possibly even the specific build. RAW itself doesn't have any particular support for dark mode, so it will just do whatever the GUI toolkit decides to do. If you google wxpython dark mode you'll see a bunch of folks (including me) reporting significantly inconsistent behavior depending on the version of python, wxpython, etc.

All the best.

- Jesse

----
Jesse Hopkins, PhD
Deputy Director
BioCAT, Sector 18
Advanced Photon Source


--
You received this message because you are subscribed to the Google Groups "BioXTAS RAW" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioxtas_raw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioxtas_raw/0251de34-3590-4f54-ae35-c8faeb42c987n%40googlegroups.com.

Thomas Grant

unread,
Jul 8, 2021, 11:30:43 AM7/8/21
to bioxt...@googlegroups.com
Currently on python v3.8.10 and wxpython v4.1.1.  I did see some of those threads you mention, which is actually what motivated me to update to the latest wxpython, as I saw some people said it handles dark mode better, but it didn't make any difference for me. It must internally try to be clever and just reflect whatever the OS setting is, which of course makes sense.  I think in this case the Dark mode is changing the text to white, but not changing the background colors in RAW perhaps? Maybe those bg colors are hardcoded somewhere?

Screenshot attached. Note the Files panel on the left is difficult to see the text on the light background now that the text is white (I clicked on on to make it highlight it to see). The binary installation does not do this by the way, only my version installed from source.

Tom

Screen Shot 2021-07-08 at 11.27.23 AM.png

Jesse Hopkins

unread,
Jul 8, 2021, 11:56:23 AM7/8/21
to bioxt...@googlegroups.com
Hi Tom,

I just tried with python 3.8.10 and wxpython 4.1.1 and was unable to recreate the problem (still). How did you install wxpython? I'm wondering if it's build specific.

There are various hardcoded colors in RAW, including the list control background for the file list. So you're probably right about the cause. You could try commenting out those color settings and see what happens. In my version of the code, you'll want lines 6511 and 6512 in RAW.py (see attached screenshot). The class is the CustomListCtrl class. I don't know if there are other areas where this would also be problematic.

A longer term solution is, if I can recreate the issue for testing purposes, to make sure that everything that has hard coded colors codes both foreground and background colors, or to remove the hard coding if it's not necessary.

All the best.

- Jesse

----
Jesse Hopkins, PhD
Deputy Director
BioCAT, Sector 18
Advanced Photon Source

Screen Shot 2021-07-08 at 10.55.04 AM.png

Thomas Grant

unread,
Jul 8, 2021, 1:03:39 PM7/8/21
to BioXTAS RAW
I installed using the instructions on the website, by conda install yadayada... using the same commands and channels. This was all installed in its own dedicated environment, nothing else has been installed in this environment.

Indeed your fix did work! And now I just get white text on the dark background. 

Thanks,
Tom

Screen Shot 2021-07-08 at 1.02.30 PM.png

Jesse Hopkins

unread,
Jul 8, 2021, 2:07:47 PM7/8/21
to bioxt...@googlegroups.com
Hi Tom,

How odd. Even under those exact same conditions (new environment, installed using the exact commands on the RAW website, no other packages installed) with the same version of python and wxpython, on the same point release of the OS I can't get any response when switching to dark mode (nothing changes). Which makes this hard to troubleshoot.

I'm glad the fix worked. It seems like going forward I need to either specify both foreground and background colors, or neither, to make things dark mode compatible. I'll try to figure out a way to test it going forward. I suspect to make dark mode work at all in the prebuilt app, I'll have to get it working from source first, and figure out what's going on there.

All the best.

- Jesse

----
Jesse Hopkins, PhD
Deputy Director
BioCAT, Sector 18
Advanced Photon Source

Thomas Grant

unread,
Jul 8, 2021, 2:14:55 PM7/8/21
to bioxt...@googlegroups.com
Indeed that is odd.  Maybe when I get a chance I'll try on another system (I have a newer M1 Mac I can try this on) and see if I can reproduce it there.

Tom

Reply all
Reply to author
Forward
0 new messages