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

Overlay fix for default windows style and other light theme's. #12573

Merged
merged 11 commits into from Apr 29, 2024

Conversation

MisterMakerNL
Copy link
Contributor

@MisterMakerNL MisterMakerNL commented Feb 23, 2024

These additions changes the Tree text color based on the stylesheet with a transparency state.
#12424
This is how it looks with transparency on
afbeelding
This is how it looks with transparency off.
afbeelding

Current build if you use black text in the tree, you would get this with transparency on:
afbeelding
This is the reason we cannot do light theme's on dark background currently. This is also the reason I think overlay stylesheets are changing the background of normal widgets. So the text can stay white, in both states.

@kadet1090 Did all the difficult code stuff, I did the stylesheet.

Still not working correctly as the mouse over doesn't trigger the color change.

MisterMakerNL and others added 4 commits February 23, 2024 22:16
I am cleaning up my previous PR because of the white space removal.
I now make a single commit with the white space stuff and one with Kadet fixes.

Co-Authored-By: Kacper Donat <kacper@kadet.net>
@github-actions github-actions bot added the Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label Feb 23, 2024
@pierreporte
Copy link

Does it fix #11340?

@maxwxyz
Copy link
Collaborator

maxwxyz commented Feb 24, 2024

So when changing the background to a light one, it could be still hard to read the light text when transparency is enabled?
@kadet1090 Is the text color setting exposed in the preferences or is there a general switch to Change overall light or dark within the same theme?
Would be also helpful for @obelisk79 open light/dark

@MisterMakerNL
Copy link
Contributor Author

@pierreporte I have no idea, it does clean it up a lot. You can test it by applying the added stylesheet eb04a7b
@maxwxyz It would be wise to add some settings to the background settings panel, as these all are tied together. But that is a lot of work.
Current option does work most of the time, as due to the issue with sketch lines colors being hard-coded it is not really advisable to use light backgrounds.

@MisterMakerNL MisterMakerNL changed the title OVerlay fix for default windows style and other light theme's. Overlay fix for default windows style and other light theme's. Feb 24, 2024
@kadet1090
Copy link
Contributor

@kadet1090 Is the text color setting exposed in the preferences or is there a general switch to Change overall light or dark within the same theme?

I did not touch any preference. I simply exposed "transparent" property for the overlay dock widget so it could be targeted via Gui--OverlayTabWidget[transparent="true"] or Gui--OverlayTabWidget[transparent="false"]. The color itself is controlled via the stylesheets in that case.

@maxwxyz
Copy link
Collaborator

maxwxyz commented Apr 20, 2024

@Rexbas you've currently made some fixed to mouse over/click through with the overlay panels active, do you know a fix?

@MisterMakerNL
Copy link
Contributor Author

MisterMakerNL commented Apr 20, 2024

So this fix works pretty great, and should fix the windows overlay style issues.
The only issue here that stops this for being merged is that it doesn't work with the "show on mouse" function aka mouse over.
And so it breaks this function for light theme's, and I have no clue on how to fix it.

@Rexbas
Copy link
Contributor

Rexbas commented Apr 20, 2024

I would like to take a look, but what exactly is the problem, can someone show a video and/or reproduction steps? If I understand correctly this problem happens on Windows machines. Does it also happen on Linux? I prefer not having to setup development on Windows.

@MisterMakerNL
Copy link
Contributor Author

Here you see the issue. With this PR the black text turns white when overlay transparency is active.
This is done by the overlay stylesheet with [transparent="true"] tag.
But as you can also see in the gif, this doesn't work when hoover over is active, the text color stays dark.
You can also see how much better it looks with white text on the default background.

These are windows default settings, so it is a big issue.

FreeCAD_xkozxvj2du

@Rexbas
Copy link
Contributor

Rexbas commented Apr 21, 2024

@MisterMakerNL, I don´t understand style sheets. When I change something in src/Gui/Stylesheets nothing happens even if I remove files. How do you change something and see the result?

@MisterMakerNL
Copy link
Contributor Author

You can use the added src/Gui/Stylesheets/overlay/Default_Light.qss
I forgot too add it too the cmakelist....
But if you enable that in the overlay stylesheet, it should work in this pr.
image

@Rexbas
Copy link
Contributor

Rexbas commented Apr 22, 2024

@Rexbas
Copy link
Contributor

Rexbas commented Apr 22, 2024

Also if it works then we might be able to drop commit 0e5e755

@MisterMakerNL
Copy link
Contributor Author

MisterMakerNL commented Apr 22, 2024

edit seems like I missed the white space, seems to work now!!

@MisterMakerNL
Copy link
Contributor Author

Seems to work now!
FreeCAD_oJdsCC2O4S

This fixes the mouse over issue!

Co-Authored-By: Bas Ruigrok <14298143+Rexbas@users.noreply.github.com>
@MisterMakerNL MisterMakerNL marked this pull request as ready for review April 22, 2024 14:33
@MisterMakerNL
Copy link
Contributor Author

MisterMakerNL commented Apr 25, 2024

I added more overlay sheets, but I am having huge lag-spikes not sure if this is caused by this PR.

@Rexbas
Copy link
Contributor

Rexbas commented Apr 26, 2024

I have no lag, works fine. Could you revert 0e5e755 because setting the transparent property is no longer needed in those places. I moved it to a different place in 314f778.

@MisterMakerNL
Copy link
Contributor Author

Did it, tested, works fine!

src/Gui/OverlayWidgets.cpp Outdated Show resolved Hide resolved
Works great!

Co-Authored-By: Bas Ruigrok <14298143+Rexbas@users.noreply.github.com>
@MisterMakerNL
Copy link
Contributor Author

The reason there are 4 stylesheets is that it also sets the title bar icons, and we have light and dark icons. Might be a good idea too try to move these icons to the normal stylesheet, then we only have 2 overlay stylesheets, one for a light background and one for a dark background.

I think in the future it would be feasible to set the overlay stylesheet automatically based on the color of the background. Although difficult here would be that we have a gradient and if you add a light and dark color then it will break the code.

@chennes chennes merged commit 2d49fce into FreeCAD:main Apr 29, 2024
9 checks passed
@MisterMakerNL MisterMakerNL deleted the Overlay_fix_text_transparant branch April 30, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD Stylesheets Anything regarding stylesheets/themes UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants