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

Implement system theme (dark mode) and fix background image on windows. #792

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ctrleo
Copy link

@ctrleo ctrleo commented Dec 30, 2024

This pr implements feature request #741

Changes

  • Removed background (color) property from list_background, which allows the app to use the system default colour instead
  • Added two options for background-color in list_background, which alternate depending on theme
  • Removed the white filter over list_background.png and replicated the effect by lowering the image opacity to 70% 10%
  • Moved original list_background.png and it's GIMP editor file to list_background_old.png and list_background_old.xcf
  • Recompiled UI files with new image
  • Created a subroutine in shared.py to detect if system is in dark mode or not
  • Determines whether system is in dark mode or not using QApplication.styleHints().colorScheme()
  • Added KCC_7.0.0.spec, a file generated through setup.py build_binary on windows, to .gitignore

This fixes...

  • Aesthetic cluttering while in dark mode
  • List Background photo hidden in WIndows
  • My eyes while converting all my manga to kindle format

Screenshots

Windows

Before

Screenshot 2024-12-29 204312

After

Screenshot 2024-12-30 104623

After (in light mode)

Screenshot 2024-12-30 104549

Linux (on Debian XFCE with Dracula theme)

Before

linux-before

After

newnewkcc

Ty for considering my contribution! ^-^

it was creating a white box around the image while in system dark mode, so I substituted it by lowering the image opacity to 70%

the old image and .xcf file are safe to remove but preserved
@axu2
Copy link
Collaborator

axu2 commented Dec 30, 2024

I may be wrong, but there's probably a qt property you can read that tells you if it's dark mode? @ctrleo

https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

I may be wrong, but there's probably a qt property you can read that tells you if it's dark mode? @ctrleo

https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5

@axu2 omg thanks sm that would be way more efficient, I'll look into implementing it so that I can cut out the darkMode function

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

I feel like the image blends too well with the text, so I'm gonna lower the opacity a little more

@axu2
Copy link
Collaborator

axu2 commented Dec 30, 2024

I think it might be better to just remove the background image entirely in dark mode. Let me know your opinion.

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

@axu2 its kinda cute tho :( I'm trying to think of a way we might be able to pop a grey tint over it during dark mode which would make the letters stand out more

@axu2
Copy link
Collaborator

axu2 commented Dec 30, 2024

Maybe make the image grayscale or black and white, maybe invert the colors on top, etc

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

Maybe make the image grayscale or black and white, maybe invert the colors on top, etc

thats an intuitive solution but it would be a challenge since it's difficult to change the image itself since it's compiled in with the ui files. I thought about putting a low opacity grey border around the text to help it stand out, which looks like this:

Screenshot 2024-12-30 030607
Screenshot 2024-12-30 030648

@axu2 lmk what you think and i'll push the commit

@axu2
Copy link
Collaborator

axu2 commented Dec 30, 2024

Just ran your code. Here's what it looks like on macOS. I'm personally against making the logo so prominent at least on light mode, I like it's subtlety.

I prefer (original no changes):

image

over (your changes):

image

Also, looks like the surrounding box and background changed colors.

For reference:

image

image

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

a little more progress
I lowered the opacity down to 30%, and I think its as close as im gonna get for subtle, heres the results:

Screenshot 2024-12-30 034105
Screenshot 2024-12-30 034124

the reason the current logo looks the way it does is because of a white cast filter over the image which essentially blends it with the background, however, when system dark mode is activated, gives us this:

Screenshot 2024-12-30 034303

(For reference, the text does display the correct colours, but there's a bug which causes it to default to one of the two colours in a sceenshot)

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

I do think that helped, here's my changes to the UI essentially finished:

Screenshot 2024-12-30 040141
Screenshot 2024-12-30 035808
Screenshot 2024-12-30 040028
Screenshot 2024-12-30 040106

@axu2
Copy link
Collaborator

axu2 commented Dec 30, 2024

This is getting there, but I want it to look like the example in the QT link earlier:

image

e.g. the text box has a white background in light mode, etc. currently the text box has the same background color as the window. And you could probably make the logo even more transparent.

I can look into this later, this command may help (or just search for string "fusion"):

git grep -In fusion

Also, thanks for pointing out I broke the cropping power slider orientation at some point. I'll look into that, it should be horizontal. like in 7.00 and earlier.

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

@axu2 gm! I looked into fusion and found that, with WIndows, it really takes that odd little accent colour feature and runs with it, see below:

Screenshot 2024-12-30 101248

Imo I feel like it just makes it look unnecessarily tacky, however, I'm gonna change the opacity of the logo again then I'll figure out how to brighten/darken the job list box compared to background.

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

I brought it down to 10%, which I think gets us quite close to what it looked like in the original UI.

Screenshot 2024-12-30 102453
Screenshot 2024-12-30 102405

@ctrleo
Copy link
Author

ctrleo commented Dec 30, 2024

e.g. the text box has a white background in light mode, etc. currently the text box has the same background color as the window. And you could probably make the logo even more transparent.

I added back the background color property in KCC_ui.py and changed it depending on light or dark mode, heres my results:

Screenshot 2024-12-30 104623
Screenshot 2024-12-30 104549

on light mode it doesnt make much difference on a low brightness, I also added opacity to the background-color attribute, because the background-image tends to get stuck behind it on windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants