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

Make titlebar dark #5

Closed
not-nef opened this issue Jan 30, 2022 · 41 comments
Closed

Make titlebar dark #5

not-nef opened this issue Jan 30, 2022 · 41 comments
Assignees
Labels
✨ feature New feature or request

Comments

@not-nef
Copy link
Member

not-nef commented Jan 30, 2022

In the latest release notes you said that you look for a way to make the Titlebar change color. I dont know a direct solution, but when using the BlurWindow Module (python -m pip install BlurWindow) with Dark = True, the titlebar changes its color to dark. And the window also gets blurred, which looks great on modern apps! I would make a pull request, but i cant get to my PC at the moment.

EDIT: i dont know if this solution also works for the menu bar. You need to check.

@HuyHung1408
Copy link
Collaborator

HuyHung1408 commented Jan 31, 2022

Thank you a lot! I've seen your beautiful project and I'm finding a way to contact you. But now it's unnecessary. Will try after holiday end.

@HuyHung1408 HuyHung1408 added the ✨ feature New feature or request label Jan 31, 2022
@HuyHung1408
Copy link
Collaborator

I'm not sure how to apply blur to my program after installed BlurWindow, just started to learn about Python 4 days ago.

@not-nef
Copy link
Member Author

not-nef commented Jan 31, 2022

Its easy, just add the following lines to your code:

bg_color = ttk.Style().lookup(".", "background")
app.wm_attributes("-transparent", bg_color)
app.update()
HWND = ctypes.windll.user32.GetForegroundWindow()
GlobalBlur(HWND)

@not-nef
Copy link
Member Author

not-nef commented Jan 31, 2022

Keep in mind that you have to replace app with the name of your tkinter window.

@im-coder-lg
Copy link
Member

Hi, I just want to know if you created this project by learning through YouTube. Coincidentally, I also made a program that mimics the entire code, except the theming. Just wanna know, and it's great seeing @not-nef too.

@im-coder-lg
Copy link
Member

You can use the code, anyway I put my edition in the public domain, but I just want to know, since the code is like an exact copy, except your abridged features.

@im-coder-lg
Copy link
Member

Wait, you said here that you saw our beautiful project, are you talking about TimerX? That's the only one I know, just a doubt. If you do like it, feel free to contribute too! We are looking for more features to add, especially since we hit the stable mark.

@im-coder-lg
Copy link
Member

im-coder-lg commented Jan 31, 2022

Also, @not-nef this works only on Windows, since there are a bunch of errors when you try getting it onto POSIX-compliant operating systems like macOS and Linux.

@HuyHung1408
Copy link
Collaborator

Hi, I just want to know if you created this project by learning through YouTube. Coincidentally, I also made a program that mimics the entire code, except the theming. Just wanna know, and it's great seeing @not-nef too.

yeah, I did lol, my teacher just taught me some basic things of python, else, I just search the internet

@im-coder-lg
Copy link
Member

Oh, then it's fine. You can carry on. I still have to update my code base lol.

@HuyHung1408
Copy link
Collaborator

I will do if I learn more things in the future, my knowledge currently is still very basic!

@HuyHung1408
Copy link
Collaborator

Its easy, just add the following lines to your code:

bg_color = ttk.Style().lookup(".", "background")
app.wm_attributes("-transparent", bg_color)
app.update()
HWND = ctypes.windll.user32.GetForegroundWindow()
GlobalBlur(HWND)

Thanks a lot!

@im-coder-lg
Copy link
Member

Also, that code works only on Windows. You need to import BLurWindow too. You can take an example of the implementation from TimerX.

@HuyHung1408
Copy link
Collaborator

Ok, my calculator was transparent, what should I do next? (Sorry if this is a stupid question). This is the first time I do something much complex like this one.

@not-nef
Copy link
Member Author

not-nef commented Jan 31, 2022

Ok, my calculator was transparent, what should I do next? (Sorry if this is a stupid question). This is the first time I do something much complex like this one.

I forgot to tell you, you have to import ctypes at the beginning of your code!

@HuyHung1408
Copy link
Collaborator

