Hi,
I have running Rhino 8 on Windows 11 in dark mode.
Unfortunately some GUI widgets are looking strange, displayed in wrong colors for dark mode. Especially texts on group boxes (black on dark grey) and text on some buttons (bright on white, CRhinoUiOptionsListCtrlPushButton). See images below. My questions are:
Can I programatically (C++) find out, if Rhino is currently in dark mode?
Do you have any suggestion for setting the appearance globally for all GUI objects of a type (like group box)?
Or do I need to address this problem individually on each dialog?
Many thanks
Windows 11 (10.0.22631 SR0.0) or greater (Physical RAM: 32GB)
.NET 7.0.0
Computer platform: LAPTOP - Plugged in [92% battery remaining]
Hybrid graphics configuration.
Primary display: Intel(R) UHD Graphics (Intel) Memory: 1GB, Driver date: 7-11-2023 (M-D-Y).
> Integrated graphics device with 4 adapter port(s)
- Windows Main Display is laptop’s integrated screen or built-in port
Primary OpenGL: NVIDIA GeForce RTX 4060 Laptop GPU (NVidia) Memory: 8GB, Driver date: 9-27-2023 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 537.53
> Integrated accelerated graphics device with 4 adapter port(s)
- Video pass-through to primary display device
OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)
Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High
Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 9-27-2023
Driver Version: 31.0.15.3753
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 8188 MB
Rhino plugins that do not ship with Rhino
C:\Users\ps\Develop\CS_RhinoPlugin_build_RhinoPlugIns_64_R8\bin\Debug\CS_ModelingPlugIn.rhp “Cyberstrak Modeling PlugIn”
@dale made a comment on my post Dark/Light theme GUI changes - #2 by dale and suggested to derive all static texts (and i assume also your group boxes) from CRhinoUiStaticEx or at least CRhinoUiStatic
Unfortunately this leads to a lot of work changing all those static text fields (same on my project).
Dale also mentioned this problem is well known at least since V7, but he did not say anything if it’s reported or planned to fix.
Hi dsw,
yes it looks the same.
Even if we derive all statics it would still be very useful, to get at least the information if Rhino is running in dark mode or not.
I was looking in CRhinoAppSettings, but only in the Mac part there is something like this:
@Peter_Salzman - I’ve added a new CRhinoUiPaintColorSettings::RunningInDarkMode method to the Rhino 8.7 C++ SDK. I’m hoping this and the colors found on this class are enough for C++ developers.
Hm, it looks I was not correct in my last remark. Had to dp some other things and just came back to the topic these days.
My problem is concerning the group box texts. When I toggle Rhino to dark mode, some dialogs appear with white, some with dark text color. Maybe it depends, if OnInitDialog() was called already, when the mode was changed.
With Dales latest changes I can now find out, that Rhino runs in dark mode. Then I tried to find a way to change the text color of my group box text. Unfortunately all my goup boxes are created using the MFC resource editor (I know, this is a very old legacy kind way of doing it…).
So they are just accessible as CButton via getDlgItem(IDC_MY_GROUPBOX). Is there any other idea to influence the text color?
One addition: I also tried to implement OnCtlColor();
I was successfully able to influence some colors (as CStatic label colors). But the whole dialog is ignoring Rhino’s dark mode setting, the dialog appears in bright mode and it looks that I have to configure now the complete dialog appearance.
OK, I tried it and can configure statics, edit fields, dialog background etc. But I did not find any way to change group box label colors…
I don’t believe group boxes can be owner drawn. And since tabbed dockbars are not receiving WM_CTLCOLOR messages, I think the best approach is to create a new static control that draws like a group box. This instead of using a button with the BS_GROUPBOX style.
Our CRhinoUiSeparator is a good start on this.
The Continuity and Preserve other ends labels are CRhinoUiSeparator controls. It wouldn’t take much to draw a line around the bounding rectangle.