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

Windows dark title bar theme support #514

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

Conversation

sprainbrains
Copy link
Contributor

Added support title bar theme change for windows users

Change title bar theme (light and dark) for window 10. 
It's changed after restart program.
added dependencies for window 10 dark theme title bar
Fixed inversion in code for light theme (windows 10)
Added dynamical change of the title bar if main dark/light theme changed
@takase1121
Copy link
Member

This PR is very specific and does not target multiple platforms (being Windows only), not to mention it makes us link to another library. I suggest just using config.borderless instead.

@sprainbrains
Copy link
Contributor Author

This PR is very specific and does not target multiple platforms (being Windows only), not to mention it makes us link to another library. I suggest just using config.borderless instead.

All project have specifics solution. Windows users also using the current app.
In my case was added a lib which included for each windows from win2000.

@takase1121
Copy link
Member

takase1121 commented Sep 8, 2021

All project have specifics solution.

I don't see a need for this just for a titlebar. If you want cross-platform and consistency, drawing your own is the perfect choice.

Besides, I'm unsure if there's corresponding functionality on Linux and MacOS too.

Referring to similiar issues with scrcpy, I think its better for us to wait for an upstream fix at SDL2.

@sprainbrains
Copy link
Contributor Author

I don't see a need for this just for a titlebar. If you want cross-platform and consistency, drawing your own is the perfect choice.

SDL have specific mechanisms for all support OS (besides work with Win registers) and i used it.

Besides, I'm unsure if there's corresponding functionality on Linux and MacOS too.

I using #Ifdef _win32 .. #endif construction special for windows. Linux and Mac have own mechanisms for current functionality

Referring to similiar issues with scrcpy, I think its better for us to wait for an upstream fix at SDL2.

Because SDL2 can catching and handling WinProc broadcast message, but can't use win registers specific WIN32API

@takase1121
Copy link
Member

SDL have specific mechanisms for all support OS (besides work with Win registers) and i used it.

Yes, yes, yes... I know what you did. But I once again want to ask this question: is this necessary?

Is it our responsibility to provide another solution to a problem that:

  1. Isn't our responsibility (duh, SDL2 is the window management library)
  2. Isn't entirely cross-platform feature wise
  3. Clutters the codebase with needless stuffs
  4. Link to yet another library, even though it comes with the system.

@redtide
Copy link
Contributor

redtide commented Sep 8, 2021

What both me and Takase was trying to say is that is not the developers responsibility to provide something that the OS should do.
The workaround is simply to set the color in settings in the way I did, and hope it will work as expected in W11.

@franko
Copy link
Member

franko commented Sep 8, 2021

Thank you @sprainbrains, this work seems to be correct from the technical point of view and well done. I tested on my window machine and everything seems fine.

On the other side I quite share the point of view of @takase1121. This modification adds a significant bit of additional code for a feature that works only on Windows and that most people don't feel the need to have.

I propose to keep this PR open for the moment but without merging into the master branch.

For our project we prefer to focus on features that improve the functionality and ergonomic of the editor or to things that make it more capable or also things that improve the workflow. I am also quite focused in this moment to prepare the 2.0.2 release.

I would appreciate your help on one of our things we are missing for the release of 2.0.2, see the project page, or in alternative we have several things in our roadmap. You may even pick a feature that is not yet in the roadmap as long as it is of general interest.

I hope you understand and you will stay onboard in our project.

@sprainbrains
Copy link
Contributor Author

What both me and Takase was trying to say is that is not the developers responsibility to provide something that the OS should do.

in our case, it's should do SDL2 lib. Unfortunately, developers didn't implement it in own library.
Agree with you and @takase1121. My PR look like a simply HOOK for app.

The workaround is simply to set the color in settings in the way I did, and hope it will work as expected in W11.

Some definitions will be included in the documentation and maybe then the developers of the SDL will do something. So far, the white / black theme of title bar feature is not officially documented.

Thank you @sprainbrains, this work seems to be correct from the technical point of view and well done. I tested on my window machine and everything seems fine.

On the other side I quite share the point of view of @takase1121. This modification adds a significant bit of additional code for a feature that works only on Windows and that most people don't feel the need to have.

I propose to keep this PR open for the moment but without merging into the master branch.

For our project we prefer to focus on features that improve the functionality and ergonomic of the editor or to things that make it more capable or also things that improve the workflow. I am also quite focused in this moment to prepare the 2.0.2 release.

I would appreciate your help on one of our things we are missing for the release of 2.0.2, see the project page, or in alternative we have several things in our roadmap. You may even pick a feature that is not yet in the roadmap as long as it is of general interest.

I hope you understand and you will stay onboard in our project.

Got it. No problem.
Let this PR remain as a temporary solution to the problem (maybe add some label to PR). I will maintain this branch until a good solution is found.
Try to find something for yourself from roadmap, pp or issues.

Nikolai Sinyov added 11 commits December 2, 2022 14:53
Merge remote-tracking branch 'upstream/master' into lite-xl-windows-dark-theme-title-bar-support
Merge remote-tracking branch 'upstream/master' into lite-xl-windows-dark-theme-title-bar-support
@Guldoman
Copy link
Member

Guldoman commented Mar 9, 2023

This might be of interest libsdl-org/SDL#7416.
Will have to wait for SDL3 tho.

@sprainbrains
Copy link
Contributor Author

This might be of interest libsdl-org/SDL#7416.
Will have to wait for SDL3 tho.

Yeah, I know. I'm following current thread. I guess, SDL 3 will resolve this problem. Waiting )

Nikolai Sinyov added 7 commits March 16, 2023 17:24
Merge remote-tracking branch 'upstream/master' into lite-xl-windows-dark-theme-title-bar-support
jgmdev added a commit to pragtical/pragtical that referenced this pull request Aug 6, 2023
This commit applies lite-xl/lite-xl#514 in a less invasive way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants