Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylesheet: Light/Dark themes hijack Spreadsheet font color behavior of cell text #17984

Open
2 tasks done
reald opened this issue Nov 19, 2024 · 13 comments
Open
2 tasks done
Labels
Mod: Spreadsheet Related to the Spreadsheet Workbench Priority: High Status: Confirmed The issue was confirmed by others Topic: Color Regarding the color handling Topic: Stylesheets Anything regarding stylesheets/themes Type: Bug This issue or PR is related to a bug
Milestone

Comments

@reald
Copy link

reald commented Nov 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Steps to reproduce:

  1. Download Freecad 1.0.0 Appimage (x86_64)
  2. Run Appimage (on ubuntu 24.04 with xfce)
  3. On first start choose light theme classic theme
  4. Create new file, create spreadsheet
  5. Type some text into a spreadsheet cell

Result: Text color is white on white background

Other text foreground colors can be used normally but black is always shown white.

Full version info

OS: Ubuntu 24.04.1 LTS (XFCE/xfce/xcb)
Architecture: x86_64
Version: 1.0.0.39109 (Git) Conda AppImage
Build type: Release
Branch: (HEAD detached at 1.0.0)
Hash: 2fcc5317fe3aee96ca73475986a577719fc78e20
Python 3.11.9, Qt 5.15.13, Coin 4.0.3, Vtk 9.2.6, OCC 7.7.2
Locale: German/Germany (de_DE)
Stylesheet/Theme/QtStyle: unset/FreeCAD Classic/Qt default

Subproject(s) affected?

None

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Screenshot_20241120_181007
Screenshot_20241120_181035

@reald reald added the Status: Needs triage Missing triage label Nov 19, 2024
@huguesdpdn-aerospace
Copy link
Contributor

huguesdpdn-aerospace commented Nov 19, 2024

Hello @reald ,

Test

I test it on :

OS: Ubuntu 24.04.1 LTS (LXQt/Lubuntu/xcb)
Architecture: x86_64
Version: 1.1.0dev.39215 (Git) Conda AppImage
Build type: Release
Branch: main
Hash: b3a2268289482c65c18bbb4cc073b33020e71ce2
Python 3.11.9, Qt 5.15.13, Coin 4.0.3, Vtk 9.2.6, OCC 7.7.2
Locale: French/France (fr_FR)
Stylesheet/Theme/QtStyle: FreeCAD Light.qss/FreeCAD Light/Fusion

so same OS but not on XFCE4 ... and after reseting all FreeCAD configuration and selecting light theme , I have white background and black text in spreadsheet.

Video

simplescreenrecorder-2024-11-20_00.44.37.mp4

HOWEVER

The color button to change the text color do NOT work, but the one for the background does. Interesting ...

Requesting additional test

Can you, @reald , execute command:

mv ~/.local/share/FreeCAD/ ~/.local/share/FreeCAD.bkp
mv ~/.config/FreeCAD/ ~/.config/FreeCAD.bkp
mv ~/.cache/FreeCAD/ ~/.cache/FreeCAD.bkp

and then run FreeCAD and see if the error persists ?

To get back your config, run:

rm -rf ~/.local/share/FreeCAD/
rm -rf ~/.config/FreeCAD/
rm -rf ~/.cache/FreeCAD/
mv ~/.local/share/FreeCAD.bkp ~/.local/share/FreeCAD/
mv ~/.config/FreeCAD.bkp ~/.config/FreeCAD/
mv ~/.cache/FreeCAD.bkp ~/.cache/FreeCAD/

Waiting reporter feedback

@hyarion
Copy link
Contributor

hyarion commented Nov 20, 2024

(FYI safe mode: https://wiki.freecad.org/Std_RestartInSafeMode can also be used for temporarily testing without any user configurations)

@semhustej
Copy link

I can confirm the behavior @huguesdpdn-aerospace is describing

  • default text color is black
  • I can change the cell background color
  • when setting different text color, the text stays black
    text-color
OS: Windows 10 build 19045
Architecture: x86_64
Version: 1.0.0.39109 (Git) Conda
Build type: Release
Branch: (HEAD detached at 1.0.0)
Hash: 2fcc5317fe3aee96ca73475986a577719fc78e20
Python 3.11.10, Qt 5.15.15, Coin 4.0.3, Vtk 9.3.0, OCC 7.8.1
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD Light.qss/FreeCAD Light/Fusion

@luzpaz luzpaz added Type: Bug This issue or PR is related to a bug Mod: Spreadsheet Related to the Spreadsheet Workbench Status: Confirmed The issue was confirmed by others Topic: Color Regarding the color handling and removed Status: Needs triage Missing triage labels Nov 20, 2024
@luzpaz
Copy link
Contributor

luzpaz commented Nov 20, 2024

default text color is black
I can change the cell background color
when setting different text color, the text stays black

I can confirm @semhustej's observation that changing font color doesn't register in the Spreadsheet.

OS: Manjaro Linux (KDE/plasma/xcb)
Architecture: x86_64
Version: 1.1.0dev.39240 (Git) Conda AppImage
Build type: Release
Branch: main
Hash: f9ba94c70b139ece6ba5ffba47632d91b5c9c645
Python 3.11.9, Qt 5.15.13, Coin 4.0.3, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD Light.qss/FreeCAD Light/Fusion

BUT

Result: Text color is white on white background

I can't reproduce OPs findings

@luzpaz luzpaz changed the title Spreadsheet: Black text shown white in freecad 1.0.0 Spreadsheet: Changing font color of cell text is unresponsive (unconfirmed: Black text always shown as white) Nov 20, 2024
@luzpaz luzpaz added this to the 1.1 milestone Nov 20, 2024
@reald
Copy link
Author

reald commented Nov 20, 2024

Tried the supposed things in safe mode (./FreeCAD_1.0.0-conda-Linux-x86_64-py311.AppImage --safe-mode);

  • Original issue is NOT reproduceable in safe mode: Text color is black (if cell is not highlighted)
  • Text color can be changed, correct color is shown if cell is not highlighted.

Screenshot_20241120_182251

@semhustej
Copy link

When I saw @reald screenshot, a thing popped into my mind and I tried this:

  • Set Classic Theme UI style -> Spreadsheet text color changes according to cell setting
  • Set Light Theme UI style -> Spreadsheet text color is always white, irrespective of cell setting
  • Set Dark Theme UI style -> Spreadsheet text color is always black, irrespective of cell setting
  • Set back Classic Theme UI style -> Spreadsheet text color changes according to cell setting

I think this is a Stylesheet issue related to UI Theme settings.

I think OP's issue is also related to this as I remember in some situations when switching themes, the text in Light Theme stayed white on white background. I was not able to reproduce that behavior though.

@huguesdpdn-aerospace
Copy link
Contributor

huguesdpdn-aerospace commented Nov 20, 2024

FYI @luzpaz : confirming @semhustej 's idea. Tested under Ubuntu with latest weekly build:

UI Classic	=>	Spreadsheet text color works
UI Light        =>      Spreadsheet text color do NOT work
UI Dark         =>      Spreadsheet text color do NOT work

@luzpaz luzpaz changed the title Spreadsheet: Changing font color of cell text is unresponsive (unconfirmed: Black text always shown as white) Stylesheet: Light/Dark themes alter Spreadsheet font color behavior of cell text Nov 20, 2024
@luzpaz luzpaz added the Topic: Stylesheets Anything regarding stylesheets/themes label Nov 20, 2024
@luzpaz
Copy link
Contributor

luzpaz commented Nov 20, 2024

Nice teamwork, y'all!
cc @MisterMakerNL any chance you can take a look ?

@hyarion
Copy link
Contributor

hyarion commented Nov 20, 2024

IIRC, spreadsheet has a bug which makes it impossible to clear the text and background override color.
It's described in this issue: #13862 (and it references a PoC clear color branch I made)

@MisterMakerNL
Copy link
Contributor

MisterMakerNL commented Nov 20, 2024

As stated the text color is bugged, there was no way to get this to work with stylesheets without bugs.
Opentheme uses a different method but if you open a spreadsheet made in opendark in open light you get white text on white cells. If OP has used opentheme this could be the issue here.
Also op Screenshots shows classic, the version info also shows classic, so nut sure if confused with light theme.
If the issue is on classic then this could be again a linux Qstyle issue.

@reald
Copy link
Author

reald commented Nov 20, 2024

Indeed I confused classic with light theme. Using light theme I have the same issue described above, font color cannot be changed.

@huguesdpdn-aerospace
Copy link
Contributor

I was working on my project and then, pouf, @reald 's problem appears when I just created a Spreadsheet with light theme:
17984_blue_white
17984_white_blue

So YES, I did had white text on white cells, but I don't know how to reproduce it.
It seems we have a double bug :/

@luzpaz luzpaz changed the title Stylesheet: Light/Dark themes alter Spreadsheet font color behavior of cell text Stylesheet: Light/Dark themes hijack Spreadsheet font color behavior of cell text Nov 22, 2024
@kwoqifeli22
Copy link

I can confirm a similar behavior with FreeCAD 1.0 using the Classic Theme on Windows 10 (12th Gen Intel i9-12950HX, NVIDIA RTX A3000). Adjusting the text color to RGB(0, 0, 0) causes the text to disappear unless the cell is selected. Switching to other themes results in slightly different behavior, as described in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mod: Spreadsheet Related to the Spreadsheet Workbench Priority: High Status: Confirmed The issue was confirmed by others Topic: Color Regarding the color handling Topic: Stylesheets Anything regarding stylesheets/themes Type: Bug This issue or PR is related to a bug
Projects
None yet
Development

No branches or pull requests

7 participants