I've added it after seeing it missing, still transparent. Thanks for your help. Guess I will try after holiday week. My parent told me to shut down the computer. See you later.

@not-nef
Copy link
Member Author

not-nef commented Jan 31, 2022

Bye

@not-nef
Copy link
Member Author

not-nef commented Jan 31, 2022

did you import the BlurWindow module correctly? You have to do from BlurWindow.blurwindow import *

@im-coder-lg
Copy link
Member

im-coder-lg commented Jan 31, 2022

I told @HuyHung1408 to implement it from TimerX. We did it a little bit better, hence I asked him to refer to our project.

@HuyHung1408
Copy link
Collaborator

HuyHung1408 commented Jan 31, 2022

I told @HuyHung1408 to implement it from TimerX. We did it a little bit better, hence I asked him to refer to our project.

Ok, trying now XD

@HuyHung1408
Copy link
Collaborator

did you import the BlurWindow module correctly? You have to do from BlurWindow.blurwindow import *

Yes, here is what happening
image
image

@HuyHung1408
Copy link
Collaborator

btw, thanks a lot for both of you

@HuyHung1408 HuyHung1408 pinned this issue Jan 31, 2022
@im-coder-lg
Copy link
Member

I think that is how it is supposed to be... Did you import ctypes?

@im-coder-lg
Copy link
Member

Try changing -transparent to -alpha and try. I don't think it was supposed to go like that.

@HuyHung1408
Copy link
Collaborator

I think that is how it is supposed to be... Did you import ctypes?

yes, after the from BlurWindow.blurwindow import *

@HuyHung1408
Copy link
Collaborator

Try changing -transparent to -alpha and try. I don't think it was supposed to go like that.

image
weird ahhh

@im-coder-lg
Copy link
Member

I meant not supposed to be, sorry for that. @not-nef can you tell how you added blur to TimerX? The TimerX system theme issue with transparency is here, although it's only transparency. How'd you do that?

@im-coder-lg
Copy link
Member

Oh... I experimented with that. For got about it. Let it be. I will try making a PR to fix this tomorrow, can't boot my PC atm.

@HuyHung1408
Copy link
Collaborator

Oh... I experimented with that. For got about it. Let it be. I will try making a PR to fix this tomorrow, can't boot my PC atm.

Ok, thank you a lot

@im-coder-lg
Copy link
Member

Also, I can't promise when I will make the PR, it's heavy IRL here. So, it is a big if, but if I get the chance, I'll utilise it.

@HuyHung1408
Copy link
Collaborator

Also, I can't promise when I will make the PR, it's heavy IRL here. So, it is a big if, but if I get the chance, I'll utilise it.

That's ok, don't worry. We can try another method if it didn't work

@HuyHung1408
Copy link
Collaborator

Thanks a lot, guys, I got it working after reviewing TimerX python files, light mode is cursed haha
image
image

@HuyHung1408
Copy link
Collaborator

I think I'll use the button instead of the command bar button for the dark/mode switcher since making the command bar dark will be more complicated. I guess I will focus on the dark/light mode switcher then will add blur and dark title bar later

@HuyHung1408
Copy link
Collaborator

Thanks a lot!

@HuyHung1408
Copy link
Collaborator

I pushed my latest changes to Github, there or some issues like Acrylic works with dark mode on start, click 'M' to change dark to light mode then it changes to Acrylic with a light mode, change it again and Acrylic didn't work with dark mode. Not sure why.

@HuyHung1408
Copy link
Collaborator

Current progress! How to set the titlebar to white again after apply light theme?
image
image

@sumeshir26
Copy link
Member

Call GlobalBlur again, and this time set Dark to False

@HuyHung1408
Copy link
Collaborator

Call GlobalBlur again, and this time set Dark to False

image
Like this, right?

@im-coder-lg
Copy link
Member

Lookin' great! Hiya @sumeshir26!

@sumeshir26
Copy link
Member

Yep, like that

@HuyHung1408
Copy link
Collaborator

Thank all of you!

@HuyHung1408 HuyHung1408 unpinned this issue Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants