FreeCAD / FreeCAD

This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler.
https://www.freecad.org
Other
19.13k stars 3.97k forks source link

UI: List Property Editor has hard coded colors, so it is impossible to manage by Themes #16454

Open mnesarco opened 1 week ago

mnesarco commented 1 week ago

Is there an existing issue for this?

Problem description

Editor dialog for List based properties has colors set by c++ code. It makes it impossible to customize based on theme.

image

Code is here: https://github.com/FreeCAD/FreeCAD/blob/614a14fe87af6ea0a978ee6312b298e4033f1839/src/Gui/Widgets.cpp#L1359

Full version info

OS: Linux Mint 21.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 1.0.0RC1.38643 (Git) AppImage
Build type: Release
Branch: main
Hash: fe40748c10503eed367840239db3e0f81873e359
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US) [ OS: English/United States (en_US) ]
Installed mods: 
  * DynamicData 2.62.0
  * MnesarcoUtils 0.2.12
  * sheetmetal 0.4.25
  * A2plus 0.4.67
  * fcscript 0.0.1
  * asm4 0.50.7
  * Curves 0.6.42
  * ProDarkThemePreferencePack 1.0.0
  * Marz 0.1.8
  * OpenTheme 2024.9.1

Subproject(s) affected?

Core

Anything else?

No response

Code of Conduct

kaiwas commented 5 days ago

Oh yeah. This feature is a real eyesore. White text on a yellow background is a separate torture.

mnesarco commented 1 day ago

I still don't know how to make this themable, but at least I can make it text black over yellow background as a temporal workaround (it will work on light or dark modes). Would you accept that change as a PR?

image

image

luzpaz commented 1 day ago

It's a good start!

MisterMakerNL commented 1 day ago

Light or dark modes? Are you talking about the themes or your linux theme setting?

mnesarco commented 1 day ago

Light or dark modes? Are you talking about the themes or your linux theme setting?

It does not matter, as selection colors are fixed by code, black over yellow is readable no matter the freecad theme o linux theme. currently the code sets background as yellow no matter which color is text, this workaround sets text color to black so it is always readable over yellow. At least until this can be made customizable by themes.

mnesarco commented 1 day ago

Wait a minute, apparently I have found a better solution that makes it theme-able. Or at least not hard coded colors. image image

MisterMakerNL commented 17 hours ago

That last solution would be nice, as stylesheets use accent color 1 as selection color. And general text color is also set to white or black. Having it hardcoded here while every other Qlabel aka textbox just uses these colors is a bit wrong.